Skip to content

Invalid systemctl warning that source configuration file changed on disk #13634

@dsahern

Description

@dsahern

systemd version the issue has been seen with

v241 - debian buster, but from a source code review should be present on top of tree

Used distribution

debian buster

Expected behaviour you didn't see

Warning message should not be visible in systemctl output

Unexpected behaviour you saw

Warning message in systemctl output

The vrf package has a systemd generator that leverages systemd instances.[1] The generated unit files set SourcePath to the file from which the vrf override was created.

With debian jessie, this generator worked fine. With debian buster (systemd 241) we are seeing an error on all VRF related services running ‘systemctl status ’:

Warning: The unit file, source configuration file or drop-ins of changed on disk. Run 'systemctl daemon-reload' to reload units.

In fact if you compare the mtimes of the original file, e.g., /lib/systemd/system/ssh.service, and the generated vrf override, /run/systemd/generator/[email protected]/vrf.conf, the mtimes of the original file (all times really) are < the times of the vrf config file.

I added debugs and this seems to be a clear systemd bug: it is comparing the mtime of the SourcePath file to 0 which of course means the mtime is always newer so unit_need_daemon_reload returns true. Specificaally, the root cause is either the source_path not getting set when it should be or the mtime check needs to be skipped if the mtime is 0. I do not know system well enough to submit a patch, but this is what I am seeing. In load_from_path, source_path is not set:

2019-09-23T17:12:53.649611+00:00 myhost systemd[1]: load_from_path: src path mtime 0 fragment /run/systemd/system/[email protected] mtime 1569258763287765

so the mtime is 0. And then later unit_need_daemon_reload calls fragment_mtime_newer with an mtime of 0:

2019-09-23T17:12:53.666978+00:00 myhost systemd[1]: path /lib/systemd/system/ssh.service has mtime 1554717083000000; comparing to 0 (masked 0)

so of course it returns true resulting in the systemctl warning.

[1] https://github.com/CumulusNetworks/vrf/blob/master/systemd/systemd-vrf-generator

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions