use procd for nodogsplash, thanks @lynxis
This commit is contained in:
parent
a24c6cfa0f
commit
c866e0c9e3
|
@ -10,42 +10,33 @@
|
||||||
# Comment by that author: Could be better, but it's working as expected)
|
# Comment by that author: Could be better, but it's working as expected)
|
||||||
#
|
#
|
||||||
|
|
||||||
|
START=95
|
||||||
|
STOP=95
|
||||||
|
|
||||||
|
USE_PROCD=1
|
||||||
|
|
||||||
IPT=/usr/sbin/iptables
|
IPT=/usr/sbin/iptables
|
||||||
WD_DIR=/usr/bin
|
WD_DIR=/usr/bin
|
||||||
NDS_CONF=/etc/nodogsplash/nodogsplash.conf
|
NDS_CONF=/etc/nodogsplash/nodogsplash.conf
|
||||||
OPTIONS=""
|
|
||||||
START=65
|
|
||||||
STOP=65
|
|
||||||
# -s -d 5 runs in background, with level 5 (not so verbose) messages to syslog
|
# -s -d 5 runs in background, with level 5 (not so verbose) messages to syslog
|
||||||
# -f -d 7 runs in foreground, with level 7 (verbose) debug messages to terminal
|
# -f -d 7 runs in foreground, with level 7 (verbose) debug messages to terminal
|
||||||
# N.B.: -f will fail if starting at boot from rcS
|
OPTIONS="-s -f -d 5"
|
||||||
#OPTIONS="-s -d 5"
|
|
||||||
|
|
||||||
start() {
|
start_service() {
|
||||||
echo "Starting nodogsplash ... "
|
if test_module ; then
|
||||||
if $WD_DIR/ndsctl status 2> /dev/null; then
|
procd_open_instance
|
||||||
echo "FAILED: nodogsplash already running"
|
procd_set_param command /usr/bin/nodogsplash $OPTIONS
|
||||||
else
|
procd_set_param respawn
|
||||||
if test_module && $WD_DIR/nodogsplash $OPTIONS; then
|
procd_close_instance
|
||||||
echo "OK: nodogsplash started"
|
else
|
||||||
else
|
logger -s -t nodogsplash -p daemon.error "nodogsplash is missing some kernel modules"
|
||||||
echo "FAILED: nodogsplash exited with non 0 status"
|
fi
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop_service() {
|
||||||
echo "Stopping nodogsplash ... "
|
# nodogsplash doesn't exit fast enought, when procd terminates it.
|
||||||
if $WD_DIR/ndsctl status 2> /dev/null; then
|
# otherwise procd will restart nodogsplash twice. first time starting nodogsplash fails, second time it succeeds
|
||||||
if $WD_DIR/ndsctl stop; then
|
sleep 1
|
||||||
echo "OK: nodogsplash stopped"
|
|
||||||
else
|
|
||||||
echo "FAILED: ndsctl stop exited with non 0 status"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "FAILED: nodogsplash was not running"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
status() {
|
status() {
|
||||||
|
|
Loading…
Reference in New Issue