added init script for monit
authorroot <root@rsync1>
Wed, 30 Nov 2011 20:22:32 +0000 (21:22 +0100)
committerroot <root@rsync1>
Wed, 30 Nov 2011 20:22:32 +0000 (21:22 +0100)
init.d/_start_stop [new file with mode: 0755]
init.d/s1-create_user [new file with mode: 0755]
init.d/s1-rsync-piper [new file with mode: 0755]
init.d/s1-send_file [new file with mode: 0755]
init.d/s1-zfs [new file with mode: 0755]

diff --git a/init.d/_start_stop b/init.d/_start_stop
new file mode 100755 (executable)
index 0000000..8018d2e
--- /dev/null
@@ -0,0 +1,15 @@
+_start_stop() {
+
+case $1 in
+       start)
+               cd /srv/cloudstore && ( $DAEMON 2>&1 ) > /tmp/$NAME.log &
+               echo $! > /tmp/$NAME.pid
+               ;;
+       stop)  
+               kill `cat /tmp/$NAME.pid` ;;
+       *)  
+               echo "usage: $0 {start|stop}" ;;
+       esac
+exit 0
+
+}
diff --git a/init.d/s1-create_user b/init.d/s1-create_user
new file mode 100755 (executable)
index 0000000..a674258
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+NAME=s1-create_user
+DAEMON="gearman -n -f create_user -w ./gearman/create_user"
+
+. /srv/cloudstore/init.d/_start_stop
+_start_stop $*
+
+
diff --git a/init.d/s1-rsync-piper b/init.d/s1-rsync-piper
new file mode 100755 (executable)
index 0000000..1292177
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+NAME=s1-rsync-piper
+DAEMON="./rsync-piper.pl s1"
+
+. /srv/cloudstore/init.d/_start_stop
+_start_stop $*
+
+
diff --git a/init.d/s1-send_file b/init.d/s1-send_file
new file mode 100755 (executable)
index 0000000..add641b
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+NAME=s1-send_file
+DAEMON="./gearman/send_file.pl"
+
+. /srv/cloudstore/init.d/_start_stop
+_start_stop $*
+
+
diff --git a/init.d/s1-zfs b/init.d/s1-zfs
new file mode 100755 (executable)
index 0000000..4acdd3d
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+NAME=s1-zfs
+DAEMON="./gearman/zfs.pl"
+
+export ZSLICE=rsync1/s1
+
+. /srv/cloudstore/init.d/_start_stop
+_start_stop $*
+
+