Re: detailed manual for rc scripting

From: Mateusz Piotrowski <0mp_at_FreeBSD.org>
Date: Thu, 06 Jul 2023 14:48:15 UTC
Hey Miroslav,

> On 2. Mar 2023, at 21:32, Miroslav Lachman <000.fbsd@quip.cz> wrote:
> 
> I would like to know if there is something more than https://docs.freebsd.org/en/articles/rc-scripting/ and man rc.subr(8)?
> 
> Every now and then I need to write some rc script for customer services or fix some existing rc script which became broken after update of base or some packages. Starting the interpreted (node.js, python etc.) services are often way more complicated than what is described in handbook but I always spend about 30% of time by doing the start part and 70% of doing the part required to stop the service - matching command / interpreter / procname is not an easy task and debugging it is even more complicated. Almost always one need to tune just these 3 variables command, command_interpreter, procname but it is sometimes too difficult if one do not have deep knowledge of how things works in rc.subr and sometimes even reading the source of rc.subr is not clear to me.
> So is there some detailed manual how to put things together in edge cases where service is interpreted, running from Pyhton virtualenv, there are symlinks in path so the real path shown by "ps" is different than the path used to start the service and so on.

I'm afraid there is nothing else.

Regarding the services running interpreted programs, I agree that the interface could be a bit more friendly.

Best,
Mateusz