Config Files · 1 file

Sample Systemd Unit File

systemd unit files define how Linux services start, restart and are sandboxed. Our sample is realistic and valid for its tool, with fake hosts and secrets.

systemd unit · 477 B

systemd service unit

A systemd unit for a web app with dependencies, a dedicated user, environment file, restart policy and hardening options. All hosts, keys and secrets are fake.

CC0 · free for any use · Verified by an independent tool · Report a problem

sample-app.service — first linesINI
# Sample systemd unit — samplefiles.com
[Unit]
Description=Sample web application
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=sampleapp
Group=sampleapp
WorkingDirectory=/opt/sample-app
EnvironmentFile=/etc/sample-app/env
ExecStart=/usr/bin/node /opt/sample-app/server.js
Restart=on-failure
RestartSec=5
NoNewPrivileges=true
ProtectSystem=strict
ProtectHome=true
ReadWritePaths=/var/lib/sample-app

[Install]
WantedBy=multi-user.target

File details

Size
477 B (477 bytes)
MIME type
text/plain
SHA-256
db4a1633ee1c705eecdc74abd1b4be3f4be425e583b4f55f52659f2e7775df7e
MD5
885e6fc6bb56a5b71b6e304ecd128d07

Download from the command line

curl -L -o sample-app.service https://files.samplefiles.com/config/systemd/sample-app.service

Or check the download in your browser with the checksum calculator.