mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-08-02 07:57:43 +00:00
package/unscd: add PID file to init script
unscd creates/manages it's own PID file. Pass PID file reference to start-stop-daemon. Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Doug Kehn <rdkehn@yahoo.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
This commit is contained in:
parent
0afd340916
commit
ccf8ecd10f
@ -2,16 +2,17 @@
|
|||||||
|
|
||||||
NAME="nscd"
|
NAME="nscd"
|
||||||
DAEMON="/usr/sbin/${NAME}"
|
DAEMON="/usr/sbin/${NAME}"
|
||||||
|
PID_F="/var/run/nscd/${NAME}.pid"
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
printf "Starting ${NAME}: "
|
printf "Starting ${NAME}: "
|
||||||
start-stop-daemon -S -x ${DAEMON}
|
start-stop-daemon -S -p ${PID_F} -x ${DAEMON}
|
||||||
[ $? -eq 0 ] && echo "OK" || echo "FAIL"
|
[ $? -eq 0 ] && echo "OK" || echo "FAIL"
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
printf "Stopping ${NAME}: "
|
printf "Stopping ${NAME}: "
|
||||||
start-stop-daemon -K -x ${DAEMON}
|
start-stop-daemon -K -p ${PID_F}
|
||||||
[ $? -eq 0 ] && echo "OK" || echo "FAIL"
|
[ $? -eq 0 ] && echo "OK" || echo "FAIL"
|
||||||
;;
|
;;
|
||||||
restart|reload)
|
restart|reload)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user