24. Manage Service Failure Recovery
Beginner Mode
Start your terminal to use beginner mode.
Scenario
You have a shell script at /usr/local/bin/check_app.sh that runs periodically and exits with a non-zero code. The script is currently failing due to a simulated error condition.
Task
Create a systemd service named check_app.service that automatically restarts the script when it fails, but stops retrying after 3 restart attempts within 60 seconds. Configure the service to start on boot with a 5-second delay between restart attempts, then start the service and verify it hits the restart limit.
Terminal requires a larger screen
Open this page on a desktop or tablet (≥ 768px) to launch the terminal and practice hands-on.
Linux Terminal Environment
Write and execute your solution in the terminal below.
Essential
Linux 0/29
AWS 0/10
Kubernetes 0/15
CI/CD 0/5
Networking 0/9
Need more practice in this area? Explore more questions →
Apple
Accenture
Coinbase
Adobe
EPAM
Twitch
Amazon
Kayak
Autodesk
Lyft
Revolut
RedHat
Bloomberg
Datadog
Palantir
TCS
HashiCorp
Google
DeutscheBank
GitHub
Cloudflare
Stripe
Microsoft
NVIDIA
GoDaddy
X
SAP
Spotify
Airbnb
Meta
Reddit
Yelp
Okta
Dropbox
Slack
ActivisionBlizzard
Zscaler
Uber
IBM
DeliveryHero
Robinhood
GitLab
Shopify
Samsung
Elastic
Twilio
Netflix
CrowdStrike
Ubisoft
Anthropic
Capital One
Splunk
Intel
AMD
Databricks