[opensuse] Any way of having an idle timeout on a virtual console?
I'd like to have an idle timeout on my virtual consoles - does something like that already exist, e.g. as an option somewhere that just needs a '#' removed? thanks /Per -- Per Jessen, Zürich (23.1°C) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Per Jessen wrote:
I'd like to have an idle timeout on my virtual consoles - does something like that already exist, e.g. as an option somewhere that just needs a '#' removed?
Not entirely sure if this is what you want but from man bash: TMOUT If set to a value greater than zero, TMOUT is treated as the default timeout for the read builtin. The select command terminates if input does not arrive after TMOUT seconds when input is coming from a terminal. In an interactive shell, the value is interpreted as the number of seconds to wait for input after issuing the primary prompt. Bash terminates after waiting for that number of seconds if input does not arrive. Cheers, Dave -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Dave Howorth wrote:
Per Jessen wrote:
I'd like to have an idle timeout on my virtual consoles - does something like that already exist, e.g. as an option somewhere that just needs a '#' removed?
Not entirely sure if this is what you want but from man bash:
TMOUT
If set to a value greater than zero, TMOUT is treated as the default timeout for the read builtin. The select command terminates if input does not arrive after TMOUT seconds when input is coming from a terminal. In an interactive shell, the value is interpreted as the number of seconds to wait for input after issuing the primary prompt. Bash terminates after waiting for that number of seconds if input does not arrive.
Cheers, Dave
Thanks Dave - that seems to do the trick. I'll be making a few more tests, but initially I just set TMOUT in /etc/profile.local and that worked. /Per -- Per Jessen, Zürich (20.2°C) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Per Jessen wrote:
Dave Howorth wrote:
Per Jessen wrote:
I'd like to have an idle timeout on my virtual consoles - does something like that already exist, e.g. as an option somewhere that just needs a '#' removed?
Not entirely sure if this is what you want but from man bash:
TMOUT
If set to a value greater than zero, TMOUT is treated as the default timeout for the read builtin. The select command terminates if input does not arrive after TMOUT seconds when input is coming from a terminal. In an interactive shell, the value is interpreted as the number of seconds to wait for input after issuing the primary prompt. Bash terminates after waiting for that number of seconds if input does not arrive.
Cheers, Dave
Thanks Dave - that seems to do the trick. I'll be making a few more tests, but initially I just set TMOUT in /etc/profile.local and that worked.
Next question - what is the right/correct way to determine if /etc/profile.local is being run from a local console? (I'm not sure what the correct term is?) I only want set the timeout when someone is logged in as root locally. /Per -- Per Jessen, Zürich (20.6°C) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Per Jessen wrote:
Next question - what is the right/correct way to determine if /etc/profile.local is being run from a local console? (I'm not sure what the correct term is?) I only want set the timeout when someone is logged in as root locally.
Again, I'm not entirely sure but you could check whether the controlling terminal is a real tty or a pts. You could also check what the parent process is - login or an ssh or somesuch. I don't know what is "correct" :) Cheers, Dave -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wednesday, 2009-05-20 at 13:10 +0200, Per Jessen wrote:
I'd like to have an idle timeout on my virtual consoles - does something like that already exist, e.g. as an option somewhere that just needs a '#' removed?
I have that feature working on my old 7.3 SuSE system, but I think it is controlled by the BIOS. The display doesn't simply go black, it actually goes to sleep, using DPMS, I assume. On the machine I'm at right now, it doesn't happen. At most, it goes black. I don't think it is a bash feature... or it wouldn't work inside mc or pine. So, I really do not know how to setup that timeout. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAkoVUL0ACgkQtTMYHG2NR9XC4wCcDnmx0Qjv0dmrijnxENpSzuii hu0AnRU8KudWXIsQqfm8uva/7jZ/CuSn =dRZu -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Carlos E. R. wrote:
On Wednesday, 2009-05-20 at 13:10 +0200, Per Jessen wrote:
I'd like to have an idle timeout on my virtual consoles - does something like that already exist, e.g. as an option somewhere that just needs a '#' removed?
I have that feature working on my old 7.3 SuSE system, but I think it is controlled by the BIOS. The display doesn't simply go black, it actually goes to sleep, using DPMS, I assume.
That works fine, but I want the user actually logged off after a timeout. /Per -- Per Jessen, Zürich (28.1°C) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday, 2009-05-21 at 15:04 +0200, Per Jessen wrote:
Carlos E. R. wrote:
On Wednesday, 2009-05-20 at 13:10 +0200, Per Jessen wrote:
I'd like to have an idle timeout on my virtual consoles - does something like that already exist, e.g. as an option somewhere that just needs a '#' removed?
I have that feature working on my old 7.3 SuSE system, but I think it is controlled by the BIOS. The display doesn't simply go black, it actually goes to sleep, using DPMS, I assume.
That works fine, but I want the user actually logged off after a timeout.
Ah! I didn't understand your question correctly, then. But I have the faint idea you can do that via "pam". Me, I'd prefer the terminal to be locked and require a password to re-enter, not be logged-off, as the user might have something running there. Same as in X. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAkoVV0AACgkQtTMYHG2NR9WMHwCdGPNEwtgtHPs9kgje/SZ28B5x ploAniBzhQ/jmW74mkcPL8bCm7C8efI3 =CkEv -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Carlos E. R. wrote:
On Thursday, 2009-05-21 at 15:04 +0200, Per Jessen wrote:
Carlos E. R. wrote:
On Wednesday, 2009-05-20 at 13:10 +0200, Per Jessen wrote:
I'd like to have an idle timeout on my virtual consoles - does something like that already exist, e.g. as an option somewhere that just needs a '#' removed?
I have that feature working on my old 7.3 SuSE system, but I think it is controlled by the BIOS. The display doesn't simply go black, it actually goes to sleep, using DPMS, I assume.
That works fine, but I want the user actually logged off after a timeout.
Ah! I didn't understand your question correctly, then. But I have the faint idea you can do that via "pam".
Me, I'd prefer the terminal to be locked and require a password to re-enter, not be logged-off, as the user might have something running there. Same as in X.
Yes, that would work too, but my main concern is servers in racks in a datacenter, and someone (incl. myself) just forgetting to log off after having quickly checked something or other. /Per -- Per Jessen, Zürich (20.9°C) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday, 2009-05-21 at 21:24 +0200, Per Jessen wrote:
Ah! I didn't understand your question correctly, then. But I have the faint idea you can do that via "pam".
Me, I'd prefer the terminal to be locked and require a password to re-enter, not be logged-off, as the user might have something running there. Same as in X.
Yes, that would work too, but my main concern is servers in racks in a datacenter, and someone (incl. myself) just forgetting to log off after having quickly checked something or other.
Right; but locking a terminal is safe, is it not? The thing is, a bash setting should only work when you are at the prompt, not when using some (other) program. It is something I also want to know, I simply doubt a bash setting is the perfect method. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAkoVrQUACgkQtTMYHG2NR9XDrACbB1eVgoMFL3fh+V/7fkE21CRJ BOgAn3+blj9lg8JbYB4/ZL8wyit/Mtz2 =lRlQ -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Carlos E. R. wrote:
On Thursday, 2009-05-21 at 21:24 +0200, Per Jessen wrote:
Ah! I didn't understand your question correctly, then. But I have the faint idea you can do that via "pam".
Me, I'd prefer the terminal to be locked and require a password to re-enter, not be logged-off, as the user might have something running there. Same as in X.
Yes, that would work too, but my main concern is servers in racks in a datacenter, and someone (incl. myself) just forgetting to log off after having quickly checked something or other.
Right; but locking a terminal is safe, is it not?
Yep.
The thing is, a bash setting should only work when you are at the prompt, not when using some (other) program.
I would expect it to work all the time, but the bash TMOUT doesn't seem to do the trick. I ran top, and that disabled the time-out.
It is something I also want to know, I simply doubt a bash setting is the perfect method.
And you're right - it's not good enough. /Per -- Per Jessen, Zürich (20.2°C) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (3)
-
Carlos E. R.
-
Dave Howorth
-
Per Jessen