Created
April 24, 2021 16:24
-
-
Save TimoPtr/2a938a4a54e62cc7766bfe61e3051f96 to your computer and use it in GitHub Desktop.
Chia service
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=Chia Daemon | |
After=network-online.target multi-user.target | |
Requires=network-online.target | |
[Service] | |
Type=forking | |
TimeoutStartSec=infinity | |
User=chia | |
ExecStart=/bin/bash /home/chia/start_chia.sh | |
ExecStop=/bin/bash /home/chia/stop_chia.sh | |
[Install] | |
WantedBy=multi-user.target |
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 | |
cd /home/chia/chia-blockchain | |
. ./activate | |
chia start farmer -r | |
echo "chia started" |
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 | |
cd /home/chia/chia-blockchain | |
. ./activate | |
chia stop -d all | |
echo "chia stoped" |
Thanks for this!
Your 2 commands above are wrong, they should be systemctl
not servicectl
True I did wrote it too fast 👍
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In this scripts I assume the blockchain source is in /home/chia/chia-blockain and there is a user chia in the system.
/etc/systemd/system/
or create a link/home/chia
sudo systemctl enable chia.service
To check the status
systemctl status chia