aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/config/netifd/files/etc
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2013-09-17 21:45:30 +0000
committerJohn Crispin <blogic@openwrt.org>2013-09-17 21:45:30 +0000
commitd330d9fac452b6b37ded7541c381ca58ef7a4bc8 (patch)
treefc0c6034daf9bd0276dc91d027e26be26004680b /package/network/config/netifd/files/etc
parent021ff1b2d2678f1708c9fd86747c229f0ed227c0 (diff)
downloadmaster-187ad058-d330d9fac452b6b37ded7541c381ca58ef7a4bc8.tar.gz
master-187ad058-d330d9fac452b6b37ded7541c381ca58ef7a4bc8.tar.bz2
master-187ad058-d330d9fac452b6b37ded7541c381ca58ef7a4bc8.zip
procd: convert various packages to procd style init.d scripts
Signed-off-by: John Crispin <blogic@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@38023 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/network/config/netifd/files/etc')
-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
-}