diff options
author | John Crispin <blogic@openwrt.org> | 2013-09-17 21:45:30 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2013-09-17 21:45:30 +0000 |
commit | d330d9fac452b6b37ded7541c381ca58ef7a4bc8 (patch) | |
tree | fc0c6034daf9bd0276dc91d027e26be26004680b /package/network/services/dnsmasq | |
parent | 021ff1b2d2678f1708c9fd86747c229f0ed227c0 (diff) | |
download | upstream-d330d9fac452b6b37ded7541c381ca58ef7a4bc8.tar.gz upstream-d330d9fac452b6b37ded7541c381ca58ef7a4bc8.tar.bz2 upstream-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/services/dnsmasq')
-rw-r--r-- | package/network/services/dnsmasq/files/dnsmasq.init | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index 630c07d1d8..a0aee8e02b 100644 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -3,7 +3,8 @@ START=60 -SERVICE_USE_PID=1 +USE_PROCD=1 +PROG=/usr/sbin/dnsmasq DNS_SERVERS="" DOMAIN="" @@ -479,7 +480,12 @@ dhcp_hostrecord_add() { xappend "--host-record=$record" } -start() { +service_triggers() +{ + procd_add_reload_trigger "dhcp" +} + +start_service() { include /lib/network scan_interfaces @@ -488,6 +494,10 @@ start() { config_load dhcp + procd_open_instance + procd_set_param command $PROG -C $CONFIGFILE -k + procd_close_instance + # before we can call xappend mkdir -p $(dirname $CONFIGFILE) @@ -528,23 +538,19 @@ start() { config_foreach dhcp_cname_add cname echo >> $CONFIGFILE - service_start /usr/sbin/dnsmasq -C $CONFIGFILE && { - rm -f /tmp/resolv.conf - [ $ADD_LOCAL_DOMAIN -eq 1 ] && [ -n "$DOMAIN" ] && { - echo "search $DOMAIN" >> /tmp/resolv.conf - } - DNS_SERVERS="$DNS_SERVERS 127.0.0.1" - for DNS_SERVER in $DNS_SERVERS ; do - echo "nameserver $DNS_SERVER" >> /tmp/resolv.conf - done + rm -f /tmp/resolv.conf + [ $ADD_LOCAL_DOMAIN -eq 1 ] && [ -n "$DOMAIN" ] && { + echo "search $DOMAIN" >> /tmp/resolv.conf } + DNS_SERVERS="$DNS_SERVERS 127.0.0.1" + for DNS_SERVER in $DNS_SERVERS ; do + echo "nameserver $DNS_SERVER" >> /tmp/resolv.conf + done } -stop() { - service_stop /usr/sbin/dnsmasq && { - [ -f /tmp/resolv.conf ] && { - rm -f /tmp/resolv.conf - ln -s /tmp/resolv.conf.auto /tmp/resolv.conf - } +stop_service() { + [ -f /tmp/resolv.conf ] && { + rm -f /tmp/resolv.conf + ln -s /tmp/resolv.conf.auto /tmp/resolv.conf } } |