From a2d0ba7017f51c8d08f1185b34f10a2c719a054a Mon Sep 17 00:00:00 2001 From: root Date: Wed, 30 Nov 2011 21:22:32 +0100 Subject: [PATCH] added init script for monit --- init.d/_start_stop | 15 +++++++++++++++ init.d/s1-create_user | 9 +++++++++ init.d/s1-rsync-piper | 9 +++++++++ init.d/s1-send_file | 9 +++++++++ init.d/s1-zfs | 11 +++++++++++ 5 files changed, 53 insertions(+) create mode 100755 init.d/_start_stop create mode 100755 init.d/s1-create_user create mode 100755 init.d/s1-rsync-piper create mode 100755 init.d/s1-send_file create mode 100755 init.d/s1-zfs diff --git a/init.d/_start_stop b/init.d/_start_stop new file mode 100755 index 0000000..8018d2e --- /dev/null +++ b/init.d/_start_stop @@ -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 index 0000000..a674258 --- /dev/null +++ b/init.d/s1-create_user @@ -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 index 0000000..1292177 --- /dev/null +++ b/init.d/s1-rsync-piper @@ -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 index 0000000..add641b --- /dev/null +++ b/init.d/s1-send_file @@ -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 index 0000000..4acdd3d --- /dev/null +++ b/init.d/s1-zfs @@ -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 $* + + -- 2.20.1