FreeBSD 11.4 / 12.2 pkg-install problems startup service

Stefan Parvu sparvu at kronometrix.org
Thu Dec 3 11:34:28 UTC 2020


thanks for message.

> I would like to know more about your use cases, it is not recent that pkg
> prevent starting automatically daemon during the install phases, pkg becomes the
> reaper of the scripts it does run and at the end of the run it kills all the
> children process (including any daemon that may have been started).

aha. okay that might explain why i dont see anything running after adding my own package.

First of all, the things are something like that: Kronometrix Data Recording [1] package is a software which collects
various performance and availability data from a running system, which installs under /opt/kronometrix prefix. 
Under there I have a number of CLI utilities (Perl5 scripts), called recorders which can run interactively or in background. 
These CLIs are automatically started via a master script called rec, found under /opt/kronometrix/etc. I have made the 
correspondent master rc.d script which will be called during system boot from /etc/rc.d . It works great. 

Kronometrix Prefix                       System Boot
/opt/kronometrix/etc/rec             /etc/rc.d/kdr

Same time, under the same data recording module, I have another script, which has been designed as a real daemon
, written in Perl5 too, with its own startup script /opt/kronometrix/etc/transport and with a correspondent /etc/rc.d,
called kdr_transport 

Kronometrix Prefix                                System Boot
/opt/kronometrix/etc/transport             /etc/rc.d/kdr_transport 


Now, all sfw is packaged under a FreeBSD binary pkg for easy deployment. I would like to be able during pkg add phase
to start as well the recorders and transport utilities, if possible. 


What is different?

First of all, I made a mistake. This has NOT worked okay before 12.2. The recorders and transport utilities have never
run after pkg add. I had to manually start them. What was different now with 12.2 is that if I try to install my
FreeBSD package, the pkg add gets stuck and requires CTRL-C to break. Otherwise it will sit like that, forever … This is
visible under 12.2 and 11.4 - not visible in 12.1 or 11.2 or 10.4

> 
> 
> Stopping and starting daemons etc, is not package management in the first place,
> it is configuration management, the two concept are different for a reason.
> 
> That said because we know a lot of people have been doing that for a while, pkg
> has an option (off by default) HANDLE_RC_SCRIPT
> 
> if you set it to true when installing your package it will start the rc.d script
> so you don't need to install that in your post install script.

Okay. Thanks for tip. Let me try that.

Thanks a lot for comments,
Stefan




More information about the freebsd-pkg mailing list