Mailing List Archive

OpenRC vs SysV init scripts.
Hi,

Does anyone have any pointers on where to start on converting a 10-15
year old SysV style init script to OpenRC?

I'm starting to use something that includes an ancient SysV style init
script and trying to get it to work under OpenRC init properly on boot.

It seems as if the SysV init scripts don't start things on boot despite
being in the default runlevel. Yet I can reliably start / control the
service with "rc-service $ServiceName start".

Any suggestions would be appreciated.



--
Grant. . . .
unix || die
Re: OpenRC vs SysV init scripts. [ In reply to ]
On Wed, 2021-03-24 at 15:03 -0600, Grant Taylor wrote:
> Hi,
>
> Does anyone have any pointers on where to start on converting a 10-15
> year old SysV style init script to OpenRC?

I'd start with "man openrc-run", and then read the service-script-
guide.md that is shipped & installed along with OpenRC.

OpenRC is similar to SysV but with a few added features:

* Dependencies (start service A before service B),

* A "checkpath" helper for setting permissions (be careful with 
this, it's safer than chmod/chown but still not 100% secure),

* The ability to "background" a daemon and manage the PIDfile
itself,

* Sane default behaviors that let you avoid boilerplate by declaring
variables at the top of the service script.