0
0
Linux CLIscripting~10 mins

systemctl for service management in Linux CLI - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to start the nginx service using systemctl.

Linux CLI
sudo systemctl [1] nginx
Drag options to blanks, or click blank then click option'
Astop
Bstart
Crestart
Dstatus
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'stop' instead of 'start' will turn the service off.
Using 'status' only shows the service state, it doesn't start it.
2fill in blank
medium

Complete the command to check the status of the sshd service.

Linux CLI
systemctl [1] sshd
Drag options to blanks, or click blank then click option'
Arestart
Bdisable
Cenable
Dstatus
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'enable' or 'disable' changes startup behavior, not current status.
Using 'restart' will stop and start the service, not just show status.
3fill in blank
hard

Fix the error in the command to disable the apache2 service at boot.

Linux CLI
sudo systemctl [1] apache2
Drag options to blanks, or click blank then click option'
Astatus
Bstart
Cdisable
Drestart
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'stop' stops the service now but does not disable auto-start.
Using 'start' or 'restart' will start the service, not disable it.
4fill in blank
hard

Fill both blanks to create a command that restarts the docker service and shows its status.

Linux CLI
sudo systemctl [1] docker && systemctl [2] docker
Drag options to blanks, or click blank then click option'
Arestart
Bstart
Cstatus
Dstop
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'start' instead of 'restart' will not restart if already running.
Using 'stop' will stop the service, not restart it.
5fill in blank
hard

Fill all three blanks to create a command that enables the nginx service, starts it, and then checks its status.

Linux CLI
sudo systemctl [1] nginx && sudo systemctl [2] nginx && systemctl [3] nginx
Drag options to blanks, or click blank then click option'
Adisable
Bstart
Cstatus
Denable
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'disable' instead of 'enable' will prevent auto-start.
Skipping 'start' means the service might not be running now.
Not checking 'status' leaves you unsure if the service started.