The quick answer is: It depends on your init system.
The long answer is: For current versions of Ubuntu, you probably have a mix of Upstart, and SystemV. Newer versions of Ubuntu after 15.04 "Vivid Vervet" (and other Linux distros like RHEL/CentOS 7) are moving to use SystemD.
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:
The quick answer is: It depends on your
init
system.The long answer is: For current versions of Ubuntu, you probably have a mix of Upstart, and SystemV. Newer versions of Ubuntu after 15.04 "Vivid Vervet" (and other Linux distros like RHEL/CentOS 7) are moving to use SystemD.
Upstart
To list all services:
To list all Upstart services and run
initctl show-config
on them, this one-liner may be helpful:System V
To list all services:
OR:
SystemD
To list all services:
OR:
You can simply use the
initctl list
shell command to list the contents of/etc/init
rather than the suggesteddbus-send
command.For Ubuntu 18.04 use :
instead of
initctl
.Since Ubuntu 16.04,
initctl
has been replaced bysystemd
(source, in French).If it can help @sanjay-manohar.
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:
You may have to change
0_6
to reflect the version of upstart you have. This command works on my lucid install.If you want a nice graphical representation of services and time it takes to boot try:
For systemd (since 16.04) try systemd-bootchart instead:
Id use
initctl show-config <servicename>
to really get the details of when/if your service will start during boot.Like so:
Or for NFS4 idmap-daemon:
chkconfig is only preferable on RedHat based systems imho.
On 12.04 we could use:
but it was removed in 12.10.
Sample output:
Besides system services and scripts under:
There are probably AutoStart Applications too, for example:
Using gawk:
Sample output: