Challenge - 5 Problems
Systemd Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
What is the output of checking a service status?
You run the command
systemctl status sshd on a Linux system with systemd. What output will you see if the SSH service is active and running?Linux CLI
systemctl status sshd
Attempts:
2 left
💡 Hint
Think about what 'active and running' means in systemd service status.
✗ Incorrect
When a service is running, systemctl shows 'Active: active (running)' with a timestamp. Other options indicate errors or inactive states.
💻 Command Output
intermediate2:00remaining
What happens when you enable a service?
You run
systemctl enable nginx. What is the expected result?Linux CLI
systemctl enable nginx
Attempts:
2 left
💡 Hint
Enabling a service creates links for automatic start, it does not start the service.
✗ Incorrect
The enable command creates symbolic links so the service starts on boot. It does not start the service immediately.
🔧 Debug
advanced3:00remaining
Why does this systemd service fail to start?
Given this service file snippet, why will the service fail to start?
[Service]
ExecStart=/usr/bin/myapp
Restart=always
[Install]
WantedBy=multi-user.target
Linux CLI
[Unit] Description=My App Service [Service] ExecStart=/usr/bin/myapp Restart=always [Install] WantedBy=multi-user.target
Attempts:
2 left
💡 Hint
Check if the executable path exists and is executable.
✗ Incorrect
If the ExecStart path is wrong or the binary does not exist, systemd cannot start the service. The other options are not mandatory or cause different issues.
📝 Syntax
advanced3:00remaining
Identify the syntax error in this systemd service file
Which option shows the syntax error in this service file snippet?
[Service]
ExecStart=/usr/bin/myapp
Restart=always
RestartSec=5s
TimeoutStartSec=30
User=appuser
Group=appgroup
[Install]
WantedBy=multi-user.target
Linux CLI
[Service] ExecStart=/usr/bin/myapp Restart=always RestartSec=5s TimeoutStartSec=30 User=appuser Group=appgroup [Install] WantedBy=multi-user.target
Attempts:
2 left
💡 Hint
Check systemd documentation for valid directive formats and sections.
✗ Incorrect
RestartSec accepts time with units like '5s'. TimeoutStartSec accepts seconds without units. User and Group belong in [Service]. This file is valid.
🚀 Application
expert4:00remaining
How to create a one-shot systemd service that runs a script once at boot?
You want to create a systemd service that runs a script
/usr/local/bin/startup.sh only once during boot and then stops. Which service file configuration is correct?Attempts:
2 left
💡 Hint
One-shot services run a command and then stop, optionally remaining active.
✗ Incorrect
Type=oneshot tells systemd the service runs a short task and exits. RemainAfterExit=yes keeps the service active after the script finishes, useful for dependencies.