nZEDb

nZEDb => tmux Scripts => Topic started by: sudo on 2014-11-18, 03:01:04 am

Title: Gracious Shutdown
Post by: sudo on 2014-11-18, 03:01:04 am
I use killall tmux to terminate the tmux scripts at the moment. I'm just wondering if there is a safer or recommended way to do this? Thanks!
Title: Re: Gracious Shutdown
Post by: sudo on 2014-11-18, 03:08:06 am
Sorry I didn't search enough before I posted - I think this is fine:

Send a SQL command to stop the scripts then kill tmux.

UPDATE tmux SET value = 0 WHERE setting = 'running';
Wait up to however long it takes on average for monitor.php to loop and see the running value is 0
tmux kill-session
shutdown server
Title: Re: Gracious Shutdown
Post by: BeZazz on 2014-11-23, 12:32:10 am
Not sure if this how you are meant to do it but I normally go to
Tmux Settings Edit
and set
Tmux Scripts Running:
to no.
Title: Re: Gracious Shutdown
Post by: Darius on 2014-11-24, 12:27:59 pm
Or just left click into monitor pane (upper left pane in monitor window), do ctrl+c and wait all the scripts to stop (pane dead message) and do ctrl+a+d to detach and do killall tmux in terminal, or tmux kill-session nzedb, if you have more than one tmux sessions running.
Title: Re: Gracious Shutdown
Post by: NZBmets on 2014-12-20, 03:25:46 pm
I added a couple trivial helpers and submitted a pull request to dev. If added ...

.../nix/Tmux:
stop.php will set the Tmux script to InActive (not destroy the Tmux session)
run.php will set the Tmux script to Active

I found these surprising helpful as I manage a graceful shutdown each night and an autostart on boot with Crontab.
Title: Re: Gracious Shutdown
Post by: BeZazz on 2015-02-10, 09:43:50 am
Sounds like a great addition :)