1

When I do

ll /proc/1/exe

I get

lrwxrwxrwx. 1 root root 0 Oct 16 11:28 /proc/1/exe -> /usr/lib/systemd/systemd

Which means i am running systemd daemon not init.

But when I list

ll /etc/init.d/

I still get some services which are running by init (stripped output),

-rwxr-xr-x   1 root root  2269 Apr 22  2017 acpid*
-rwxr-xr-x   1 root root  5336 Apr 15  2016 alsa-utils*
-rwxr-xr-x   1 root root  2014 Dec 29  2014 anacron*
-rwxr-xr-x   1 root root  4335 Mar 23  2018 apparmor*
-rwxr-xr-x   1 root root  2802 Jan  3  2018 apport*
-rwxr-xr-x   1 root root  2134 Jul  7  2015 autofs*
-rwxr-xr-x   1 root root  2401 Nov  5  2015 avahi-daemon*
-rwxr-xr-x   1 root root  2968 Mar  2  2016 bluetooth*
-rwxr-xr-x   1 root root  1275 Jan 20  2016 bootmisc.sh*
-rwxr-xr-x   1 root root  2125 Apr 27  2016 brltty*
-rwxr-xr-x   1 root root  1904 Nov 18  2015 cgroupfs-mount*
-rwxr-xr-x   1 root root  3807 Jan 20  2016 checkfs.sh*
-rwxr-xr-x   1 root root  1098 Jan 20  2016 checkroot-bootclean.sh*
-rwxr-xr-x   1 root root  9353 Jan 20  2016 checkroot.sh*
-rwxr-xr-x   1 root root  1232 Aug  9 09:32 console-setup.sh*
-rwxr-xr-x   1 root root  3049 Apr  6  2016 cron*
-rwxr-xr-x   1 root root  2804 Mar 28  2018 cups*
-rwxr-xr-x   1 root root  1961 Feb 14  2016 cups-browsed*
-rwxr-xr-x   1 root root  2813 Dec  2  2015 dbus*
-rw-r--r--   1 root root  1195 Oct  7 06:13 .depend.boot
-rw-r--r--   1 root root  2459 Oct  7 06:13 .depend.start
-rw-r--r--   1 root root  1926 Oct  7 06:13 .depend.stop

and a lot more services when I list,

ll /lib/systemd/system

Can someone please tell me why there are so many services running under init?

3

There is only systemd running in your system and it is starting all the services, including the ones defined in /etc/init.d.

For compatibility with older systems using traditional init (also known as "sysvinit" or "System V init"), systemd implements a mechanism by which it is able to start services using the traditional init scripts.

This compatibility layer is implemented by the systemd-sysv-generator, which looks for legacy init scripts and wraps them into native systemd service units. (For example, it will find /etc/init.d/avahi-daemon and create a /run/systemd/system/avahi-daemon.service wrapper for it, which has an ExecStart= that runs /etc/init.d/avahi-daemon start and similarly for stop and reload operations, emulating the way legacy init scripts work.)

Some distributions also provide wrappers for executables such as service and chkconfig providing further compatibility with sysvinit.

In order to check which services are defined for systemd, you can use commands such as systemctl (shows all unit files), systemctl list-units (shows active units in memory) or systemctl status service, which you can use on one of the legacy init services, since it exists in systemd through the wrapper.

2

Those are not running services, but executable scripts.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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