Using systemctl mask --runtime $unit has no effect.
Steps To Reproduce
Steps to reproduce the behavior:
systemctl mask --runtime display-manager.service
The command is successful and places a symlink in /run/systemd/system/display-manager.service
It has no effect on systemd's outlook on that service:
# systemctl status display-manager
● display-manager.service - X11 Server
Loaded: loaded (/etc/systemd/system/display-manager.service; enabled-runtime; preset: enabled)
Active: active (running) since Thu 2023-08-31 16:57:22 CEST; 40min ago
Expected behavior
I expected to see
# systemctl status display-manager
● display-manager.service
Loaded: masked (Reason: Unit display-manager.service is masked.)
Active: active (running) since Thu 2023-08-31 16:57:22 CEST; 43min ago
Which is what happens after the transient workaround below.
This is a quirk of the fact that nixos puts its systemd configuration in /etc rather than /usr/lib, because systemd prioritizes /etc over /run over /usr/lib.
Describe the bug
Using
systemctl mask --runtime $unit
has no effect.Steps To Reproduce
Steps to reproduce the behavior:
systemctl mask --runtime display-manager.service
/run/systemd/system/display-manager.service
Expected behavior
I expected to see
Which is what happens after the transient workaround below.
Screenshots
Additional context
There is a workaround in this post: https://discourse.nixos.org/t/temporarily-disabling-a-systemd-service/26225/13
It does work locally for me if I do
Notify maintainers
@NixOS/systemd
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.