Status check in ubuntu init script
Thanks @LeonB
This commit is contained in:
+7
-1
@@ -45,6 +45,8 @@ test -x $CP_DAEMON || exit 0
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
. /lib/lsb/init-functions
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
echo "Starting $DESC"
|
echo "Starting $DESC"
|
||||||
@@ -63,9 +65,13 @@ case "$1" in
|
|||||||
start-stop-daemon --stop --pidfile $CP_PID_FILE --retry 15
|
start-stop-daemon --stop --pidfile $CP_PID_FILE --retry 15
|
||||||
start-stop-daemon -d $CP_APP_PATH -c $CP_RUN_AS --start --background --pidfile $CP_PID_FILE --exec $CP_DAEMON -- $CP_DAEMON_OPTS
|
start-stop-daemon -d $CP_APP_PATH -c $CP_RUN_AS --start --background --pidfile $CP_PID_FILE --exec $CP_DAEMON -- $CP_DAEMON_OPTS
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
status)
|
||||||
|
status_of_proc -p $CP_PID_FILE "$CP_DAEMON" "$NAME"
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
N=/etc/init.d/$NAME
|
N=/etc/init.d/$NAME
|
||||||
echo "Usage: $N {start|stop|restart|force-reload}" >&2
|
echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Reference in New Issue
Block a user