Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Is there a command to list services that run on startup? I imagine it would involve parsing /etc/init.d/, and the various /etc/rc.* directories.

share|improve this question

5 Answers 5

up vote 56 down vote accepted

You can simply use the initctl list shell command to list the contents of /etc/init rather than the suggested dbus-send command.

share|improve this answer

The /etc/init.d and /etc/rc.* directories have been superseded by the 'upstart' init tool. Although scripts in these directories will be executed as expected, the new method for running things on init is defined by files in /etc/init/

You can list all of the upstart jobs with by querying upstart over dbus:

dbus-send --print-reply --system --dest=com.ubuntu.Upstart \
        /com/ubuntu/Upstart com.ubuntu.Upstart0_6.GetAllJobs

You may have to change 0_6 to reflect the version of upstart you have. This command works on my lucid install.

share|improve this answer
3  
@Eric H: Could your set the answer below as correct instead - initctl list is much nicer than this dbus command. I'd like to leave this answer here for reference (rather than deleting it completely) though. –  Jeremy Kerr Feb 24 '11 at 4:48

If you want a nice graphical representation of services and time it takes to boot try:

apt-get install bootchart
share|improve this answer

Id use initctl show-config <servicename> to really get the details of when/if your service will start during boot.

Like so:

$ initctl show-config myservice
myservice
  start on runlevel [2345]
  stop on runlevel [!2345]

Or for NFS4 idmap-daemon:

$ initctl show-config idmapd
idmapd
  start on (local-filesystems or mounting TYPE=nfs4)
  stop on runlevel [06]

chkconfig is only preferable on RedHat based systems imho.

share|improve this answer

On 12.04 we could use:

sudo apt-get install chkconfig
chkconfig --list

but it was removed in 12.10.

Sample output:

acpi-support              0:off  1:off  2:on   3:on   4:on   5:on   6:off
acpid                     0:off  1:off  2:off  3:off  4:off  5:off  6:off
apparmor                  0:off  1:off  2:off  3:off  4:off  5:off  6:off  S:on
share|improve this answer
    
Doesn't work in Ubuntu. packages.ubuntu.com/… –  A.B. Apr 24 at 7:21
    
@A.B. thanks for letting me know! It is rare for downvoters to comment nowadays: it requires courage and allows me to learn. updated with the version it works in. –  Ciro Santilli 六四事件 法轮功 纳米比亚 威视 Apr 24 at 7:58
    
    
+1 for your changes –  A.B. Apr 24 at 7:59

Your Answer

 
discard

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.