Skip to content

Systemd - when systemctl unmask command fails

When you are using a typical modern Linux, where systemd is the init system, then you should be able to enable/disable daemons with:

systemctl enable somename.service
systemctl disable somename.service
and mask/unmask them with:
systemctl mask somename.service
systemctl unmask somename.service
In real life you may end up with the simple fact that unmask command does not do anything (my last case was with SANE daemon - used for running scanners in Linux):

systemctl unmask saned
systemctl status saned
● saned.service
Loaded: masked (/dev/null; bad)
Active: inactive (dead)

Well, in this case, check how things are:

file /lib/systemd/system/saned.service
/lib/systemd/system/saned.service: symbolic link to /dev/null
or

cd /lib/systemd/system/
ls -l sane*
lrwxrwxrwx 1 root root 9 mai 21 11:04 saned.service -> /dev/null
-rw-r--r-- 1 root root 309 mai 21 11:04 saned@.service
-rw-r--r-- 1 root root 132 mai 21 11:04 saned.socket
Which means that SANE unit file saned.service is symlinked to /dev/null and won't do anything, but there is a renamed unitfile saned@.service.

So the fix is simple - delete the symlinked one, rename the right one, enable and start the daemon:

cd /lib/systemd/system/
rm saned.service
mv saned@.service saned.service
systemctl enable saned.service
systemctl start saned.service

Trackbacks

No Trackbacks

Comments

Display comments as Linear | Threaded

No comments

The author does not allow comments to this entry

Add Comment

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons like :-) and ;-) are converted to images.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.


Form options