summaryrefslogtreecommitdiff
blob: 69e76c0acfdf27639ab4571e79c1a4c1b8ebb64f (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
27
28
#!/sbin/openrc-run
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License, v2 or later

stubby_opts="-C ${STUBBY_CONFIG_FILE:-/etc/stubby/stubby.yml} -v ${STUBBY_LOGLEVEL:-5}"
command="capsh"
command_args="--inh=cap_net_bind_service --user=stubby -- -c '/usr/bin/stubby -g ${stubby_opts} >>/var/log/stubby.log 2>&1'"
pidfile="/run/stubby.pid"
name="DNS Privacy Daemon"

depend()
{
	provide dns
	need localmount net
	after bootmisc
	use logger
}

start_pre()
{
	checkpath -f -m 0644 -o stubby:stubby /run/stubby.pid
	checkpath -f -m 0644 -o stubby:stubby /var/log/stubby.log
}

stop_post()
{
	[ -f /run/stubby.pid ] && rm /run/stubby.pid
}