It that parses the LSB information in init scripts

init-scriptinit.dlsb

At the top of files in /etc/init.d are comments like the following.

### BEGIN INIT INFO
# Provides:        ntp
# Required-Start:  $network $remote_fs $syslog
# Required-Stop:   $network $remote_fs $syslog
# Default-Start:   2 3 4 5
# Default-Stop:    1
# Short-Description: Start NTP daemon
### END INIT INFO

What is the program that parses those comments? I'm interested in seeing how it does it. Is it a script?

Best Answer

The LSB info is parsed by insserv on older Ubuntu and Debian systems, and by chkconfig on older Redhat and Fedora systems, and is now parsed by /usr/lib/systemd/system-generators/systemd-sysv-generator on systems using systemd.

All of these are coded in C. The pre-systemd chkconfig sources in the above link are probably a good starting point.

Related Question