martomi / chiadog

A watch dog providing a peace in mind that your Chia farm is running smoothly 24/7.
MIT License
457 stars 120 forks source link

Fix empty log for running in background mode #251

Closed maxbanton closed 3 years ago

martomi commented 3 years ago

Hi @maxbanton,

this looks good to merge, I think capturing stderr is a good idea in general. What I don't understand is the wording of the commit message. Can you describe what is the actual fix here? All relevant output goes on stdout currently so this is not fixing empty log as the commit message claims. At least not under expected behaviour and on Linux/Mac systems that I am using.

maxbanton commented 3 years ago

Hi @martomi. Sorry for late reply and messy commit message, proposed change fixes empty log when running in background mode using instructions from Readme. I mean when I added 2>&1, log entries started to appear in the log file, till that it was empty. Probably it's because I'm running chiadog from cron job on reboot event. As for now my crontab entry looks like this @reboot . /home/username/chiadog/venv/bin/activate && nohup python3 -u /home/username/chiadog/main.py --config /home/username/chiadog/config.yaml > /home/username/chiadog/output.log 2>&1 & and it starts automatically every time after reboot.