Should a package restart on upgrade itself

Mathieu Arnold mat at FreeBSD.org
Wed Jun 27 09:58:19 UTC 2018


On Tue, Jun 26, 2018 at 01:27:49PM +0200, Miroslav Lachman wrote:
> 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.

There is a policy, it MUST NOT be done.

Services are stopped and started with the rc file they install, and pkg
does it when its configuration variable HANDLE_RC_SCRIPTS is set to
true.

Please point out to ports doing this so that they can be fixed.

-- 
Mathieu Arnold
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20180627/77761e3f/attachment.sig>


More information about the freebsd-ports mailing list