python-dataproperty: bump version to 0.17.0
[buildroot-gz.git] / package / rng-tools / S21rngd
blobb38be5a507b71ab23a9d4306014ecf652370ff87
1 #!/bin/sh
3 NAME="rngd"
4 DAEMON="/usr/sbin/${NAME}"
5 DAEMON_ARGS=""
6 CFG_FILE="/etc/default/${NAME}"
7 PID_FILE="/var/run/${NAME}.pid"
9 # Read configuration variable file if it is present
10 [ -r "${CFG_FILE}" ] && . "${CFG_FILE}"
12 start()
14 printf "Starting ${NAME}: "
15 start-stop-daemon -S -q -x "${DAEMON}" -- ${DAEMON_ARGS}
16 [ $? = 0 ] && echo "OK" || echo "FAIL"
19 stop()
21 printf "Stopping ${NAME}: "
22 # This daemon does not exit properly with the default TERM signal unless
23 # it's forced to work by something reading /dev/random. Killing it and
24 # removing its PID file is more straightforward.
25 if start-stop-daemon -K -q -s KILL -p "${PID_FILE}" -n "${NAME}"; then
26 rm -f "${PID_FILE}"
27 echo "OK"
28 else
29 echo "FAIL"
33 case "$1" in
34 start)
35 start
37 stop)
38 stop
40 restart|reload)
41 stop
42 start
45 echo "Usage: $0 {start|stop|restart|reload}" >&2
46 exit 1
48 esac