Bug#771172: systemd-sysv-generator does not generate

Michael Biebl biebl at debian.org
Thu Nov 27 14:40:01 GMT 2014


Am 27.11.2014 um 12:01 schrieb Salvo Tomaselli:
> Package: systemd
> Version: 215-6
> Severity: critical
> Justification: breaks unrelated software
> 
> Dear Maintainer,
> I am not providing the additional information that reportbug wants to provide
> because if I do, the mail will be rejected as spam by bogus filters.
> 
> Dear Maintainer,
> 
> somehow, after the last upgrade (which included dbus, console-setup,
> libpolkit-backend, schroot) I was unable to start postfix.

Was postfix part of the upgrade?

> While upgrading I had this message:
>> insserv: FATAL: service dnsmasq is missed in the runlevels 2 3 4 5 to use service postfix
> 
> that caused the entire upgrade to fail.

That sounds like a bug in insserv.


> I didn't know what was the problem, the LSB headers seemed fine, so I removed
> /etc/init.d/postfix and /etc/init.d/dnsmasq and proceeded with the upgrade.
> 
> After the upgrade I put the scripts in their original position.
> 
> 
> Then, I noticed that postfix was not running and could not be started
> 
>> ● postfix.service
>>   Loaded: not-found (Reason: No such file or directory)
>>      Active: inactive (dead)


If you remove an init script and "systemctl daemon-reload" is run,
systemd will re-run the sysv-generator and the generated unit is removed
as well.
Since during the upgrade "systemctl daemon-reload" has been triggered
most likely by e.g. dbus's maintainerscript, it's expected that the
generated unit for postfix is removed and the error message you get above.

It doesn't necessarily mean that the postfix process is stopped, unless
the postfix package was part of the upgrade and the service stopped in
prerm.

So what could have happened is:

- apt-get (dist-)upgrade
- postfix's prerm is run and the postfix process is stopped
- you get the insserv error during the upgrade
- you "fix" the insserv error by removing the postfix init script
- you resume the upgrade, "systemctl daemon-reload" is triggered by
another like dbus and therefore the generated postfix.service unit is
removed


> which is when I learnt about the existance of systemd-sysv-generator (which
> lacks a man page and doesn't support a -h switch)
> 
> After some investigation I found out that these generated files belong in
> /run/systemd/generator.late/, for systemd to be able to run the service.
> 
> There was no such file there for postfix, so I ran the tool, which generated
> files in /tmp, and then moved the postfix.service inside the correct location,
> to be able to start it.
> 

Running "systemctl daemon-reload" is sufficient to run the generator.
You don't need to run it by hand and copying the files around.

> I have no clue of what happened with insserv and why it was failing in the first
> place, and I guess that systemd refusing to start my service was due to my
> removing and then adding the script.
> 
> However, I might want to copy a script in /etc/init.d at anytime and I would
> expect systemd to be able to run it, without first having to run some
> undocumented tool.

If you install an init script, you'll need to run "systemctl
daemon-reload" for systemd to pick it up. The package maintainer scripts
do that automatically.
That's also true for native services fwiw.

> Please let me know if you need more information about the problem.

The failing insserv process looks like a genuine bug to me, and I
suggest you file a corresponsing bug against that package.

The behaviour of systemd is by design and an explicit choice by upstream.
What you want afai is systemd monitoring /etc/init.d and
/(lib|etc)/systemd/system, e.g. via inotify, and automatically reloading
 when there are changes in those directories.
I'll mark this bug as a feature request (i.e. wishlist) but also
wontfix, since upstream has rejected such a change in behaviour and we
won't deviate in such a fundamental way downstream.

If you want to see this changed, I think it's best if you engage with
upstream directly.

Michael


-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20141127/9407be20/attachment-0002.sig>


More information about the Pkg-systemd-maintainers mailing list