X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=debian%2Fmetaproxy.init;h=6b728230608f1874038d314b9be9fd0557cbe859;hb=8e494be7d760b4fe8f5b0d9e48a19b2dca7d962b;hp=4ea25a5d4d223aa67b62057a80c697f528ba8a9e;hpb=e0a6dbc8f30727e5625253473b814d06467ffcc1;p=metaproxy-moved-to-github.git diff --git a/debian/metaproxy.init b/debian/metaproxy.init index 4ea25a5..6b72823 100644 --- a/debian/metaproxy.init +++ b/debian/metaproxy.init @@ -14,7 +14,7 @@ # PATH should only include /usr/* if it runs after the mountnfs.sh script PATH=/sbin:/usr/sbin:/bin:/usr/bin NAME=metaproxy -DAEMON=/usr/sbin/$NAME +DAEMON=/usr/bin/$NAME DAEMON_OPTS="-h" PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME @@ -22,6 +22,9 @@ SCRIPTNAME=/etc/init.d/$NAME # Exit if the package is not installed [ -x "$DAEMON" ] || exit 0 +# Read user information +. /etc/metaproxy/metaproxy.user + # Read configuration variable file if it is present [ -r /etc/default/$NAME ] && . /etc/default/$NAME @@ -61,7 +64,7 @@ do_stop() # 1 if daemon was already stopped # 2 if daemon could not be stopped # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME + start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE RETVAL="$?" [ "$RETVAL" = 2 ] && return 2 # Wait for children to finish too if this is a daemon that forks @@ -70,8 +73,8 @@ do_stop() # that waits for the process to drop all resources that could be # needed by services started subsequently. A last resort is to # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 + #start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON + #[ "$?" = 2 ] && return 2 # Many daemons don't delete their pidfiles when they exit. rm -f $PIDFILE return "$RETVAL" @@ -96,7 +99,10 @@ case "$1" in do_start case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + 2) [ "$VERBOSE" = no ] && \ + log_daemon_msg "Starting $DESC" "$NAME" + log_end_msg 1 + ;; esac ;; stop) @@ -104,7 +110,10 @@ case "$1" in do_stop case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + 2) [ "$VERBOSE" = no ] && \ + log_daemon_msg "Stopping $DESC" "$NAME" + log_end_msg 1 + ;; esac ;; #reload|force-reload)