systemd-services
Create and manage systemd services and timers. Configure service dependencies and resource limits. Use when managing system services.
By bagelhole · 362 installs
npx skills add bagelhole/devops-security-agent-skills --skill systemd-services
Source repository · Upstream listing
Systemd Services
Create, manage, and monitor systemd services and timers. Covers unit file authoring, dependency management, socket activation, resource limits, journalctl log analysis, and production hardening.
When to Use
Deploying an application as a managed background service
Replacing cron jobs with systemd timers for better logging and dependency control
Setting up socket activation for on demand service startup
Configuring resource limits (CPU, memory, I/O) for services
Debugging service startup failures and runtime crashes
Managing service dependencies and ordering
Prerequisites
Linux system running systemd (most modern distributions)
Root or sudo access for creating system level unit files
Application binary or script to run as a service
Understanding of the application's start/stop lifecycle
Service Unit File Complete Example
Service Management Commands
Timer Units (Cron Replacement)
Timer File
Corresponding Service File
Timer Management
Socket Activation
Dependency Management
Resource Limits (cgroups v2)
Journalctl Log Analysis
Troubleshooting
Symptom Diagnostic Command Common Fix
Service fails to start systemctl status myapp , journalctl u myapp n 50 Check ExecStart path, permissions, config syntax
Service keeps restarting journalctl u myapp since "5 min ago" Check StartLimitBurst; look for crash in logs
"Main process exited, code=exited, status=217" journalctl u myapp User or group in unit file does not exist
"Failed to set up mount namespacing" Check ProtectSystem/PrivateTmp Kernel too old or SELinux blocking; relax directives
Timer not firing systemctl list timers , systemctl status backup.timer Ensure timer is enabled; validate OnCalendar expression
Service starts before dependency Check After= and Requires= Add After=dependency.service for ordering
OOM killed journalctl k \ grep oom , dmesg Increase MemoryMax or optimize application memory
Cannot bind to port 80 Check AmbientCapabilities Add CAP NET BIND SERVICE or use a higher port
Related Skills
linux administration General system administration context
performance tuning Kernel tuning and resource optimization
user management Service accounts and permissions
backup recovery Scheduling backups with systemd timers