Roland Turner

about | contact

Simplest Possible Systemd Service

(Because almost every search result for this provides a lengthy discussion instead of a simple example…)

In /etc/systemd/system/sleep-92951829.service :

[Unit]
Description=Sleep Demo

[Service]
ExecStart=/bin/sleep 92951829

[Install]
WantedBy=multi-user.target

$ sudo chown root.root /etc/systemd/system/sleep-92951829.service

$ sudo chmod 644 /etc/systemd/system/sleep-92951829.service

$ sudo systemctl enable sleep-92951829

$ sudo systemctl start sleep-92951829

$ ps -fC sleep