Agent skill
linux-services
Systemd service management and log access
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/linux-services
SKILL.md
Linux Services Skill
Manage systemd services and access logs safely.
See also: Shared Conventions | Safety Guidelines
Purpose
Check service status, view logs, and restart services when needed.
Commands
Service Status
systemctl status <service>
systemctl is-active <service>
systemctl is-enabled <service>
systemctl list-units --type=service --state=running
Service Control
systemctl start <service>
systemctl stop <service>
systemctl restart <service>
systemctl reload <service>
Log Access
journalctl -u <service> --no-pager -n 200
journalctl -u <service> --since "1 hour ago" --no-pager
journalctl -u <service> -f # follow
Service Restart Protocol
Before restarting any service:
-
Capture current status
bashsystemctl status myapp -
Capture recent logs
bashjournalctl -u myapp --no-pager -n 50 -
Present findings to user
-
Restart (only after acknowledgment)
bashsystemctl restart myapp -
Verify service started
bashsystemctl status myapp
Workflow: Diagnose Service Issues
# 1. Check if service is running
systemctl is-active myapp
# 2. Get detailed status
systemctl status myapp
# 3. Check recent logs for errors
journalctl -u myapp --no-pager -n 100 | grep -i error
# 4. Check when it last started
systemctl show myapp --property=ActiveEnterTimestamp
Workflow: Safe Restart
# 1. Pre-restart state
systemctl status myapp
journalctl -u myapp --no-pager -n 20
# 2. Restart
systemctl restart myapp
# 3. Verify
sleep 2
systemctl status myapp
journalctl -u myapp --since "1 minute ago" --no-pager
Policies
- Capture state before restart - always log pre-restart status
- Verify after restart - confirm service is healthy
- No blind restarts - understand why restart is needed
- Critical services - extra caution with database, auth, networking services
- Report any failed restarts with full log output
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?