Web lists-archives.com

Re: howto restart a service in postinst script (Stretch and newer)




Harald Dunkel <harri@xxxxxxxxx> wrote:
> On Sat, 5 Aug 2017 11:56:07 +0900 Mark Fletcher <mark27q1@xxxxxxxxx> wrote:
>> On Fri, Aug 04, 2017 at 12:30:25PM +0200, Harald Dunkel wrote:

>>> What is the right way to restart a service from the postinst
>>> script for Stretch and newer?

>> I may be misunderstanding your question but on a system that has 
>> migrated to systemd, you can restart a service with: 
>> 
>> systemctl restart <service>

> I think you missed the point. To run it from a postinst script we need
> a universal(!) way to restart a service, regardless whether systemd or
> sysvinit-core or whatever is installed.

invoke-rc.d does just that and is included in postinst by
dh_installinit for both SysV-init *and* systemd.

Grüße,
Sven.

-- 
Sigmentation fault. Core dumped.