Author Topic: Tmux start up difference  (Read 4718 times)

Offline gennavar

  • Prolific Indexer
  • ****
  • Posts: 215
  • Helpful: +9/-0
Tmux start up difference
« on: 2013-11-13, 12:42:12 am »
Ok, it must be something I'm not understanding about Linux I suspect - can any one point me in the right direction?

Starting tmux by moving into the tmux directory and typing "php start.php" works fine :)

However ...
Created a file "go.sh" in my home directory containing:
     "php /var/www/nZEDb/misc/update_scripts/nix_scripts/tmux/start.php"
Typed "./go.sh" in home directory and tmux loads up, the monitor window displays and all the other panes show the "Not running" statement.
Toggling the tmux running option does nothing, I just can't get it to recognise it should be running.
(Monitor log is being updated regularly but no other logs files.)

I've been using go.sh for a while now without issue - this problem only started a few days ago.

Anyone got any thoughts?

Notes:
- Running latest dev as of this morning
- No processes chewing up CPU time
- Showing processlist against the db shows all processes sleeping, minimal activity
« Last Edit: 2013-11-13, 12:43:51 am by gennavar »

Offline kaibosh

  • Overlord
  • ******
  • Posts: 161
  • Helpful: +18/-0
Re: Tmux start up difference
« Reply #1 on: 2013-11-13, 01:38:24 am »
Most (if not all) of the scripts use relative directory addressing to find various functions and config files. So your current working directory is important. Use something like this instead in your go.sh script:

Code: [Select]
cd /var/www/nZEDb/misc/update_scripts/nix_scripts/tmux/ && php start.php

Offline gennavar

  • Prolific Indexer
  • ****
  • Posts: 215
  • Helpful: +9/-0
Re: Tmux start up difference
« Reply #2 on: 2013-11-13, 04:14:11 am »
I will definitely try that kaibosh, thanks ... but with it working before (for at least 2 months) I'd presumed it wouldn't be that.

I did speak too soon on the "php start.php" works fine though ... I've come to stop the tmux process (in order to try out your suggestion) and tmux won't stop again :(
I've checked the database and the column "running" in the tmux table has correctly been set to "false" and the "updateddate" is correct but tmux is just carrying on merrily with processes continuing to run.

I've ctrl-a-c'd out of it now and am running a check & optimise on the database just in case .....

Offline jonnyboy

  • Epic Indexer
  • *****
  • Posts: 1046
  • Helpful: +93/-1
  • Lazzy Trucker
Re: Tmux start up difference
« Reply #3 on: 2013-11-13, 08:42:19 am »
I use a symlink to /var/www/nZEDb folder and it has no problem starting/running. Also, setting the monitor running to false does not stop monitor or tmux. It just keeps it from (re)starting and scripts.

Offline gennavar

  • Prolific Indexer
  • ****
  • Posts: 215
  • Helpful: +9/-0
Re: Tmux start up difference
« Reply #4 on: 2013-11-13, 08:47:07 am »
... Also, setting the monitor running to false does not stop monitor or tmux. It just keeps it from (re)starting and scripts.

Yeah, that's what is confusing me as even with monitor running FALSE it keeps kicking off the scripts for each pass. Obviously something I've got screwed up else I suspect everyone would be moaning but no idea what :(

NB. DB check and optimise went through fine

Offline jonnyboy

  • Epic Indexer
  • *****
  • Posts: 1046
  • Helpful: +93/-1
  • Lazzy Trucker
Re: Tmux start up difference
« Reply #5 on: 2013-11-13, 09:08:43 am »
I'll have to look. TBH, I never used it. I just:

Code: [Select]
ctral-a d
killall tmux

Offline gennavar

  • Prolific Indexer
  • ****
  • Posts: 215
  • Helpful: +9/-0
Re: Tmux start up difference
« Reply #6 on: 2013-11-13, 09:11:03 am »
Nope, still no joy.

Rebooted server and started tmux with Running = FALSE, waited for tmux to come up and monitor to update and then set Admin / Tmux Settings / Tmux Scripts Running to TRUE

Tmux monitor updates every few seconds and the colour of the text on the other panes (E.G. "update_releases has been disabled/terminated by Running") keeps changing so I know it's looping round

Code: [Select]
mysql> select * from tmux where setting = 'Running';
+----+---------+-------+---------------------+
| ID | setting | value | updateddate         |
+----+---------+-------+---------------------+
|  9 | running | TRUE  | 2013-11-13 16:59:11 |
+----+---------+-------+---------------------+
1 row in set (0.00 sec)

If I kill tmux, make sure Running is TRUE and then re-start it, it kicks straight in.

It really does seem like it reads the fields in fine at the start but then ignores any changes once it's up and going .... somehow ....  :o

Just had a further check and it's not just the Running field - I've swapped the "Logging" option from TRUE to FALSE and vice versa and that doesn't make a difference either!

Could there be some caching that's not refreshing correctly when values change do you think?

Offline jonnyboy

  • Epic Indexer
  • *****
  • Posts: 1046
  • Helpful: +93/-1
  • Lazzy Trucker
Re: Tmux start up difference
« Reply #7 on: 2013-11-13, 02:27:44 pm »
There is no caching of either, but I will look.

**EDIT**
I found the error in running, I will push later.
« Last Edit: 2013-11-13, 02:32:07 pm by jonnyboy »

Offline gennavar

  • Prolific Indexer
  • ****
  • Posts: 215
  • Helpful: +9/-0
Re: Tmux start up difference
« Reply #8 on: 2013-11-14, 01:39:36 am »
I found the error in running, I will push later.

Great news jonnyboy! I'm stuck at work currently (bleugh!) but will check tonight when I get home.
Thanks yet again :)