bet
bet copied to clipboard
Installing bet as system service and with log file
Right now bet
is just run in a tmux
session to make sure it is always running in the backend. Or there is a method to run bet
command via bash shell script, which ensures that bet
keeps running and restart if it for some reason crashes/exits.
bet as systemd service
The better way would be to make a systemd
service which allows us to install bet
for specific node type to start it with it's relevant role. Example would be:
# To start
systemctl start bet-cashier.service
# To stop
systemctl stop bet-cashier.service
# To restart
systemctl restart bet-cashier.service
# To enable service to start on OS startup
systemctl enable bet-cashier.service
# To disable service to start on OS startup
systemctl disbale bet-cashier.service
The relevant issue making this backend service would be to make sure we have the console log outputs of the service somewhere stored.
I propose we start using /opt/
directory on Unix/Linux systems to install bet
instead of $HOME
directory of the user and use that common place as a service location for the executable binary in system service configuration file.
logs management of bet command output
I propose we store at least one month worth of output logs from bet command in log store directory, and make a dated archive of the logs as well.
The relevant tasks would be:
- [ ] Create a
bet-cashier.service
file forsystemd
service manager - [ ] Insure all the console and output print outs and logs are saved in a log file at location
/opt/bet/logs/bet-cashier.log
- [ ] Make a script etc to make dated archives of log to keep the size of
bet-cashier.log
file sane, and delete any archive logs older than 1 month.