Artix Linux Forum

Init systems => dinit => Topic started by: vaapicon on 06 December 2021, 00:01:36

Title: dnsmasq does not run as user dnsmasq
Post by: vaapicon on 06 December 2021, 00:01:36
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.

Code: [Select]
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.

Code: [Select]
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
Title: Re: dnsmasq does not run as user dnsmasq
Post by: konimex on 06 December 2021, 05:59:30
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.
Title: Re: dnsmasq does not run as user dnsmasq
Post by: vaapicon on 06 December 2021, 16:00:18
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?
Title: Re: dnsmasq does not run as user dnsmasq
Post by: konimex on 08 December 2021, 11:34:33
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.