/etc/init.d/evqueue is in evqueue-core 2.0-1build1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | #!/bin/sh
### BEGIN INIT INFO
# Provides: evqueue
# Required-Start: $remote_fs $syslog mysql
# Required-Stop: $remote_fs $syslog mysql
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: This is evqueue daemon
# Description: Enable service provided by daemon.
### END INIT INFO
export LANG=en_US.UTF-8
# Using the lsb functions to perform the operations.
. /lib/lsb/init-functions
# Process name ( For display )
NAME=evqueue
# Daemon name, where is the actual executable
DAEMON=/usr/bin/evqueue
CONFIG_FILE="/etc/evqueue.conf"
# pid file for the daemon
PIDFILE=/var/run/evqueue/evqueue.pid
DEFAULTS_FILE=/etc/default/evqueue
# If the daemon is not there, then exit.
test -x $DAEMON || exit 5
if [ -s $DEFAULTS_FILE ]; then
. $DEFAULTS_FILE
case "$EVQUEUE_ENABLE" in
true) ;;
false) log_daemon_msg "$NAME process is not running, value of EVQUEUE_ENABLE in $DEFAULTS_FILE is 'false';"
exit
;;
*) log_failure_msg "Value of EVQUEUE_ENABLE in $DEFAULTS_FILE must be either 'true' or 'false';"
log_failure_msg "not starting evqueue daemon."
exit 1
;;
esac
fi
case $1 in
start)
# Checked the PID file exists and check the actual status of process
if [ -e $PIDFILE ]; then
status_of_proc -p $PIDFILE $DAEMON "$NAME process" && status="0" || status="$?"
# If the status is SUCCESS then don't need to start again.
if [ $status = "0" ]; then
exit # Exit
fi
fi
# Start the daemon.
log_daemon_msg "Starting the process" "$NAME"
# Start the daemon with the help of start-stop-daemon
# Log the message appropriately
if /sbin/start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON -- --daemon --config $CONFIG_FILE ; then
log_end_msg 0
else
log_end_msg 1
fi
;;
stop)
# Stop the daemon.
if [ -e $PIDFILE ]; then
status_of_proc -p $PIDFILE $DAEMON "Stopping the $NAME process" && status="0" || status="$?"
if [ "$status" = 0 ]; then
/sbin/start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE
/bin/rm -rf $PIDFILE
fi
else
log_daemon_msg "$NAME process is not running"
log_end_msg 0
fi
;;
restart|force-reload)
# Restart the daemon.
$0 stop && sleep 2 && $0 start
;;
status)
# Check the status of the process.
if [ -e $PIDFILE ]; then
status_of_proc -p $PIDFILE $DAEMON "$NAME process" && exit 0 || exit $?
else
log_daemon_msg "$NAME Process is not running"
#log_end_msg 3
exit 3
fi
;;
*)
# For invalid arguments, print the usage message.
echo "Usage: $0 {start|stop|restart|status}"
exit 2
;;
esac
### END INIT INFO
|