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 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.targetFile details
Download from the command line
curl -L -o sample-app.service https://files.samplefiles.com/config/systemd/sample-app.servicewget https://files.samplefiles.com/config/systemd/sample-app.servicehttps://files.samplefiles.com/config/systemd/sample-app.serviceprintf '%s %s\n' db4a1633ee1c705eecdc74abd1b4be3f4be425e583b4f55f52659f2e7775df7e sample-app.service | shasum -a 256 -cOr check the download in your browser with the checksum calculator.