[debhelper-devel] Bug#836317: dh_systemd_start should stop the sevice on remove even if --no-start has been passed

Laurent Bigonville bigon at debian.org
Sun Oct 2 10:22:47 UTC 2016


Le 02/10/16 à 02:13, Michael Biebl a écrit :
> On Thu, 01 Sep 2016 17:03:42 +0200 Laurent Bigonville <bigon at debian.org>
> wrote:
>> Package: debhelper
>> Version: 9.20160814
>> Severity: important
>> File: /usr/bin/dh_systemd_start
>>
>> Hi,
>>
>> ATM, if --no-start is passed to dh_systemd_start, the service is never
>> stopped even if the package is removed/purged.
>>
>> IMHO, is should be stopped in that case, I would do something like:
>>
>> -        if ($dh{R_FLAG} || $dh{RESTART_AFTER_UPGRADE}) {
>> +        if ($dh{R_FLAG} || $dh{RESTART_AFTER_UPGRADE} || $dh{NO_START}) {
>>                  # stop service only on remove
>>                  $sd_autoscript->("prerm", "prerm-systemd-restart");
>> -        } elsif (!$dh{NO_START}) {
>> +        } else {
>>                  # always stop service
>>                  $sd_autoscript->("prerm", "prerm-systemd");
>>          }
>>
>> What do you think?
> I think this makes sense but we should make sure that this is consistent
> with dh_installinit/sysv
> Have you checked what dh_installinit does in this case?

mmh the manpage of dh_installinit states that:

        --no-start
            Do not start the init script on install or upgrade, or stop 
it on removal.  Only call update-rc.d. Useful for rcS scripts.

So it seems that not stopping the service on remove is intended, but at 
the same time I don't think it's relevant for other services than the 
early initialization ones.




More information about the debhelper-devel mailing list