[Pkg-swan-devel] Bug#781209: postinst execution order bug confuses systemd

Michael Biebl biebl at debian.org
Thu Mar 26 21:36:32 UTC 2015


On Thu, 26 Mar 2015 10:41:55 +0100 Romain Francoise
<rfrancoise at debian.org> wrote:
> Hi,
> 
> Thank you for this detailed report, and sorry for the inconvenience...
> 
> On Thu, Mar 26, 2015 at 04:29:02AM +0200, Faidon Liambotis wrote:
> > The package's postinst, however, is buggy: it does not use
> > dh_installinit but calls invoke-rc.d ipsec manually. That would have been
> > fine, but invoke-rc.d ipsec is called *before* the
> > dh_systemd_enable/deb-systemd-helper bits.
> >
> > This means that "invoke-rc.d ipsec start" runs before the systemd unit
> > is properly installed, which in turn confuses the hell out of systemd
> > (as, among others, it expects a Type=simple unit), as evidenced by the
> > following commands run in sequence:
> [...]
> > # ipsec stop
> > Stopping strongSwan IPsec...
> > # grep systemd /var/log/syslog | tail -3
> > Mar 26 01:02:15 curium systemd[1]: Assertion 'path' failed at ../src/shared/cgroup-util.c:913, function cg_is_empty_recursive().  Aborting.
> > Mar 26 01:02:15 curium systemd[1]: Caught <ABRT>, dumped core as pid 6916.
> > Mar 26 01:02:15 curium systemd[1]: Freezing execution.
> 
> Ouch, that's quite nasty. :(
> 
> Moving the invoke-rc.d call below the debhelper marker would take care
> of this particular situation, however looking at other packages there's
> also the upgrade case to take into consideration: if it's already
> running we should shut down the sysvinit-controlled daemon before
> restarting it controlled by systemd. At least that's what openssh-server
> does.
> 

You could also ship the alias/symlink in the package, and not create it
via Alias=
Actually, that's what I would suggest to do anyway to align the old and
new name.
The network-manager package is in a similar situation.
Upstream ships a NetworkManager.service unit file and the sysv init
script in Debian is called /etc/init.d/network-manager.

So I decided to ship a /lib/systemd/system/network-manager.service
symlink pointing at NetworkManager.service:

http://anonscm.debian.org/cgit/pkg-utopia/network-manager.git/tree/debian/rules#n64

-- 
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://lists.alioth.debian.org/pipermail/pkg-swan-devel/attachments/20150326/62133c96/attachment.sig>


More information about the Pkg-swan-devel mailing list