Author Topic: Gracious Shutdown  (Read 5017 times)

Offline sudo

  • Newbie
  • *
  • Posts: 2
  • Helpful: +0/-0
Gracious Shutdown
« 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!

Offline sudo

  • Newbie
  • *
  • Posts: 2
  • Helpful: +0/-0
Re: Gracious Shutdown
« Reply #1 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

Offline BeZazz

  • Prolific Indexer
  • ****
  • Posts: 256
  • Helpful: +9/-2
    • BeZazz
Re: Gracious Shutdown
« Reply #2 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.

Offline Darius

  • Enforcer
  • *****
  • Posts: 120
  • Helpful: +7/-1
Re: Gracious Shutdown
« Reply #3 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.

Offline NZBmets

  • Prolific Indexer
  • ****
  • Posts: 260
  • Helpful: +11/-0
Re: Gracious Shutdown
« Reply #4 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.

Offline BeZazz

  • Prolific Indexer
  • ****
  • Posts: 256
  • Helpful: +9/-2
    • BeZazz
Re: Gracious Shutdown
« Reply #5 on: 2015-02-10, 09:43:50 AM »
Sounds like a great addition :)