Bug 82453

Summary: ignore temporary files / symlinks in .wants directories
Product: systemd Reporter: Michael Biebl <mbiebl>
Component: generalAssignee: systemd-bugs
Status: RESOLVED FIXED QA Contact: systemd-bugs
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Michael Biebl 2014-08-11 08:40:11 UTC
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=757302

There are packages in Debian which ship the symlinks to enable a service directly in the package.
One such example is the udev package.
Dpkg when unpacking the package creates temporary files, e.g.

/lib/systemd/system/sockets.target.wants/systemd-udevd-kernel.socket.dpkg-tmp

before the files(symlinks) are renamed in a final step.

It seems, we do not ignore such temporary files on daemon-reload.
We should treat the symlinks the same as the actual unit files.
Comment 1 Michael Biebl 2014-08-11 08:41:31 UTC
Atm this triggers the following error messages on upgrades:

  Aug  7 00:36:38 castro systemd[1]: Reloading.
  Aug  7 00:36:38 castro systemd[1]: Cannot add dependency systemd-udevd-control.socket.dpkg-tmp to sockets.target, ignoring: Invalid argument
  Aug  7 00:36:38 castro systemd[1]: Cannot add dependency systemd-udevd-kernel.socket.dpkg-tmp to sockets.target, ignoring: Invalid argument
  Aug  7 00:36:38 castro systemd[1]: Cannot add dependency udev-finish.service.dpkg-tmp to sysinit.target, ignoring: Invalid argument
  Aug  7 00:36:38 castro systemd[1]: Cannot add dependency systemd-udev-trigger.service.dpkg-tmp to sysinit.target, ignoring: Invalid argument
  Aug  7 00:36:38 castro systemd[1]: Cannot add dependency systemd-udevd.service.dpkg-tmp to sysinit.target, ignoring: Invalid argument
Comment 2 Lennart Poettering 2014-08-11 13:41:45 UTC
I added a special exception for ".dpkg-tmp" now:

http://cgit.freedesktop.org/systemd/systemd/commit/?id=0cdfd26ef826f8a595ab7d85ebc37894f4f3d940

However, honestly, this is really a poor choice of dpkg. Its pretty customary to create files prefixed with a "." for cases like this, to avoid them being enumerated. (Also, it should really use a randomized suffix, to make things atomic.  I mean, in this case dpkg probably knows that it will run only once at a time, but still...). If dpkg would just follow the usual rules, and create the temporary files using these rules then you wouldn't have to file bugs against half the programs that enumerate files because they manage drop-in directories...

Or to turn this around: instead of blacklisting dpkg's temporary files in each and every program, it would be a much better idea to just make dpkg hide its files from enumeration for most apps automatically.

Please ask the dpkg guys to fix this, so that this doesn't popup again and again and again with other packages, requireing everybody to add more and more items to their individual enumeration blacklists. 

We already have a per-package manager blacklist in place, so I just added one more entry, but this is frcikin ugly...

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.