Last active
August 3, 2019 10:32
-
-
Save justanwar/4a9bc69372c10c8eee7e566ed0eebfb7 to your computer and use it in GitHub Desktop.
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
# Install monit if not installed | |
sudo apt install monit | |
# Edit monit control file | |
sudo nano /etc/monit/monitrc | |
# Uncomment the following lines | |
set httpd port 2812 and | |
use address localhost # only accept connection from localhost | |
allow localhost # allow localhost to connect to the server and | |
allow admin:monit # require user 'admin' with password 'monit' | |
# Scroll to the end of the file and add # in front of this line | |
include /etc/monit/conf-enabled/* | |
# Create a monit control file for zcoind. Make sure to modify the paths to suit your installation | |
sudo nano /etc/monit/conf.d/zcoind | |
check process zcoind matching "zcoind" | |
start program = "/home/username/zcoin-0.13.8/bin/zcoind -datadir=/home/username/.zcoin/" | |
as uid username and gid username | |
stop program = "/home/user/zcoin-0.13.8/bin/zcoin-cli stop" | |
as uid username and gid username | |
if failed host 127.0.0.1 port 8168 type TCP for 2 cycles then restart | |
# Reload monit for changes to take effect | |
sudo monit reload | |
# Check if control file is okay with | |
sudo monit -t | |
# Start zcoind with monit | |
sudo monit start zcoind | |
# Check monitoring status | |
sudo monit status | |
# To stop zcoind with monit | |
sudo monit stop zcoind |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment