-
-
Save lingqingmeng/6a43c16ddd03dd34d665a50f1af9bf08 to your computer and use it in GitHub Desktop.
failsafe script daemon for systemctl
This file contains 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
[Unit] | |
Description=command for running the cosmos node after restart. | |
ConditionPathExists=/home/ubuntu/go/bin/gaiad | |
After=network.target | |
[Service] | |
Type=simple | |
User=ubuntu | |
Restart=on-failure | |
RestartSec=10 | |
startLimitIntervalSec=60 | |
WorkingDirectory=/home/ubuntu/go/src/github.com | |
ExecStart= /home/ubuntu/go/bin/gaiad start --home=/home/ubuntu/.gaiad &> gaia2.log & NODE1_PID=$! | |
PermissionStartOnly=true | |
ExecStartPre=mkdir -p /var/log/cosmos | |
ExecStartPre=chown syslog:adm /var/log/cosmos | |
ExecStartPre=chmod 755 /var/log/cosmos | |
StandardOutput=syslog | |
StandardError=syslog | |
SyslogIdentifier=cosmos | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sudo journalctl -f -u cosmos-failsafe.service
Command now changed to