Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

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 would like what scripts will run at start, without needing to "restart and see what happens", is there any way to know what 'services' are ready to run?

Shoud I check every single file in

ls /etc/rc0.d
and so on?

or just


Missing DOS autoexec.bat.......


I am using Debian

share|improve this question
Reboot is runlevel 6. What OS are you using? – Karlson Jan 22 '13 at 17:29
As Karlson mention, we need to know which OS your using (solaris, centos, ubuntu, etc). Are you looking for (1)What will be run when a machine startup/bootup? (2) What will be run when you hit the command reboot? – John Siu Jan 22 '13 at 17:45
@JohnSiu I am looking for (1), thanks – Hernán Eche Jan 22 '13 at 19:47

Trouble is, there has been quite a bit of turmoil in the system init area recently. Can't really comment autoritatively on all of them.

For "traditional" SysVinit, you have a bunch of directories /etc/rcX.d, where X ranges from 0 up to <max> which depends on the distribution's vagaries. The file /etc/inittab states the default runlevel (normally "full graphics environment", on Fedora/Red Hat at least it is/was 5). With that, you go dig into /etc/rc5.d (in this case), where you will find a farm of symlinks called KNNsomething and SNNsomethingelse. The K is for kill, you are interested in the S ones, for start. The number NN is a precedence (in which sequence to start/stop stuff is gigne by them). The something or somethingelseare descriptive names for the service. The chkconfig --list command lists the same (OK, those it knows about, something nasty might have snuck in there...). The scripts themselves are not for the faint of heart. It has been said that reading them causes eye cancer in laboratory sysadmins.

Newer systems use upstart (Ubuntu, some others), Fedora uses systemd, Debian I believe offers several alternatives, and so do some of the minor distributions (some might even have their own system). MacOS and Solaris have their own idiosincratic service management. But in several Linux distributions the migration from sysvinit isn't complete (on current Fedora, which spearheads systemd, there are still older scripts around, and systemd knows how to use them).

I'm no systemd expert, but that system is a lot more flexible than just "runlevels", you can have several targets (e.g., graphical desktop, database server, web server) and mix and match. systemctl list-units --type=target tells you which ones are configured, systemctl list-units tells you all the stuff that is currently active.

For others, you'll have to wait for somebody knowledgeable editing them in here (or commenting).

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.