Create systemd service – daemon (Ubuntu 15+)

Setup Start by creating a file: /etc/systemd/system/CUSTOM_SERVICE_NAME.service with the following content: [Unit] Description=CUSTOM_SERVICE_DESCRIPTION [Service] ExecStart=/opt/www/EXEC_FILE WorkingDirectory=/opt/www Restart=always [Install] WantedBy=multi-user.target Enable the service. It will start automatically on boot, after that. $ sudo systemctl enable CUSTOM_SERVICE_NAME.service Check status/start/stop/restart $ sudo systemctl {status|start|stop|restart} CUSTOM_SERVICE_NAME A complete list with all available directives that can be used inside the […]