aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/services/ipset-dns
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/services/ipset-dns
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/services/ipset-dns')
-rwxr-xr-xpackage/network/services/ipset-dns/files/ipset-dns.init32
1 files changed, 12 insertions, 20 deletions
diff --git a/package/network/services/ipset-dns/files/ipset-dns.init b/package/network/services/ipset-dns/files/ipset-dns.init
index 7b732791ea..0a76fcc4cd 100755
--- a/package/network/services/ipset-dns/files/ipset-dns.init
+++ b/package/network/services/ipset-dns/files/ipset-dns.init
@@ -3,9 +3,7 @@
START=61
-SERVICE_DAEMONIZE=1
-SERVICE_WRITE_PID=1
-
+USE_PROCD=1
find_nameserver() {
. /lib/functions/network.sh
@@ -38,28 +36,22 @@ start_instance() {
config_get port "$cfg" port $((PORT++))
- SERVICE_PID_FILE="/var/run/ipset-dns-$port.pid" \
- service_start /usr/sbin/ipset-dns "$ipset" "$ipset6" "$port" "$dns"
+ procd_open_instance
+ procd_set_param command /usr/sbin/ipset-dns "$ipset" "$ipset6" "$port" "$dns"
+ procd_set_param env NO_DAEMONIZE=1
+ procd_set_param respawn
+ procd_close_instance
+}
+
+service_triggers()
+{
+ procd_add_reload_trigger "ipset-dns"
}
-start() {
+start_service() {
PORT=53001
DEFNS="$(find_nameserver)"
- # required by ipset-dns to not daemonize itself
- export NO_DAEMONIZE=1
-
config_load ipset-dns
config_foreach start_instance ipset-dns
}
-
-stop() {
- local pid
- for pid in /var/run/ipset-dns-*.pid; do
- [ -f "$pid" ] || continue
- SERVICE_PID_FILE="$pid" \
- service_stop /usr/sbin/ipset-dns
- rm -f "$pid"
- done
-}
-