Skip to content
Back to skills

Systemd

BSecurity

systemd manages Linux services — start, stop, restart, enable on boot, and monitor processes. It replaces init scripts with declarative unit files. Handles dependencies, auto-restart, logging (journald), resource limits, and timers (cron replacement).

  • 67 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 10, 2026
ai-agentsgobashsqlnodedatabasesecurity

Security analysis

B88/100
  • criticalModifies startup scripts or system services for persistence

Pro shows the line behind each finding and how to fix it

Scanned November 10, 2026

npx -y skills add ComeOnOliver/skillshub --skill systemd --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Systemd?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Systemd
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/comeonoliver-systemd/badge)](https://www.skillsdirectory.com/skills/comeonoliver-systemd)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# systemd

## Overview

systemd manages Linux services — start, stop, restart, enable on boot, and monitor processes. It replaces init scripts with declarative unit files. Handles dependencies, auto-restart, logging (journald), resource limits, and timers (cron replacement).

## Instructions

### Step 1: Create a Service

```ini
# /etc/systemd/system/myapp.service — Node.js app as a system service
[Unit]
Description=My Node.js Application
After=network.target postgresql.service
Wants=postgresql.service

[Service]
Type=simple
User=deploy
Group=deploy
WorkingDirectory=/opt/myapp
ExecStart=/usr/bin/node dist/server.js
Restart=always
RestartSec=5
Environment=NODE_ENV=production
Environment=PORT=3000
EnvironmentFile=/opt/myapp/.env

# Security hardening
NoNewPrivileges=true
ProtectSystem=strict
ProtectHome=true
ReadWritePaths=/opt/myapp/uploads

# Resource limits
MemoryMax=512M
CPUQuota=80%

[Install]
WantedBy=multi-user.target
```

### Step 2: Manage Service

```bash
sudo systemctl daemon-reload          # reload after editing unit files
sudo systemctl enable myapp            # start on boot
sudo systemctl start myapp             # start now
sudo systemctl status myapp            # check status
sudo systemctl restart myapp           # restart
sudo systemctl stop myapp              # stop
journalctl -u myapp -f                 # view live logs
journalctl -u myapp --since "1 hour ago"  # recent logs
```

### Step 3: Timer (Cron Replacement)

```ini
# /etc/systemd/system/backup.timer — Run backup daily at 3 AM
[Unit]
Description=Daily Backup Timer

[Timer]
OnCalendar=*-*-* 03:00:00
Persistent=true

[Install]
WantedBy=timers.target
```

```ini
# /etc/systemd/system/backup.service — The actual backup job
[Unit]
Description=Database Backup

[Service]
Type=oneshot
User=deploy
ExecStart=/opt/scripts/backup.sh
```

```bash
sudo systemctl enable --now backup.timer
systemctl list-timers                    # list active timers
```

## Guidelines

- Always run `daemon-reload` after changing unit files.
- Use `Restart=always` for production services — systemd auto-restarts on crash.
- `journalctl -u service -f` is the primary log viewer — replaces checking log files.
- Timers are better than cron: persistent (catch up missed runs), dependency-aware, logged.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.