[debhelper-devel] Bug#887900: dh_installsystemd does not properly handle aliased services

Michael Biebl biebl at debian.org
Thu Jan 25 08:10:50 UTC 2018


Hi

Am 25.01.2018 um 07:53 schrieb Niels Thykier:
> I think we should do it in a separate compat bump.  With where things
> are headed, I think I got enough changes to do a compat 12 as well in
> buster.

ok

> Can we just have " [ -d /run/systemd/system ] " be the gate both ways?
> Is there any case, where that would do the wrong thing?
> 
> I.e.
> 
> # dh_installinit inserts:
>   if [ ! -d /run/systemd/system ] && ... ; then
>     ...
>   fi
> 
> # dh_installsystem inserts:
>   if [ -d /run/systemd/system ] && ... ; then
>     ...
>   fi
> 
> This means that dh_installinit's snippet is run when we are not running
> systemd and dh_installsystemd's snippet is run when we are running
> systemd.  It is simple to write and is simple to explain, so if that
> does the right thing, then it feels like the right approach.

We still do have the case of packages, which only ship a SysV init
script but no native .service file (yet).
With a simplistic check like above, we'd have to change
dh_installsystemd to start those as well.
Somehow I would prefer if dh_installsystemd would only take care of
real, native .service files and leave SysV only services to
dh_installinit/invoke-rc.d.
That's why I added the additional
! [ -e /lib/systemd/system/foo.service ] check.

It would be up to the package maintainer to ensure that for a package
shipping both, to either use the same name or add a symlink.

Atm we try to detect during build time, whether such a init script and
matching service file exists and generate code conditionally. This is
tricky, as you need to make sure the service files or such a symlink is
installed at the time when dh_installinit resp. dh_installsystemd is
run. By always adding this check, and letting this be detected during
runtime, we avoid this issue.

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: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/debhelper-devel/attachments/20180125/26a0bca9/attachment-0003.sig>


More information about the debhelper-devel mailing list