Complete the code to start a service named 'nginx' using systemctl.
sudo systemctl [1] nginxUse start to launch the service immediately.
Complete the code to check the status of the 'ssh' service.
systemctl [1] sshThe status command shows if the service is running or stopped.
Fix the error in the command to enable the 'docker' service at boot.
sudo systemctl [1] dockerUse enable to make the service start automatically at boot.
Fill both blanks to create a systemd service file snippet that runs a script '/usr/local/bin/myscript.sh' after the network is ready.
[Unit] Description=My Script Service After=[1] [Service] ExecStart=[2] [Install] WantedBy=multi-user.target
The After=network-online.target ensures the service starts after the network is fully up.
The ExecStart needs the full command to run the script, so /bin/bash /usr/local/bin/myscript.sh is correct.
Fill all three blanks to write a command that reloads systemd manager configuration, restarts the 'apache2' service, and then checks its status.
sudo systemctl [1] && sudo systemctl [2] apache2 && sudo systemctl [3] apache2
First, daemon-reload reloads systemd configs.
Then, restart restarts the apache2 service.
Finally, status shows the current state of apache2.