Last active
December 9, 2020 00:04
-
-
Save c29r3/1107210124872f6f5de5b0fbf240264b to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
PROJECT_NAME="sifchain" | |
BIN_PATH="$HOME/go/bin" | |
NODED="sifnoded" | |
echo "------> Creating systemd unit $PROJECT_NAME.service" | |
tee /etc/systemd/system/$PROJECT_NAME.service > /dev/null <<EOF | |
[Unit] | |
Description=$PROJECT_NAME Full Node | |
After=network-online.target | |
[Service] | |
User=$USER | |
ExecStart=$BIN_PATH/$NODED start | |
Restart=always | |
RestartSec=3 | |
#LimitNOFILE=150000 | |
[Install] | |
WantedBy=multi-user.target | |
EOF | |
systemctl daemon-reload | |
systemctl enable $PROJECT_NAME | |
systemctl start $PROJECT_NAME | |
systemctl status $PROJECT_NAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment