Linux command
systemctl-mask 命令
文本
Copy it and replace filenames, paths, or keywords as needed.
命令示例
Mask
systemctl mask [service_name]
Example
systemctl mask [service_name] --now
Example
systemctl mask [service_name] --user
说明
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.
参数
- --now
- Also stop the unit after masking
- --user
- Mask user service manager units instead of system units
- --runtime
- Mask temporarily until next reboot only
FAQ
What is the systemctl-mask command used for?
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.
How do I run a basic systemctl-mask example?
Run `systemctl mask [service_name]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --now do in systemctl-mask?
Also stop the unit after masking