Prevent maintenance.service from being started by dependencies or manually.
Use a stronger control than merely disabling boot activation.
Which command is appropriate?
systemctl mask links a unit to /dev/null and rejects normal start requests. unmask removes the mask.
Detailed explanation
systemctl disable maintenance.serviceIncorrect. disable does not prevent a manual start.
systemctl mask maintenance.serviceCorrect. mask blocks ordinary start requests.
systemctl status maintenance.serviceIncorrect. status only displays state.
systemctl preset maintenance.serviceIncorrect. preset applies distribution policy and is not a hard mask.
Try it yourself
An example you can run in a temporary verification environment.
systemctl --help 2>&1 | grep -E -- 'mask|unmask' | head -n 2Expected result
maskとunmaskに関するhelp行Key points
- mask blocks starts
- disable only affects auto-start
- unmask reverses it
Notes
- Environment: systemd systemctl help / unit変更なし
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Protected account data
Sensitive authentication data stored separately from ordinary account records.
Service availability
Whether a service can start automatically or be activated on demand.
Packet filter
A host firewall rule set that permits or rejects network packets.