[Pkg-nagios-changes] [SCM] Debian packaging for mod gearman. branch, master, updated. debian/1.3.0-1-7-g46a112f
Stig Sandbeck Mathisen
ssm at debian.org
Wed Jun 6 22:30:17 UTC 2012
The following commit has been merged in the master branch:
commit 46a112fc12f43f9c1c72dc9393812698845e96ad
Author: Stig Sandbeck Mathisen <ssm at debian.org>
Date: Thu Jun 7 00:24:24 2012 +0200
Make init script a bit more robust
diff --git a/debian/mod-gearman-worker.init b/debian/mod-gearman-worker.init
index 7b7746b..540984f 100755
--- a/debian/mod-gearman-worker.init
+++ b/debian/mod-gearman-worker.init
@@ -43,11 +43,14 @@ log()
log_action_end_msg ${success:-0} "$*"
}
-pre_start() {
+abort_if_unconfigured() {
if [ ! -e "$CONFIG" ]; then
log 1 "Configuration file $CONFIG not present"
exit 1
fi
+}
+
+pre_start() {
install -o $USER -g $USER -d $(dirname $PIDFILE)
}
@@ -83,8 +86,9 @@ status_worker() {
case "$1" in
start)
- pre_start
+ abort_if_unconfigured
log_daemon_msg "Starting $DESC" "$NAME"
+ pre_start
start_worker
case "$?" in
0|1) log_end_msg 0 ;;
@@ -108,6 +112,7 @@ case "$1" in
status_worker && exit 0 || exit $?
;;
restart)
+ abort_if_unconfigured
log_daemon_msg "Restarting $DESC" "$NAME"
stop_worker
case "$?" in
--
Debian packaging for mod gearman.
More information about the Pkg-nagios-changes
mailing list