Bug#830208: dh_installinit tries to do dh_systemd_start's job

Peter Pentchev roam at ringlet.net
Wed Jul 20 11:22:45 BST 2016


On Tue, Jul 19, 2016 at 10:14:53PM +0200, Michael Biebl wrote:
> Hi
> 
> Am 19.07.2016 um 19:28 schrieb Niels Thykier:
> > Thanks for the report - at first glance it sounds like #830208 (Cc'ed
> > accordingly).
> > 
> > Peter's message quoted in full (for those not subscribed to
> > debhelper-devel):
> > 
> >> Hi,
> >>
> >> Now that dh_systemd_start and dh_systemd_enable are part of debhelper
> >> proper, there's a bit of duplication of work between dh_installinit and
> >> dh_systemd_start.  Now don't get me wrong: I do agree that installing
> >> and configuring systemd service files correctly is a Good Thing(tm);
> >> it's just that I'm afraid that there are some more rough edges to
> >> polish.
> >>
> >> So far I've only seen the problem in a package that provides both
> >> a systemd service file and a SysV init script.  If the service file is
> >> named debian/package.service, dh_systemd_start and dh_systemd_enable
> >> will pick it up and process it just fine... but then dh_installinit will
> >> *also* pick it up.  It's invoked because debian/package.init exists, but
> >> it tries to process systemd and upstart files, too, if it finds them,
> >> so it tries to do once again what dh_systemd_start just did, and, well,
> >> it even gets it subtly wrong :)
> 
> Could you be more specific what you think it gets wrong?

OK, now that I look at it - and now that I think about it - I find that
there doesn't really seem to be a problem.  For some reason I thought
that dh_installinit's snippet called "update-rc.d enable" instead of
"update-rc.d defaults", which would override a sysadmin's decision to
disable this particular systemd service, but, well, I was wrong.

Right.  Now that I think about it, I really don't know what would be
the proper way to proceed here.  The way dh_installinit is implemented,
it uses init-system-helpers's update-rc.d and invoke-rc.d and it depends
on them to figure out whether they should enable/start/stop/restart
systemd services, upstart scripts, or SysV scripts.  So if there is
a debian/package.init file, dh_installinit will add the maintscript
snippets that will call invoke-rc.d and update-rc.d and DTRT for
the systemd service too.

So... right now, it seems to me that the proper thing to do as a
maintainer of a package that has both a SysV init script and a systemd
service file would be to disable the systemd sequence and let
dh_installinit do its job.  This would mean that the newly-adopted
dh_systemd_{start,enable} tools would only be used for packages that
*only* provide a systemd service file... and seeing as there are all
kinds of weird and wonderful people out there who, for some reason or
other, refuse to bow to the wisdom of authority and who still use other
init systems, again, as a package maintainer it seems prudent for me to
make sure that my packages also have a SysV init script.

So... does this mean that dh_systemd_* should only be used by people who
don't care about people who don't use systemd, or does it mean that
init-system-helpers's invoke-rc.d and update-rc.d will need to learn to
not handle systemd services if requested?  To be honest, both these options
look just a little bit crazy to me :(

G'luck,
Peter

-- 
Peter Pentchev  roam at ringlet.net roam at FreeBSD.org pp at storpool.com
PGP key:        http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20160720/ffb954e4/attachment-0002.sig>


More information about the Pkg-systemd-maintainers mailing list