aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/etc/init.d
diff options
context:
space:
mode:
authorNicolas Thill <nico@openwrt.org>2011-11-07 22:58:34 +0000
committerNicolas Thill <nico@openwrt.org>2011-11-07 22:58:34 +0000
commit76be14c4c26d8c38aa198a811867a797dcc5d403 (patch)
tree96b35712477b6f5ac1b672b4f3f17b3c0fa14742 /package/base-files/files/etc/init.d
parent6aa646482adcd2b00f5e05e59c55084d21a06159 (diff)
downloadupstream-76be14c4c26d8c38aa198a811867a797dcc5d403.tar.gz
upstream-76be14c4c26d8c38aa198a811867a797dcc5d403.tar.bz2
upstream-76be14c4c26d8c38aa198a811867a797dcc5d403.zip
package/base-files: use new service wrapper
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@28835 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files/files/etc/init.d')
-rwxr-xr-xpackage/base-files/files/etc/init.d/boot25
-rwxr-xr-xpackage/base-files/files/etc/init.d/sysntpd12
-rwxr-xr-xpackage/base-files/files/etc/init.d/watchdog11
3 files changed, 25 insertions, 23 deletions
diff --git a/package/base-files/files/etc/init.d/boot b/package/base-files/files/etc/init.d/boot
index 7f6b26791b..44b53fe27a 100755
--- a/package/base-files/files/etc/init.d/boot
+++ b/package/base-files/files/etc/init.d/boot
@@ -1,5 +1,5 @@
#!/bin/sh /etc/rc.common
-# Copyright (C) 2006 OpenWrt.org
+# Copyright (C) 2006-2011 OpenWrt.org
START=10
STOP=98
@@ -23,24 +23,25 @@ system_config() {
[ -n "$zonename" ] && [ -f "/usr/share/zoneinfo/$zonename" ] && ln -s "/usr/share/zoneinfo/$zonename" /tmp/localtime
if [ -x /sbin/syslogd ]; then
- local log_ip log_size log_port log_type log_file
+ local args log_ip log_size log_port log_type log_file
config_get log_ip "$cfg" log_ip
config_get log_size "$cfg" log_size 16
config_get log_port "$cfg" log_port 514
config_get log_type "$cfg" log_type circular
config_get log_file "$cfg" log_file "/var/log/messages"
+ args="${log_ip:+-L -R ${log_ip}:${log_port}} ${conloglevel:+-l $conloglevel}"
if [ "$log_type" = "file" ]; then
- syslogd -s $log_size -O $log_file \
- ${log_ip:+-L -R ${log_ip}:${log_port}} \
- ${conloglevel:+-l $conloglevel} -S
+ args="$args -s $log_size -O $log_file -S"
else
- syslogd -C${log_size} \
- ${log_ip:+-L -R ${log_ip}:${log_port}} \
- ${conloglevel:+-l $conloglevel}
+ args="$args -C${log_size}"
fi
+ service_start /sbin/syslogd $args
+ fi
+ if [ -x /sbin/klogd ]; then
+ config_get klogconloglevel "$cfg" klogconloglevel
+ args="${klogconloglevel:+-c $klogconloglevel}"
+ service_start /sbin/klogd $args
fi
- config_get klogconloglevel "$cfg" klogconloglevel
- [ -x /sbin/klogd ] && klogd ${klogconloglevel:+-c $klogconloglevel}
}
apply_uci_config() {
@@ -101,6 +102,6 @@ start() {
}
stop() {
- killall -9 syslogd 2> /dev/null
+ service_stop /sbin/klogd
+ service_stop /sbin/syslogd
}
-
diff --git a/package/base-files/files/etc/init.d/sysntpd b/package/base-files/files/etc/init.d/sysntpd
index fefb48fb19..aa35da8313 100755
--- a/package/base-files/files/etc/init.d/sysntpd
+++ b/package/base-files/files/etc/init.d/sysntpd
@@ -3,11 +3,12 @@
START=98
-BIN=/usr/sbin/ntpd
-PID=/var/run/sysntpd.pid
+SERVICE_DAEMONIZE=1
+SERVICE_WRITE_PID=1
+SERVICE_PID_FILE=/var/run/sysntpd.pid
start() {
- [ -x $BIN ] || exit 0
+ [ -x $PROG ] || return 1
local peers
@@ -25,11 +26,10 @@ start() {
append args "-p $peer"
done
- start-stop-daemon -x $BIN -m -p $PID -b -S -- $args
+ service_start /usr/sbin/ntpd $args
fi
}
stop() {
- service_kill ${BIN##*/} $PID
- rm -f $PID
+ service_stop /usr/sbin/ntpd
}
diff --git a/package/base-files/files/etc/init.d/watchdog b/package/base-files/files/etc/init.d/watchdog
index 65a45e53f2..299c891428 100755
--- a/package/base-files/files/etc/init.d/watchdog
+++ b/package/base-files/files/etc/init.d/watchdog
@@ -1,12 +1,13 @@
#!/bin/sh /etc/rc.common
-# Copyright (C) 2008-2010 OpenWrt.org
+# Copyright (C) 2008-2011 OpenWrt.org
START=97
+
start() {
- [ -c /dev/watchdog ] && [ -x /sbin/watchdog ] && \
- watchdog -t 5 /dev/watchdog
+ [ -c /dev/watchdog ] || return 1
+ [ -x /sbin/watchdog ] || return 1
+ service_start /sbin/watchdog -t 5 /dev/watchdog
}
-
stop() {
- killall -q watchdog
+ service_stop /sbin/watchdog
}