Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/openwrt/routing.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoritz Warning <moritzwarning@web.de>2014-05-19 01:50:33 +0400
committerMoritz Warning <moritzwarning@web.de>2014-05-19 02:07:17 +0400
commitc866e0c9e3cdd6f6b0764d0d53787a5e8a707462 (patch)
tree46af902c0f12def3e675aad1629583d6a6e60a8a /nodogsplash
parenta24c6cfa0fa4a9cf583cbda7ba32818d8ab902c6 (diff)
use procd for nodogsplash, thanks @lynxis
Diffstat (limited to 'nodogsplash')
-rw-r--r--nodogsplash/files/nodogsplash.init47
1 files changed, 19 insertions, 28 deletions
diff --git a/nodogsplash/files/nodogsplash.init b/nodogsplash/files/nodogsplash.init
index b465792..e5a20b2 100644
--- a/nodogsplash/files/nodogsplash.init
+++ b/nodogsplash/files/nodogsplash.init
@@ -10,42 +10,33 @@
# Comment by that author: Could be better, but it's working as expected)
#
+START=95
+STOP=95
+
+USE_PROCD=1
IPT=/usr/sbin/iptables
WD_DIR=/usr/bin
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
# -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 -d 5"
-
-start() {
- echo "Starting nodogsplash ... "
- if $WD_DIR/ndsctl status 2> /dev/null; then
- echo "FAILED: nodogsplash already running"
- else
- if test_module && $WD_DIR/nodogsplash $OPTIONS; then
- echo "OK: nodogsplash started"
- else
- echo "FAILED: nodogsplash exited with non 0 status"
- fi
- fi
+OPTIONS="-s -f -d 5"
+
+start_service() {
+ if test_module ; then
+ procd_open_instance
+ procd_set_param command /usr/bin/nodogsplash $OPTIONS
+ procd_set_param respawn
+ procd_close_instance
+ else
+ logger -s -t nodogsplash -p daemon.error "nodogsplash is missing some kernel modules"
+ fi
}
-stop() {
- echo "Stopping nodogsplash ... "
- if $WD_DIR/ndsctl status 2> /dev/null; then
- if $WD_DIR/ndsctl stop; then
- echo "OK: nodogsplash stopped"
- else
- echo "FAILED: ndsctl stop exited with non 0 status"
- fi
- else
- echo "FAILED: nodogsplash was not running"
- fi
+stop_service() {
+ # nodogsplash doesn't exit fast enought, when procd terminates it.
+ # otherwise procd will restart nodogsplash twice. first time starting nodogsplash fails, second time it succeeds
+ sleep 1
}
status() {