Systemctl/enable: Unterschied zwischen den Versionen
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…“ |
Keine Bearbeitungszusammenfassung |
||
Zeile 18: | Zeile 18: | ||
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. | 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. | ||
[[Category:Linux:Befehl]] |
Version vom 18. März 2021, 09:33 Uhr
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.