#!/sbin/openrc-run
# Copyright 1999-2019 Gentoo Authors
# Copyright 2026 Artix Linux maintainers
# Distributed under the terms of the GNU General Public License, v2 or later

supervisor=supervise-daemon
command="/usr/bin/stubby"
command_args="-C ${STUBBY_CONFIG_FILE:-/etc/stubby/stubby.yml} -v ${STUBBY_LOGLEVEL:-5}"
command_user="stubby"
error_log="/var/log/stubby.log"
pidfile="/run/stubby.pid"
name="DNS Privacy Daemon"
capabilities="^cap_net_bind_service"

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

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