When I run the command sudo systemctl list-unit-files
(I think the sudo is optional), I get output which shows all services and their state.
Here is a snippet from my machine:
UNIT FILE STATE
...
debian-fixup.service static
debug-shell.service disabled
display-manager.service enabled
dns-clean.service enabled
dsmcad.service enabled
emergency.service static
failsafe-x.service static
friendly-recovery.service masked
fuse.service masked
gdm.service masked
getty-static.service static
getty@.service enabled
gpsd.service indirect
gpsdctl@.service static
gpu-manager.service enabled
halt-local.service static
halt.service masked
hostname.service masked
...
I wonder why some services are in the "masked" state. I think this means, "this is better than 'disabling', because the service cannot be started, neither by hand or by systemd".
How can I get more information about the state of a service unit?
Who has put the units into their respective state?
I tried, for example,
sudo systemctl help dsmcad
- that only brings up the documentation = ...
line from the unit file. /etc/systemd/system/dsmcad.service
Note: Here I know exactly what dsmcad service is and what it does, I have installed it myself. I am more interested in a general solution.
mask
and anunmask
command that can be used withsystemctl
. So just dosystemctl unmask name_of_service.service
. – Kellerspeicher Mar 23 '17 at 17:53systemctl unmask name_of_service.service
completely removed my service definition file from/etc/systemd/system/
, so now I need to add it back again. If it becomes masked again, I'll be stuck in a loop o.O – Eldamir Jun 12 '18 at 09:22/etc/systemd/system
are just symbolic links of services. Your should add the*.service
file to/lib/systemd/system
from where it will be linked to/etc/systemd/system
if youenable
the service.mask
is creating a link to/dev/null
andunmask
is removing this link from/etc/systemd/system
and obviously it makes no difference if someone put a file there. – Kellerspeicher Jun 13 '18 at 12:26