What is the purpose of boot-time state management?
Controls when services start during Linux boot; systemd provides commands to enable, disable, mask, and unmask services.
What does systemctl enable do?
Configures a service to start automatically at boot; creates a symbolic link between the service unit file and a target (e.g., multi-user.target).
What is the syntax for enabling a service?
sudo systemctl enable <service-name></service-name>
Give an example of enabling Apache service.
sudo systemctl enable apache2.service
What output is shown when enabling a service?
Created symlink /etc/systemd/system/multi-user.target.wants/apache2.service → /lib/systemd/system/apache2.service; links Apache to multi-user.target so it starts automatically at boot.
What does systemctl disable do?
Prevents a service from starting automatically at boot; removes the symbolic link created by enable; does not stop a running service or block manual starts.
What is the syntax for disabling a service?
sudo systemctl disable <service-name></service-name>
Give an example of disabling Apache service.
sudo systemctl disable apache2.service
What output is shown when disabling a service?
Removed /etc/systemd/system/multi-user.target.wants/apache2.service; Apache will not start at boot but can be started manually with sudo systemctl start apache2.service.
What does systemctl mask do?
Blocks a service from being started manually or automatically; replaces the service unit file with a symlink to /dev/null.
What is the syntax for masking a service?
sudo systemctl mask <service-name></service-name>
Give an example of masking Apache service.
sudo systemctl mask apache2.service
What output is shown when masking a service?
Created symlink /etc/systemd/system/apache2.service → /dev/null; any attempt to start Apache will fail.
What does systemctl unmask do?
Removes the mask from a service; deletes the symlink to /dev/null; allows the service to be enabled or started again.
What is the syntax for unmasking a service?
sudo systemctl unmask <service-name></service-name>
Give an example of unmasking Apache service.
sudo systemctl unmask apache2.service; no output unless an error occurs.