The Short Answer
For the time being, no, there is no automated method specific to runit.
The Long Answer
There have been several approaches to resolving this.
Using Pre-Built Scripts
The first is to have a pre-built set of scripts. These can be extracted from other projects. Void Linux uses runit as its base init and supervisor, so it might be of interest. There is a project on Github called runit-scripts that might have some of what you need. And I will make a shameless plug for my own project, supervision-scripts, which has a few of them pre-baked and ready, although the project is still being developed.
Using A Framework
The second is to provide a framework that eases the transition of writing scripts. Ignite is a possibility. Also, Toki Clover's Supervision Script Framework (not to be confused with my own project) may provide what you seek as well. In this case, there are no pre-built definitions, but you get bits and pieces of shell script (and possibly other programs) to help you make this transition easier.
Borrowing Existing Scripts and Tools
The third is to borrow scripts from other projects. This means going out and really hunting for them. There are a few out there, but you have to really look.
Doing it the hard way
And finally, you sometimes just have to write it yourself. Frankly, if you're desperate, make a copy of the original /etc/init.d/(whatever) file, set it aside, and edit the file. Typically, at the bottom of a init.d script, you'll find a CASE statement & friends, and from there you can see if there are any weird baked-in command line switches that shouldn't be there but are. Don't bother with anything beyond what is inside start)
and stop)
in this because they don't apply when using a supervisor. Look around and see if it needs a /var/run/(whatever) directory set up, that's always important too (don't forget to set ownership if you create it!). And towards the top, if the author did it right, there's usually a set of environment variables that contain the real daemon name, along with its options. From there you can usually cobble together a small script quickly.
Actually, you don't need to add anything in override_dh_auto_install
.
You need --with systemd
(without the dash between with
and systemd
) in the rules
and the package dh-systemd
installed.
Best Answer
pstree
gives me processes as below,With this, I think, it can be decided.