Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Jun 2018 13:27:49 +0200
From:      Miroslav Lachman <000.fbsd@quip.cz>
To:        freebsd-ports@freebsd.org
Subject:   Re: Should a package restart on upgrade itself
Message-ID:  <77549bbc-50b1-7635-2ca4-1ae229098506@quip.cz>
In-Reply-To: <595296BF.3040906@quip.cz>
References:  <b71469f3-dd9d-6680-f85e-a7acfcf9d944@fechner.net> <595296BF.3040906@quip.cz>

next in thread | previous in thread | raw e-mail | index | archive | help
Miroslav Lachman wrote on 2017/06/27 19:32:
> Matthias Fechner wrote on 2017/06/27 18:29:
>> Dear all,
>>
>> it is always a pain if pkg upgrade a lot of packages to restart all
>> services to make sure update/security fixes are applied to all running
>> services.
>>
>> Is there an option in pkg that it restart services automatically or is
>> it OK if I would add a post-install script to the packages (I maintain)
>> that will include a "service foo restart"?
>>
>> What is best practice here?
> 
> Please don't do this.
> Some ports did this in the past and this was really a pain during larger 
> upgrades. It sometimes leave services stopped (hi MySQL).
> 
> The same bad practice is disabling / enabling Apache modules on upgrade.
> 
> pkg upgrade should just do it's work - upgrade packages on disk. But 
> manipulating config files and restart of services is up to me - the 
> Administrator (or my tools).
> 
> It would be nice to have some kind of "hooks" in pkg, which can be used 
> to notify deployment tools that some services should be (re)started, or 
> do restart in some simpler environment if user allows this (setup hooks 
> for service restart).
> But is must not be done automatically for individual ports / packages 
> even if maintainer thinks it is Good Idea (tm)

Again and again and again...

Can we have some written (or do we have?) policy to not 
stop/start/restart services from some @preunexec / @postexec targets?
I really don't like that some packages are still shutting down or trying 
to restart in the middle of the pkg upgrade process.

One example from today upgrade:

[87/96] Extracting open-vm-tools-nox11-10.2.5,2: .......... done
Stopping vmware_guestd.
Waiting for PIDS: 516.
Loading vmmemctl kernel module: already loaded.
vmware_guestd not running? (check /var/run/vmware_guestd.pid).
Starting vmware_guestd.

Can committers take care of this bad behaviour and not commit things 
like this?
https://svnweb.freebsd.org/ports/head/emulators/open-vm-tools/pkg-plist?revision=457485&view=markup

@preunexec %%PREFIX%%/bin/vmware-rpctool 'tools.set.version 0' ; service 
vmware-guestd stop 2>/dev/null || /usr/bin/true
@postexec service vmware-kmod restart && service vmware-guestd restart 
|| /usr/bin/true

Kind regards
Miroslav Lachman



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?77549bbc-50b1-7635-2ca4-1ae229098506>