systemctl, how to unmask
root@gcomputer:~# systemctl status x11-common
● x11-common.service Loaded: masked (/dev/null; bad) Active: inactive (dead)I tried systemctl unmask x11-common and systemctl unmask x11-common.service but that did not change anything.
How do I unmask it?
3 Answers
The commands you are using are both correct. See also the manual.
It seems the unmask command fails when there is no existing unit file in the system other than the symlink to /dev/null. If you mask a service, then that creates a new symlink to /dev/null in /etc/systemd/system where systemd looks for unit files to load at boot. In this case, there is no real unit file.
Others seem to have similar issues
x11-common.service was also masked on my system. You can fix it like this:
First check that the unit file is a symlink to /dev/null
file /lib/systemd/system/x11-common.serviceit should return:
/lib/systemd/system/x11-common.service: symbolic link to /dev/nullin which case, delete it
sudo rm /lib/systemd/system/x11-common.serviceSince you changed a unit file, you need to run this:
sudo systemctl daemon-reloadnow check the status:
systemctl status x11-commonif it doesn't say loaded and running (if the circle is still red), reinstall the package:
sudo apt-get install --reinstall x11-commonand reload the daemon again
sudo systemctl daemon-reloadand check status once more
systemctl status x11-commonNow it's green and running :) The service has no systemd unit file, but systemd happily uses the script for it in /etc/init.d instead.
Follow the steps below:
systemctl edit systemd-hostnamedAdd the 2 lines below then exit the editor (don't forget to save when prompted):
[Service] PrivateNetwork=noThis will create an override.conf file with the above 2 lines in the directory:
/etc/systemd/system/systemd-hostnamed.service.d/The update systemd:
systemctl daemon-reloadThen restart the service:
systemctl restart systemd-hostnamed
You should now be able to run hostnamectl without it hanging.
It could be your service has an empty override file, like this:
● redis-server.service - Advanced key-value store Loaded: loaded (/lib/systemd/system/redis-server.service; masked; vendor preset: enabled) Drop-In: /etc/systemd/system/redis-server.service.d └─limit.confCheck if limit.conf is an empty file. If it is, please remove it. Then the service should be unmasked.
More in general
"Zoraya ter Beek, age 29, just died by assisted suicide in the Netherlands. She was physically healthy, but psychologically depressed. It's an abomination that an entire society would actively facilitate, even encourage, someone ending their own life because they had no hope. Th…"