Hi Baptiste, Why it used to work on FreeBSD 10? It stopped worked on FreeBSD 11 only. Cron is just an example, I manage more than 50 FreeBSD servers, and I've been using ports for years to update some configs and restart the service on all of them. Many times I need to change nginx config, ldap, etc. I just need to restart the service. Is there some flag to disable it? Or some hack that I could do? Thanks. On Wed, Aug 30, 2017 at 9:48 AM, Baptiste Daroussin <bapt at freebsd.org> wrote:> On Wed, Aug 30, 2017 at 09:00:55AM -0300, Cassiano Peixoto wrote: > > Hi Matthew, > > > > Sorry back to this subject. But I really need to restart services with a > > port. I'm quite sure there is a bug with pkg and FreeBSD 11. > > > > I made a simple port to restart cron service: > > It is not a bug, it is by design, pkg becomes the reaper of the scripts it > runs > and kills everything once the script is executed. > > btw if you install crontab in cron.d you do not need to restart the > service, > cron will figure out itself and reload what it needed. > > Bapt >
On Wed, Aug 30, 2017 at 09:55:22AM -0300, Cassiano Peixoto wrote:> Hi Baptiste, > > Why it used to work on FreeBSD 10? It stopped worked on FreeBSD 11 only.It only worked on FreeBSD 10 prior to 10.2, the reaper functionnality in freebsd kernel appeared in 10.2> > Cron is just an example, I manage more than 50 FreeBSD servers, and I've > been using ports for years to update some configs and restart the service > on all of them. Many times I need to change nginx config, ldap, etc. I just > need to restart the service.HANDLE_RC_SCRIPTS=true in your pkg.conf and pkg will automatically restart anything rc script provide once the package containing it is upgrading. This is off by default because in many cases it is dangerous (database upgrades, dovecot like things upgrade etc). But if you know what you are doing it does the job. Best regards, Bapt -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: <http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20170830/9ba577f7/attachment.sig>
Hi Cassiano,> On 30. Aug 2017, at 2:55 PM, Cassiano Peixoto <peixotocassiano at gmail.com> wrote: > > Why it used to work on FreeBSD 10? It stopped worked on FreeBSD 11 only.It was a later 10.x change as far as I know.> Is there some flag to disable it? Or some hack that I could do?No. At OPNsense we use a patch to revert the behaviour. https://github.com/opnsense/ports/blob/master/ports-mgmt/pkg/files/patch-libpkg_scripts.c Cheers, Franco