Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

modify for fedora, utilize fedora daemon

  • Loading branch information...
commit bf41d5951410cc4e567806fa187bbbc6ed1d9484 1 parent b641000
David Hardtke authored
View
18 recipes/default.rb
@@ -63,4 +63,22 @@
service "supervisor" do
action [:enable, :start]
end
+when "centos", "fedora"
+ template "/etc/init.d/supervisor" do
+ source "fedora/supervisor.init.erb"
+ owner "root"
+ group "root"
+ mode "755"
+ end
+
+ template "/etc/default/supervisor" do
+ source "fedora/supervisor.default.erb"
+ owner "root"
+ group "root"
+ mode "644"
+ end
+
+ service "supervisor" do
+ action [:enable,:start]
+ end
end
View
10 templates/default/fedora/supervisor.default.erb
@@ -0,0 +1,10 @@
+# Defaults for supervisor initscript
+# sourced by /etc/init.d/supervisor
+# installed at /etc/default/supervisor by the maintainer scripts
+
+#
+# This is a POSIX shell fragment
+#
+
+# Additional options that are passed to the Daemon.
+DAEMON_OPTS="<%= @node['supervisor']['daemon_options'] %>"
View
74 templates/default/fedora/supervisor.init.erb
@@ -0,0 +1,74 @@
+#! /bin/sh
+#
+# skeleton example file to build /etc/init.d/ scripts.
+# This file should be used to construct scripts for /etc/init.d.
+#
+# Written by David Hardtke <david@bright.com>.
+# Modified for fedora
+# chkconfig: - 55 45
+# description: supervisor.
+# processname: supervisord
+# config: /etc/supervisord.conf
+# pidfile: /var/run/supervisord.pid
+
+# Source function library.
+. /etc/init.d/functions
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON="$(which supervisord)"
+NAME=supervisord
+DESC=supervisor
+
+test -n "$DAEMON" || exit 0
+test -x $DAEMON || exit 0
+
+RETVAL=0
+LOGDIR=/var/log/supervisor
+PIDFILE=/var/run/$NAME.pid
+
+# Include supervisor defaults if available
+if [ -f /etc/default/supervisor ] ; then
+ . /etc/default/supervisor
+fi
+start () {
+ echo -n "Starting $DESC: "
+ daemon --pidfile $PIDFILE $DAEMON
+ test -f $PIDFILE || sleep 1
+ if running ; then
+ echo "$NAME."
+ else
+ echo " ERROR."
+ fi
+}
+
+stop () {
+ echo -n "Stopping $DESC: "
+ killproc -p $PIDFILE $DAEMON
+ echo "$NAME."
+}
+restart () {
+ stop
+ start
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ status)
+ status -p $PIDFILE $NAME
+ RETVAL=$?
+ ;;
+ restart|reload|force-reload)
+ restart
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|status|restart|reload|force-reload}"
+ RETVAL=2
+ ;;
+esac
+
+exit $RETVAL
Please sign in to comment.
Something went wrong with that request. Please try again.