systemd notes
Start service on boot, but with delay
Use a timer on boot or active. This avoids annoying delay when restarting service manually from the basic ExecStartPre=/bin/sleep 15 solution.
[Unit]
Description=Start service after delay
[Timer]
OnBootSec=15sec
OnActiveSec=15sec
AccuracySec=1s
Unit=example.service
[Install]
WantedBy=timers.target
Misc tips
systemctl edit --fullcan be useful when writing custom units. Also--forceif creating the unit.- If your service depends on samba mounts, use
RequiresMountsFor=/mnt/foo. - Use systemd-nspawn for containerization.
machinectl edit my-containercan be used to edit the unit (e.g. to setup networking or bind mounts).
TODO
- Container VLAN setup