====== Ubuntu - Startup Service - Unit File ======
Unit files are generally located within the R/W filesystem at /etc/systemd/system.
----
===== Create a Service Startup =====
[Unit]
Description=MyApp
After=docker.service
Requires=docker.service
[Service]
TimeoutStartSec=0
ExecStartPre=-/usr/bin/docker kill busybox1
ExecStartPre=-/usr/bin/docker rm busybox1
ExecStartPre=/usr/bin/docker pull busybox
ExecStart=/usr/bin/docker run --name busybox1 busybox /bin/sh -c "while true; do echo Hello World; sleep 1; done"
[Install]
WantedBy=multi-user.target
----
[Unit]
Description=CouchPotato application instance
After=network.target
[Service]
ExecStart=/usr/bin/authbind --deep /opt/CouchPotatoServer/CouchPotato.py
Type=simple
User=peter
Group=peter
[Install]
WantedBy=multi-user.target
====== Test ======
systemctl daemon-reload
systemctl start couchpotato.service
systemctl status couchpotato.service