[systemd-devel] [PATCH] sysv-generator: Replace Provides: symlinks with real units

Lennart Poettering lennart at poettering.net
Tue Jan 27 16:44:11 PST 2015

On Wed, 21.01.15 10:46, Martin Pitt (martin.pitt at ubuntu.com) wrote:

> A similar case can also happen if
> one init.d script Provides: the name of another init.d script
> (arguably this is at least questionable, but it might happen in
> practice -- e. g. /etc/init.d/mariad might very well "Provides: mysql"
> as it's kind of a drop-in replacement).
> I wrote some more tests which reproduce these failures, and a proposed
> patch. It's not exactly nice due to the TOCTOU (which shouldn't cause
> any practical problem though, it's just a bit unclean), but I can't
> think of a better solution which covers all corner cases.

I am not a fan of this stuff either. I really don't like the TOCTOU
behaviour I must say...

If this is really just about ".bak", then we can add it to the list of
suffixes in hidden_files()...

I think a much better fix for all of this would be to first read in
all sysv scripts, and only then start creating aliases. So far we read
everything in, and while doing so already create symlinks, while
defering creation of the unit files to the end. If we moevd the
symlink creation part to the end too we could easily check in the sysv
script hashtable if we have a real script for a name before writing
out an alias symlink for this.


Lennart Poettering, Red Hat

More information about the systemd-devel mailing list