about summary refs log tree commit diff stats
path: root/linux/conf/rc.d/fcgiwrap
diff options
context:
space:
mode:
Diffstat (limited to 'linux/conf/rc.d/fcgiwrap')
-rwxr-xr-xlinux/conf/rc.d/fcgiwrap41
1 files changed, 41 insertions, 0 deletions
diff --git a/linux/conf/rc.d/fcgiwrap b/linux/conf/rc.d/fcgiwrap
new file mode 100755
index 0000000..2059848
--- /dev/null
+++ b/linux/conf/rc.d/fcgiwrap
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+# /etc/rc.d/bird: start/stop fcgiwrapper
+#
+
+SSD=/sbin/start-stop-daemon
+NAME=fcgiwrap
+PROG=/usr/bin/spawn-fcgi
+USER=www
+GROUP=gitolite
+PIDFILE=/var/run/spawn_${NAME}.pid
+SOCKET=/var/run/fcgiwrap.sock
+OPTS="-u $USER -g $GROUP -P $PIDFILE -M 0660 -s $SOCKET -- /usr/sbin/${NAME}"
+
+
+case $1 in
+    start)
+        echo "Starting ${NAME}..."
+        $SSD --background --user $USER  --quiet --start --pidfile $PIDFILE --exec $PROG -- $OPTS
+    ;;
+stop)
+        echo "Stopping ${NAME}..."
+        $SSD --stop --remove-pidfile --retry 10 --pidfile $PIDFILE
+        ;;
+restart)
+        echo "Restarting ${NAME}..."
+        $0 stop
+        $0 start
+        ;;
+status)
+        $SSD --status --pidfile $PIDFILE
+        case $? in
+        0) echo "$PROG is running with pid $(cat $PIDFILE )" ;;
+        3) echo "$PROG is not running" ;;
+        4) echo "Unable to determine the program status" ;;
+        esac
+        ;;
+*)
+        echo "usage: $0 [start|stop|restart|status]"
+        ;;
+esac