LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   where does a subsystem in linux gets it's number from (https://www.linuxquestions.org/questions/linux-newbie-8/where-does-a-subsystem-in-linux-gets-its-number-from-4175617746/)

new_user3085 11-16-2017 08:30 AM

where does a subsystem in linux gets it's number from
 
Hello All,

I'm trying to understand how are the numbers assigned to the services/subsystems under /etc/init.d/rcN.d in Linux (or any OS). Where do the services get the numbering from. I tried google but couldn't find closely related info. Thanks in advance.

lrwxrwxrwx 1 root root 18 Jan 14 11:59 K92firewall -> ../init.d/firewall
lrwxrwxrwx 1 root root 17 Jan 14 11:59 S10network -> ../init.d/network
lrwxrwxrwx 1 root root 16 Jan 14 11:59 S12syslog -> ../init.d/syslog
lrwxrwxrwx 1 root root 18 Jan 14 11:59 S17keytable -> ../init.d/keytable
lrwxrwxrwx 1 root root 20 Jan 14 11:59 S56rawdevices -> ../init.d/rawdevices
lrwxrwxrwx 1 root root 16 Jan 14 11:59 S56xinetd -> ../init.d/xinetd
lrwxrwxrwx 1 root root 18 Jan 14 11:59 S75httpd -> ../init.d/httpd
lrwxrwxrwx 1 root root 11 Jan 13 21:45 S99local -> ../rc.local

jlinkels 11-16-2017 08:36 AM

Each startup script contains dependencies. I.e. services which must be running before a certain new service can start. These dependencies are mentioned in the script header.

The startup sequence is derived from the dependencies by the insserv utility. When a script is linked in a rcX.d directory by update-rc.d, this program queries the insserv start/stop dependencies and assigns the correct Snn or Knn to the symlink.

jlinkels


All times are GMT -5. The time now is 09:00 PM.