[Pkg-systemd-maintainers] [Pkg-utopia-maintainers] Bug#715247: Bug#715247: [PATCH] proper maintscripts by using dh-systemd

Michael Biebl biebl at debian.org
Thu Aug 29 13:32:51 BST 2013


Hi Michael, hi Martin!

Am 10.07.2013 07:10, schrieb Martin Pitt:
> Hello Michael,
> 
> Michael Stapelberg [2013-07-07 12:16 +0200]:
>> Thanks for shipping a systemd service file with udisks2.
>>
>> By applying dh-systemd.patch, systemd users will enjoy a fully working
>> udisks2 on their machines: It will get stopped/started properly on
>> upgrades.
> 
> Thanks! Applied.

I've looked at this patch and I'm not sure we need it. A few thoughts:

- udisks2.service doesn't have an [Install] section, it's a purely dbus
activated service which doesn't need to be enabled. Yet dh-systemd
generates some unnecessary maintainer scripts code [1] to enable|disable
this service.

- we already handle the restart-on-upgrade case [2] and stop-on-remove
[3] (in a way which already works for both systemd and sysvinit). We
can't really get rid of the sysvinit code (at least for now). So we
don't really gain anything from using dh-systemd.

- udisks2 is supposed to be activated on-demand, so we probably
shouldn't start it unconditionally in postinst which the current
dh_systemd_start call does.
The default dh_systemd_start behaviour of "stop in prerm, start in
postinst" on upgrades isn't the best choice for D-Bus activated services
either, as you could have an activation request while the package is in
an inconsistent state. --restart-after-upgrade or (manually) masking the
service during upgrades is something we would need here.

- the current postinst only restarts udisks2 if it's already running,
basically the equivalent to systemd's try-restart. dh-systemd currently
doesn't allow use that kind of functionality.
For packages shipping both sysv init script + systemd service file,
where we use update-rc.d/invoke-rc.d, we are (currently) limited to what
API invoke-rc.d provides. Maybe we can utilize try-restart for
systemd-only packages.

That said, I'm not sure if this particular package requiring this
specific behaviour isn't too much of a special case which needs to be
supported by dh-systemd and we should rather use hand-written maintainer
scripts code.

In conclusion I think it's probably best, to revert this commit for now
and maybe have a look if we can improve dh-systemd to better handle such
types of D-Bus activated services.

Cheers,
Michael




[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=721241
[2]
http://anonscm.debian.org/gitweb/?p=pkg-utopia/udisks2.git;a=blob;f=debian/udisks2.postinst;h=9515ffc2383db652ee24d57e2ed5cf9700d8ef85;hb=HEAD
[3]
http://anonscm.debian.org/gitweb/?p=pkg-utopia/udisks2.git;a=blob;f=debian/udisks2.prerm;h=91030883fe57dcfd8b0eb4217b27cbe4e9bef0ee;hb=HEAD
[4]
http://anonscm.debian.org/gitweb/?p=pkg-utopia/udisks2.git;a=commit;h=cb892cb136c194df5126597404486305b1c27be7
-- 
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: 901 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20130829/0927d138/attachment-0002.sig>


More information about the Pkg-systemd-maintainers mailing list