Created
June 20, 2017 17:01
-
-
Save ankibalyan/c038f74759e8b26369a1faef551c7a1b to your computer and use it in GitHub Desktop.
Upstart service for ubuntu that starts automatically on system restarts, and restarts on failure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /etc/systemd/system/name.service | |
[Unit] | |
Description==describe you upstart service | |
# if mysql service is prerequisite | |
Requires=mysql.service | |
After=mysql.service | |
# if anyother service is prerequisite | |
Requires=anyother.service | |
After=anyother.service | |
[Service] | |
TimeoutStartSec=0 | |
ExecStart=/usr/bin/node /path/to/your/file | |
Restart=on-failure | |
RestartSec=10s | |
Type=notify | |
NotifyAccess=all | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment