aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/config
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2013-09-17 21:45:30 +0000
committerJohn Crispin <john@openwrt.org>2013-09-17 21:45:30 +0000
commitf87409440298121ae1fbd718a17267cc180438e4 (patch)
tree2ceea2187fddf2c9fb21cb43a27d69afdd55e81f /package/network/config
parent4f62127dea854024116383c84fedb673baaae9cd (diff)
downloadupstream-f87409440298121ae1fbd718a17267cc180438e4.tar.gz
upstream-f87409440298121ae1fbd718a17267cc180438e4.tar.bz2
upstream-f87409440298121ae1fbd718a17267cc180438e4.zip
procd: convert various packages to procd style init.d scripts
Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 38023
Diffstat (limited to 'package/network/config')
-rwxr-xr-xpackage/network/config/netifd/files/etc/init.d/network43
1 files changed, 26 insertions, 17 deletions
diff --git a/package/network/config/netifd/files/etc/init.d/network b/package/network/config/netifd/files/etc/init.d/network
index 75586452f0..8031802e8d 100755
--- a/package/network/config/netifd/files/etc/init.d/network
+++ b/package/network/config/netifd/files/etc/init.d/network
@@ -3,17 +3,30 @@
START=20
STOP=90
-SERVICE_DAEMONIZE=1
-SERVICE_WRITE_PID=1
+USE_PROCD=1
-start() {
- stop
+start_service() {
[ -e /proc/sys/kernel/core_pattern ] && {
ulimit -c unlimited
echo '/tmp/%e.%p.%s.%t.core' > /proc/sys/kernel/core_pattern
}
- service_start /sbin/netifd
+ procd_open_instance
+ procd_set_param command /sbin/netifd
+ procd_set_param respawn
+ procd_close_instance
+}
+
+reload_service() {
+ ubus call network reload
+ /sbin/wifi down
+ /sbin/wifi up
+}
+
+stop_service() {
+ /sbin/wifi down
+}
+service_running() {
setup_switch() { return 0; }
include /lib/network
@@ -25,24 +38,20 @@ start() {
/sbin/wifi up
}
+service_triggers()
+{
+ procd_add_reload_trigger "network"
+}
+
restart() {
ifdown -a
sleep 1
- start
+ trap '' TERM
+ stop "$@"
+ start "$@"
}
shutdown() {
ifdown -a
stop
}
-
-stop() {
- /sbin/wifi down
- service_stop /sbin/netifd
-}
-
-reload() {
- ubus call network reload
- /sbin/wifi down
- /sbin/wifi up
-}