Reload unit file after edit systemd
Reload unit definitions and restart the service
systemctl daemon-reload && systemctl restart myapp.service
more systemd
all 26 commands →
Override unit with drop-in
systemctl edit myapp.service
Show unit file content
systemctl cat myapp.service
Analyze boot time
systemd-analyze blame | head -20
Draw boot dependency graph
systemd-analyze dot --require | dot -Tsvg > boot.svg && open boot.svg
Create a simple service unit
cat > /etc/systemd/system/myapp.service <<EOF
[Unit]
Description=My App
After=network.target
[Service]
ExecStart=/usr/bin/myapp
Restart=always
RestartSec=5
User=appuser
[Install]
WantedBy=multi-user.target
EOF