#!/bin/sh # # /etc/init.d/icegridregistry Start icegridregistry daemon. # # # Customize the variables in /etc/default/icegridregistry rather than here set -e . /lib/lsb/init-functions BINNAME=icegridregistry CONFIGNAME=$BINNAME ICECONFIG="" ICECHDIR="" [ -f /etc/default/$CONFIGNAME ] && . /etc/default/$CONFIGNAME NET="$ICE_HOME/bin" test -f ${NET}/${BINNAME} | exit 0 # Method to start up the daemon do_start () { log_begin_msg "Starting ${CONFIGNAME}:" start-stop-daemon --start --quiet \ ${ICECHDIR} \ --exec ${NET}/${BINNAME} -- $ICECONFIG --daemon --nochdir log_end_msg 0 } do_stop () { log_begin_msg "Stopping ${CONFIGNAME}:" start-stop-daemon --stop --quiet --oknodo --exec ${NET}/${BINNAME} # DAEMONPID=$(cat $PIDFILE | tr -d '[:blank:]') # KILLCOUNT=1 # while [ $KILLCOUNT -le 5 ]; do # if stillrunning; then # kill $DAEMONPID # else # break # fi # sleep 1 # KILLCOUNT=$(( $KILLCOUNT + 1 )) # done # if stillrunning; then # echo -n " not responding to TERM signal (pid $DAEMONPID)" # fi log_end_msg 0 } # Set 'manual' to indicate if we were started by hand. case "$0" in */S[0-9][0-9]*|*/K[0-9][0-9]*) manual= ;; *) manual=1 ;; esac case "$1" in start) do_start ;; stop) do_stop ;; restart) do_stop sleep 2 do_start ;; *) log_success_msg "Usage: /etc/init.d/${BINNAME} {start|stop|restart}" exit 1 esac exit 0