Systemctl/enable

Aus Foxwiki
Version vom 6. September 2020, 07:21 Uhr von Dirkwagner (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „All systemctl enable does is create symlinks from /usr/lib/systemd/system/ or /etc/systemd/system/ to the appropriate target directories in /etc/systemd/system…“)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)

All systemctl enable does is create symlinks from /usr/lib/systemd/system/ or /etc/systemd/system/ to the appropriate target directories in /etc/systemd/system/, with services in the latter directory overriding ones in the former.

From the systemctl(1) manpage: enable NAME...

Enable one or more unit files or unit file instances, as
specified on the command line. This will create a number 
of symlinks as encoded in the "[Install]" sections of the
unit files.

Instead of using systemctl enable you could enable the netctl service manually with the following command:

ln -s /usr/lib/systemd/system/netctl.service \
/etc/systemd/system/multi-user.target.wants/netctl.service

And to disable it manually you could use the following command to remove the symlink created with the previous ln command:

rm /etc/systemd/system/multi-user.target.wants/netctl.service

The appropriate target directory can be found by looking for the WantedBy setting in the [Install] section of the service file in question, though older service files sometimes has Alias instead of WantedBy and you may want to switch to using WantedBy instead, but either will work just as well.

Instead of reverting to using netctl you could first check that the dhcpcd service was enabled properly, and if it was you can use journalctl's --directory or --root flags to check the logs of the dhcpcd service after mounting the filesystem on your other machine and see if that can give any clues as to why it failed to work properly.