systemd ExecStartPre test config

Bug #1639452 reported by ingopingo on 2016-11-05
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dnsmasq (Ubuntu)
Undecided
Unassigned

Bug Description

The standard configuration file of dnsmasq is complete commented out. The real configuration is saved in /etc/dnsmasq.d, so the test of systemd is a fake.

In the Service Section of /lib/systemd/system/dnsmasq.service the ExecStartPre directive should be set to "/usr/sbin/dnsmasq --conf-dir=/etc/dnsmasq.d --test"

ingopingo (ingopingo) wrote :

Sorry, the right option is --conf-dir=/etc/dnsmasq.d

description: updated
ingopingo (ingopingo) wrote :

Another problem: if systemd control the network in place of network manager, dnsmasq starts before systemd-resolved.service. dnsmasq fails with error message "directory /etc/resolv.conf for resolv-file is missing, cannot poll".

Solution: in section [Unit] of /lib/systemd/system/dnsmasq.service insert After=systemd-resolved.service

Changed in dnsmasq (Ubuntu):
status: New → Triaged

I'm currently scanning through bugs that were dormant for too long.
I must beg your pardon - in particular because I was the (less experienced me back then) one who triaged it initially.

Looking back the right decision would have been to ask you to report this to Debian.

This bug is present in Debian too, and Ubuntu currently doesn't make any changes over the Debian package. So this bug would be best fixed directly in Debian, and then Ubuntu will pick up the fix automatically.
OTOH I think your request is perfectly valid - the dependency on systemd-resolvd as well as the check of the right config.

Therefore it would be great if you could report that to Debian and link the bug here.
Once fixed there Ubuntu will automatically pick that up for the next release and from there we can consider SRU's.

Hi,
I again come by cleaning up dormant bugs which just means to me that it isn't important enough for anyone to be able to allocate time for it.
While the suggestion you made is absolutely correct it just wasn't important to many users it seems and also of low severity just dropping the ExecStartPre test on the floor by using the wrong conf.

I really think it is not worth a delta to Debian to be carried in Ubuntu (due to low severity), as I said before Debian is just as affected - so reporting it there would benefit Debian as well and eventually be picked up by Ubuntu as well.

Furthermore the config dir is configurable in /etc/default/dnsmasq so maybe the test should follow this config as well.
That would need EnvironmentFile=-/etc/default/dnsmasq as well as some logic to do this conditionally if set. As far as I can see the latter can't be done in systemd according to its current doc (to set the -7 CONF_DIR only if set).

But it certainly could be done as:
1. drop the ExecStartPre as it tests the wrong thing
2a. implement it in the systemd-exec section in /etc/init.d/dnsmasq (there all vars are set up anyway)
2b. if you want to leverage StartPre then you'd need a systemd-exec-check section with just the same as 2a

I'd really want to encourage you to report just that to Debian.
If you are unable or unwilling please let me know, but in general it is better if the reporters do so.

tags: added: need-debian-report
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers