LinuxCommandLibrary

systemctl-mask

TLDR

Mask a service (prevent it from being started)

$ systemctl mask [service_name]
copy
Mask a service and stop it if running
$ systemctl mask [service_name] --now
copy
Mask a user service
$ systemctl mask [service_name] --user
copy

SYNOPSIS

systemctl [OPTIONS...] mask UNIT...

DESCRIPTION

systemctl mask links a unit to /dev/null, completely preventing it from being started by any means. This is stronger than disable, which only prevents automatic startup. Masked units cannot be started manually, by dependencies, or by any trigger.
Masking is useful for units that conflict with your setup or that you want to ensure never run. Use systemctl unmask to reverse the operation.

PARAMETERS

--now

Also stop the unit after masking
--user
Mask user service manager units instead of system units
--runtime
Mask temporarily until next reboot only

CAVEATS

Requires root privileges for system units. Masked units are impossible to start until unmasked. Use carefully; masking essential units can break system functionality. Check for dependencies before masking to avoid breaking other services.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Raspberry Pi 5 8GB

Raspberry Pi 5 8GB

$134.50
New Raspberry Pi 3 Model B+ Board Raspberry PI 3B+

New Raspberry Pi 3 Model B+ Board Raspberry PI 3B+

$54.00
Lenovo Gen 13 ThinkPad X1 Carbon Touchscreen Laptop with Intel Ultra 7 265U Processor, 14" WUXGA 100% sRGB, 32GB DDR5 RAM, 1TB NVMe Performance SSD, FHD+ IR+ RGB Camera, and Windows 11 Pro

Lenovo Gen 13 ThinkPad X1 Carbon Touchscreen Laptop with Intel Ultra 7 265U Processor, 14" WUXGA 100% sRGB, 32GB DDR5 RAM, 1TB NVMe Performance SSD, FHD+ IR+ RGB Camera, and Windows 11 Pro

$1,589.00
Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community

nuphy Air75 V2 Portable 75% Mechanical Keyboard,Wireless Keyboard

nuphy Air75 V2 Portable 75% Mechanical Keyboard,Wireless Keyboard

$129.95
Raspberry Pi 5 8GB

Raspberry Pi 5 8GB

$134.50
KIWITATA 2X Classic SNES USB Controller for PC Gamings, Retro SNES Wired USB Game Emulator Controller for Windows XP 7 8 11 Mac Raspberry Pi

KIWITATA 2X Classic SNES USB Controller for PC Gamings, Retro SNES Wired USB Game Emulator Controller for Windows XP 7 8 11 Mac Raspberry Pi

$16.99