systemd
units are stored in /lib/systemd/system
such as:
rsync.service
avahi-daemon.socket
bluetooth.service
cups.service
When you use the following command:
systemctl enable name
Replace name with the name of the service unit you want to enable (for example, apache2
). This command reads the [Install]
section of the selected service unit and creates appropriate symbolic links to the /lib/systemd/system/name.service
file in the /etc/systemd/system/
directory and its subdirectories.
But some packages don't have *.service
files in /lib/systemd/system
. Examples are mysql
and apache2
. Using systemctl
to enable them works fine:
# systemctl enable apache2
Synchronizing state for apache2.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d apache2 defaults
Executing /usr/sbin/update-rc.d apache2 enable
Or
# systemctl enable mysql
Synchronizing state for mysql.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d mysql defaults
Executing /usr/sbin/update-rc.d mysql enable
I don't get any result when looking for files related to these services:
# find /etc/systemd/system/ -iname "*apache2*"
# find /etc/systemd/system/ -iname "*mysql*"
How does systemd find out apache2 or mysql is to be enabled?