Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Mar 2023 21:32:34 +0100
From:      Miroslav Lachman <000.fbsd@quip.cz>
To:        rc@FreeBSD.org
Subject:   detailed manual for rc scripting
Message-ID:  <e70861f4-043c-3d1f-04b1-fd617d17fcee@quip.cz>

next in thread | raw e-mail | index | archive | help
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.

Kind regards
Miroslav Lachman



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?e70861f4-043c-3d1f-04b1-fd617d17fcee>