I'm trying to write a init.d
script for the first time to start a supervisord
process. Supervisor is a process controller/manager like runit
, upstart
, or systemd
. I would like it to start automatically if the system reboots, so that it can start my applications.
I used this tldp tutorial as a base to write an init.d
script. It works fine but I don't understand how I should modify this line in the file:
# chkconfig: 2345 95 05
The note in the tutorial for this line states:
Although these are comments, they are used by chkconfig command and must be present. This particular line defines that on runlevels 2,3,4 and 5, this subsystem will be activated with priority 95 (one of the lasts), and deactivated with priority 05 (one of the firsts).
This RHEL doc explains the various runlevels as so:
0 - Halt
1 - Single-user text mode
2 - Not used (user-definable_
3 - Full multi-user text mode
4 - Not used (user-definable)
5 - Full multi-user grapical mode
6 - Reboot
From these choices, I suppose I would like to run mine on 35
, assuming that 1 is only for system administrators.
There are a few example supervisord init.d
scripts, for example here. I noticed that all of the RHEL init.d
scripts contain the following line:
# chkconfig: 345 83 04
In this case, what reason could the authors have to want it to be active on runlevel 4, which is "not used" ?
The nginx init.d script that I installed contains this line:
# chkconfig: - 86 16
What does the -
mean for the runlevel here?
Why does this line not contain a deactivate priority?
How does one decide upon the priority levels for a process controller like supervisor
? The scripts above chose 83 and 04, whereas the tldp tutorial chose 95 and 05.