You are not logged in.
Pages: 1
Couple months ago i tried dnsmasq and stubby. During that time i noticed that there's no init script for stubby so i wrote one:
#!/bin/sh
### BEGIN INIT INFO
# Provides: stubby
# Required-Start: $network $remote_fs $syslog
# Required-Stop: $network $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: a dns resolver
### END INIT INFO
#. /lib/lsb/init-functions
case "$1" in
start)
touch /run/stubby.pid
chmod 600 /run/stubby.pid
chown stubby:65534 /run/stubby.pid
sudo -u stubby stubby -g
;;
stop)
killall stubby
;;
*)
echo "Usage: $SCRIPTNAME start" >&2
exit 3
;;
esac
pretty obvious stuff. The #BEGIN ... #END - parts i copied from dnsmasq's init file or some other file and changed a few rows.
How about adding something like this in the stubby package?
Offline
sudo shouldn't be used in init scripts. There are other issues.
For a better version (along with postinst, prerm & postrm scripts) see https://bugs.debian.org/cgi-bin/bugrepo … ug=1008931.
Related: https://dev1galaxy.org/viewtopic.php?id=4865 ← that shows how to generate an init script from the supplied /lib/systemd/system/stubby.service unit file.
Brianna Ghey — Rest In Power
Offline
Pages: 1