TrueNAS UI Timeout and Shell

paulinventome

Explorer
Joined
May 18, 2015
Messages
62
So I'm using rsync to move data from an older NAS to my new TrueNAS one.

But the issue I am running into is that if I open a shell on a Web UI session that session will timeout very quickly and then no shell. I cannot leave it over night.

At the same time I cannot find anything to change the session timeout - and plenty of threads asking for this but it seems that perhaps it cannot be done (v13)

So how are people handling long running shell sessions?

Kindest
Paul
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Use tmux to get a persistent shell, even if the connection drops or times out or whatever.
 

paulinventome

Explorer
Joined
May 18, 2015
Messages
62
Use tmux to get a persistent shell, even if the connection drops or times out or whatever.
Stupid question but any pointers where I could find out how to do that within TrueNAS?

Kindest
Paul
 

Redcoat

MVP
Joined
Feb 18, 2014
Messages
2,925
Last edited:

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Well, as always the manual is your friend: man tmux

You'll probably want to keep a copy open in a browser or something, though, tmux is not the most intuitive thing around.

To just keep something alive, all you need to know is:
  1. How to start tmux. Unsurprisingly, the executable is named tmux.
  2. How to detach from a session without killing it: CTRL+b, d (first CTRL+b, release and press d)
  3. How to kill the window: CTRL+b, x
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
As Redcoat and Eric said, tmux is the answer. But beyond that, do your best to forget the "Shell" button in the GUI exists and use SSH instead. The web GUI shell will likely eat the control characters you need for tmux anyway.
 

paulinventome

Explorer
Joined
May 18, 2015
Messages
62
As Redcoat and Eric said, tmux is the answer. But beyond that, do your best to forget the "Shell" button in the GUI exists and use SSH instead. The web GUI shell will likely eat the control characters you need for tmux anyway.
Thanks, good point that about SSH, should have crossed my mind.

On another note for anyone that does want to increase their session timeout this appears to work:

sed -ie 's/auth.generate_token",\[300/auth.generate_token",\[129600/g' /usr/local/www/webui/*.js

which was from this blog post https://tomschlick.com/extend-truenas-web-ui-session-timeout/ and you can set it up as an init script each time the server boots...

Kindest
Paul
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
A five-minute timeout (the 300 seconds you seem to be replacing) seems awfully short, but 36 hours seems excessive. Has anyone opened a ticket on this? I don't spend much time in the web GUI for TrueNAS at all, but timing out every five minutes would be very annoying.
 
Top