runit call script with start/stop

267 Views Asked by At

I've some SysVinit scripts with start/stop, they are used for remote server deployment, as now i am using runit in other deployment purpose, and don't want to duplicate the scripts (maintenance reason). Is it possible that runit invokes these scripts? or other approach? Thank you in advance.

1

There are 1 best solutions below

1
larsks On

It is unlikely that you can use these scripts unmodified with runit. Runit expects the service started with run to remain in the foreground and not exit.

A SysVInit script expects the opposite behavior. Because it does not perform any process monitoring (and the lack of process monitoring is presumably why you are switching to runit), SysVInit scripts expect services to run in the background, and will exit after starting the service.

These are two fundamentally incompatible models.

You could consider using systemd instead of runit, which provides good process monitoring while also being able to follow processes that fork.