[debhelper-devel] Bug#805878: dh-systemd: dh_systemd_start --no-start --restart-after-upgrade causes the service to be started on install

Felipe Sateler fsateler at debian.org
Thu Oct 13 15:47:50 UTC 2016


On 13 October 2016 at 12:36, Michael Biebl <biebl at debian.org> wrote:
> Control: severity -1 important
>
> On Mon, 23 Nov 2015 11:34:47 -0300 Felipe Sateler <fsateler at debian.org>
> wrote:
>> Package: dh-systemd
>> Version: 1.24
>> Severity: normal
>>
>> Current autoscript has:
>>
>> if [ -d /run/systemd/system ]; then
>>         systemctl --system daemon-reload >/dev/null || true
>>         if [ -n "$2" : ]; then
>>                 _dh_action=try-restart
>>         else
>>                 _dh_action=start
>>         fi
>>         deb-systemd-invoke $_dh_action #UNITFILES# >/dev/null || true
>> fi
>>
>>
>> And this does not take into account that --no-start was passed. If it
>> was passed, then try-restart should always be used.
>>
>
> Now that compat level 10 has --restart-after-upgrade as default, this
> bug has a wider impact (thus bumping the severity).
>
> With compat level 9 and older, --no-start did not generate any
> maintainer scripts code at all.

You can get the same with dh 10 with --no-start --no-restart-after-upgrade

>
> Aside from the bug that "start" is used on new installs, I wonder if we
> should (try-)restart the service at all.

There are 4 types of service:

1. Start on install, use stop/start on upgrades
  --no-restart-after-upgrade
2. Start on install, use restart on upgrades
  --restart-after-upgrade
3. Don't start on install, restart on upgrades
  --no-start --restart-after-upgrade # not working
4. Don't start on install, don't restart on upgrades
  --no-start --no-restart-after-upgrade

Currently, we can do 1, 2 and 4. With my patch, we add option 3.

However, the interface is less than intuitive :/

-- 

Saludos,
Felipe Sateler




More information about the debhelper-devel mailing list