$120 tested Claude codes · real before/after data · Full tier $15 one-timebuy --sheet=15 →
$Free 40-page Claude guide — setup, 120 prompt codes, MCP servers, AI agents. download --free →
clskills.sh — terminal v2.4 — 2,347 skills indexed● online
[CL]Skills_
LinuxintermediateNew

Linux Systemd

Share

Create and manage systemd services and timers

Works with OpenClaude

You are a Linux systems administrator. The user wants to create, configure, manage, and troubleshoot systemd services and timers for automated tasks and service management.

What to check first

  • Run systemctl --version to confirm systemd is installed and check the version
  • Run systemd-analyze verify /etc/systemd/system/myservice.service to validate service file syntax before enabling

Steps

  1. Create a service file at /etc/systemd/system/myservice.service with [Unit], [Service], and [Install] sections
  2. Set Type=simple (default), Type=forking, or Type=oneshot depending on how your application daemonizes
  3. Define ExecStart=/path/to/binary with full path and required arguments in the [Service] section
  4. Set User= and Group= to the service account (e.g., User=www-data) to restrict privilege escalation
  5. Add Restart=on-failure or Restart=always with RestartSec=5 to auto-restart on crashes
  6. For timers, create a .timer file that references a .service file and specify OnBootSec=, OnUnitActiveSec=, or OnCalendar= triggers
  7. Run systemctl daemon-reload after creating or modifying service/timer files to reload systemd configuration
  8. Enable the service with systemctl enable myservice.service and start with systemctl start myservice.service
  9. Check logs with journalctl -u myservice.service -f to monitor output in real time

Code

# /etc/systemd/system/myapp.service
[Unit]
Description=My Application Service
After=network.target
Wants=network-online.target

[Service]
Type=simple
User=myappuser
Group=myappuser
WorkingDirectory=/opt/myapp
Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
ExecStart=/opt/myapp/bin/myapp --config=/etc/myapp/config.yaml
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
RestartSec=10
StandardOutput=journal
StandardError=journal
SyslogIdentifier=myapp
TimeoutStopSec=30
KillMode=mixed

[Install]
WantedBy=multi-user.target

---

# /etc/systemd/system/myapp-backup.timer
[Unit]
Description=Daily Backup Timer for MyApp
Requires=myapp-backup.service

[Timer]
OnBootSec=10min
OnUnitActiveSec=1d
Persistent=true
AccuracySec=1min

[Install]
WantedBy=timers.target

---

# /etc/systemd/system/myapp-backup

Note: this example was truncated in the source. See the GitHub repo for the latest full version.

Common Pitfalls

  • Treating this skill as a one-shot solution — most workflows need iteration and verification
  • Skipping the verification steps — you don't know it worked until you measure
  • Applying this skill without understanding the underlying problem — read the related docs first

When NOT to Use This Skill

  • When a simpler manual approach would take less than 10 minutes
  • On critical production systems without testing in staging first
  • When you don't have permission or authorization to make these changes

How to Verify It Worked

  • Run the verification steps documented above
  • Compare the output against your expected baseline
  • Check logs for any warnings or errors — silent failures are the worst kind

Production Considerations

  • Test in staging before deploying to production
  • Have a rollback plan — every change should be reversible
  • Monitor the affected systems for at least 24 hours after the change

Quick Info

CategoryLinux
Difficultyintermediate
Version1.0.0
AuthorClaude Skills Hub
linuxsystemdservices

Install command:

curl -o ~/.claude/skills/linux-systemd.md https://clskills.in/skills/linux/linux-systemd.md

Related Linux Skills

Other Claude Code skills in the same category — free to download.

Want a Linux skill personalized to YOUR project?

This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.