The current dnsmasq service is set to run dnsmasq as the "dnsmasq" user but can't. Its called with the -d flag, but it wont drop its privileges in this mode and runs as root.
type = process
command = /usr/bin/dnsmasq -d --enable-dbus -u dnsmasq -g dnsmasq
smooth-recovery = true
logfile = /var/log/dinit/dnsmasq.log
depends-on = dbus
It works as a bgprocess, like below.
type = bgprocess
command = /usr/bin/dnsmasq --enable-dbus -u dnsmasq -g dnsmasq
pid-file = /run/dnsmasq.pid
smooth-recovery = true
logfile = /var/log/dinit/dnsmasq.log
depends-on = dbus
Changed the flags from -d to -k and now it spawns a new process which drops the privileges. Logs, however, will be handled by syslog.
Thanks. That works.
I use syslog. The logs from dinit don't have timestamps. Currently, I use a little script to remove the "logfile" entries from the service files. Is there someway, with dinit, to have the timestamps?
For now, unfortunately, no timestamps. You can always request the timestamps on logs in dinit's author github (https://github.com/davmac314/dinit), or I can do that for you.