Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to run one sysvinit script before another and figured out how to do that.

To make sure, this actually happens in the the order I like, I would like to see a list, in which order that happens.

I found sudo insserv --showall already, but can't make head or tail of it, since it lists init scripts multiple times.

How to find out in which order /etc/init.d scripts are load on Debian?

share|improve this question
BusyBox users arriving at this post: unix.stackexchange.com/questions/59018/… Note the comment "executing them in numerical order" – dtmland Feb 12 '15 at 18:25
up vote 6 down vote accepted

There's some files in /etc/init.d/ directory:

$ ls -al /etc/init.d/ | grep -i depend
-rw-r--r--   1 root root  2739 Feb 17 05:20 .depend.boot
-rw-r--r--   1 root root  2221 Feb 17 05:20 .depend.start
-rw-r--r--   1 root root  1855 Feb 17 05:20 .depend.stop

Whenever you run update-rc.d the files will change. .depend.boot file is for S level, .depend.start is for 2 3 4 5 levels and .depend.stop for 0 1 6.

In my case, I have the following order in .depend.start:

TARGETS = killprocs motd nvidia-kernel nfs-common rsyslog privoxy virtualbox
linuxlogo acpi-fakekey binfmt-support fancontrol openvpn hddtemp cgconfig 
dropbox-container dbus dnscrypt-proxy pulseaudio atd cryptmount exim4 
qbittorrent-nox ddclient acpi-support smartmontools ssh ntp loadcpufreq acpid 
cron rsync cgrulesengd cpufrequtils bootlogs bootchart-done single rmnologin 
rc.local stop-bootlogd

You can also see why the order presents in the way you see above. Each next line looks like this:

cgrulesengd: rsyslog cgconfig

which means that cgrulesengd needs rsyslog cgconfig to be started prior.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.