Should a package restart on upgrade itself

David Wolfskill david at catwhisker.org
Tue Jun 27 16:54:47 UTC 2017


On Tue, Jun 27, 2017 at 06:29:24PM +0200, Matthias Fechner wrote:
> 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?
> ....

I do not claim that this is "best practice."  But what I do, during my
weekly updates of my "production" systems (at home) is:

* "Clone" the active slice to the other slice.
* Build the world & suitable kernels on the build machine.
* Mount /usr/src and /usr/obj from the build machine.
* Set DESTDIR to a suitable directory on the other slice.
* make installkernel ${DESTDIR} && \
  mergemaster -U -u 0022 -p && \
  make installworld ${DESTDIR} && \
  mergemaster -F -U -u 0022 -i && \ 
  make delete-old ${DESTDIR}
* reboot from the other slice.

* Mount /usr/src and /usr/obj from the build machine.
* Stop all services that depend on 3rd-party software (ports/packages).
* pkg upgrade
* make delete-old-libs
* reboot

(I elided a few minor embellishments; the above are the essential steps.)

It seems to work for me.

Peace,
david
-- 
David H. Wolfskill				david at catwhisker.org
I look forward to voting against Trump again at the earliest opportunity.

See http://www.catwhisker.org/~david/publickey.gpg for my public key.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 603 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20170627/f51b1051/attachment.sig>


More information about the freebsd-ports mailing list