kumquat-buildroot/package/unscd/S46unscd
Doug Kehn ccf8ecd10f 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>
2015-12-23 17:45:08 +01:00

26 lines
534 B
Bash

#!/bin/sh
NAME="nscd"
DAEMON="/usr/sbin/${NAME}"
PID_F="/var/run/nscd/${NAME}.pid"
case "$1" in
start)
printf "Starting ${NAME}: "
start-stop-daemon -S -p ${PID_F} -x ${DAEMON}
[ $? -eq 0 ] && echo "OK" || echo "FAIL"
;;
stop)
printf "Stopping ${NAME}: "
start-stop-daemon -K -p ${PID_F}
[ $? -eq 0 ] && echo "OK" || echo "FAIL"
;;
restart|reload)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart|reload}"
exit 1
esac