Linux

RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!

Is it possible to set timeout on Linux screen session


👤 Login to reply

    #8  
Old 01-11-2018
prvnrk prvnrk is offline
Registered User
 
Hi Corona688, it's actually NOT working. Even though we're able to kill the bash (shell) but the screen session socket still exists (that's the whole point of having a session - not to lose session if there's disconnection to the server etc.). Just login into the server and running "screen -r" still restores my session and one can see what is going on the session.

So I changed your script as below and now its working fine ( basically I'm killing the screen session)
Code:
( sleep 120 && screen -S scr1 -X quit ) & # Kill screen session in 2 minutes
exec screen -S scr1 # Establish a screen session

Luckily screen offers us to name every session so you can use that name (instead of PID which is a random number) to kill/attach/detach. Now It's working as expected. Thanks for all the help!

Last edited by prvnrk; 01-11-2018 at 09:13 PM..
The Following User Says Thank You to prvnrk For This Useful Post:
Corona688 (01-15-2018)
Sponsored Links
👤 Login to reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Set timeout value for ssh session to HMC? thisissouvik AIX 2 01-29-2015 08:00 AM
Putty Session Timeout wancy UNIX for Dummies Questions & Answers 2 05-10-2011 11:00 PM
set Net:SSH:Expect timeout and set it again. mrwatkin Shell Programming and Scripting 1 02-15-2011 10:27 AM
Unix session timeout? NycUnxer AIX 3 08-03-2010 09:56 AM
telnet session timeout yls177 UNIX for Dummies Questions & Answers 6 10-16-2002 09:11 PM



All times are GMT -4. The time now is 11:18 AM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.
×
UNIX.COM Login
Username:
Password:  
Show Password





Not a Forum Member?
Forgot Password?