The officially official Devuan Forum!

You are not logged in.

#1 2019-07-15 00:49:22

aut0exec
Member
Registered: 2018-11-21
Posts: 81  

RC script templates

Not sure where to put this and my Google searches are turning up nothing useful; I'm hoping someone here remembers the command I'm looking for though!

I feel like way back in the good ole days there was an '*rc*' tool that would auto-generate the shell of an rc script for you and then you just simply had to modify the necessary items for your daemon/process/etc within the script. Does this sound familiar to anyone and if so what was the utility? Thought I had hit the jackpot with 'sysv-rc-conf' but that's more of a 'chkconfig' tool it seems...

*I am aware that I can copy most any other rc script in order to accomplish this task but now I'm trying to make sure I'm not going crazy and making up tools! big_smile

Offline

#2 2019-07-15 09:36:25

ralph.ronnquist
Administrator
From: Clifton Hill, Victoria, AUS
Registered: 2016-11-30
Posts: 1,107  

Re: RC script templates

Well, crazy or not, I think today's easiest method is to copy /etc/init.d/skeleton into the target init script, which then is a configuration for the interpreter script /lib/init/init-d-script that implements the control actions around the nominated "service program".

The init-d-script can also itself be copied, modified (especially by adding an LSB header) and used as the init.d script. That's a good approach if for instance your KPI is a lines-per-day measure, or more seriously, the actual service control is significantly unusual and/or complex.

The middle ground is to rather expand the skeleton copy with overriding functions for the actions where the generic implementations don't suffice.

The "difficult" part is still to read and digest the section 22.2 on Init Actions in Linux Standard Base Core Specification, Generic Part, plus a few sections following that, and to map that to the specifics of the system at hand.

Online

#3 2019-07-16 00:38:07

aut0exec
Member
Registered: 2018-11-21
Posts: 81  

Re: RC script templates

Ralph, Thanks. This is some good info! I'll keep looking for that old tool but the files you recommended, look to be a good start place for now. Much appreciated.

Offline

Board footer