summaryrefslogtreecommitdiffstats
path: root/net/dnsdist/files/dnsdist.init
blob: b9d4e0058c1fc33f4328ac74b9b7042e332cfd0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh /etc/rc.common
START=99

USE_PROCD=1

start_service() {
	config_load dnsdist
	local cfg=general
	local enabled
	local user
	local group

	config_get_bool enabled "$cfg" 'enabled' 1
	config_get user "$cfg" user root
	config_get group "$cfg" group root

	[ $enabled -gt 0 ] || return 1

	procd_open_instance
	procd_set_param command dnsdist --supervised -C /etc/dnsdist.conf
	[ "$user" != root ] && procd_append_param command -u "$user"
	[ "$group" != root ] && procd_append_param command -g "$group"
	procd_set_param file /etc/dnsdist.conf
	procd_set_param respawn
	procd_close_instance
}