Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Locking the console
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
HMC
Tux's lil' helper
Tux's lil' helper


Joined: 06 Jul 2005
Posts: 79
Location: Australia

PostPosted: Sun Aug 08, 2010 5:39 am    Post subject: Locking the console Reply with quote

A few problems:

I currently have TMOUT="90" in ~/.bashrc which works fine in console and KDE Konsole to log-out of the root account after 90s.

1. I would like to be able to do this for ALL users globally (/etc/env.d/99local ??). It'll work fine for the linux console, but doesn't play nice with Konsole (it is killed) when normal users are logged into DE. I don't need it in Konsole for normal users anyway. I want the log-out for normal users on the console only. Any suggestions on how to achieve this.... environment variables specifying tty's?

2. Next issue is one of locking the console. The above works fine for auto log-out, but a big issue is that the console is held open until the running process is complete. ie When there is a pile of updates (especially if OO is in there) or processing a huge file for inclusion in a DB (from a user account) that might take a day or two to complete a console is held open for the entire period. Vlock will lock the console ($ vlock -c) which is fine, but how can this be configured as an auto lock? Is it even capable of this? Man page mentions environment variables, but I get nowhere.

The desired behaviour is lock after 60s regardless of what is happening and logout 90s after the last command completes.

Thanks
Back to top
View user's profile Send private message
Anarcho
Advocate
Advocate


Joined: 06 Jun 2004
Posts: 2970
Location: Germany

PostPosted: Sun Aug 08, 2010 6:24 am    Post subject: Re: Locking the console Reply with quote

HMC wrote:
A few problems:

I currently have TMOUT="90" in ~/.bashrc which works fine in console and KDE Konsole to log-out of the root account after 90s.

1. I would like to be able to do this for ALL users globally (/etc/env.d/99local ??). It'll work fine for the linux console, but doesn't play nice with Konsole (it is killed) when normal users are logged into DE. I don't need it in Konsole for normal users anyway. I want the log-out for normal users on the console only. Any suggestions on how to achieve this.... environment variables specifying tty's?


Check ENV seems reasonable. Why don't you try?

HMC wrote:
2. Next issue is one of locking the console. The above works fine for auto log-out, but a big issue is that the console is held open until the running process is complete. ie When there is a pile of updates (especially if OO is in there) or processing a huge file for inclusion in a DB (from a user account) that might take a day or two to complete a console is held open for the entire period. Vlock will lock the console ($ vlock -c) which is fine, but how can this be configured as an auto lock? Is it even capable of this? Man page mentions environment variables, but I get nowhere.

The desired behaviour is lock after 60s regardless of what is happening and logout 90s after the last command completes.


You can start the long running process in a screen (emerge screen) session. After you've send the sceen to the background (CRTL-A D) you can logoff. After you have login you can go back to the screen session which is hopefully done.
_________________
...it's only Rock'n'Roll, but I like it!
Back to top
View user's profile Send private message
HMC
Tux's lil' helper
Tux's lil' helper


Joined: 06 Jul 2005
Posts: 79
Location: Australia

PostPosted: Sun Aug 08, 2010 8:14 am    Post subject: Reply with quote

First bit - Not sure (read no idea) how. TMOUT ttys and how to apply that to users...

CRTL-A D does nothing on my system. Ctrl-Z, jobs fg and bg are available, but it is not what I am trying to achieve.
The running process will terminate if I exit.
Back to top
View user's profile Send private message
Anarcho
Advocate
Advocate


Joined: 06 Jun 2004
Posts: 2970
Location: Germany

PostPosted: Sun Aug 08, 2010 8:17 am    Post subject: Reply with quote

You have to start screen first. After you have detached the screen (the application screen) you can logoff. Later, after login again, you can use "screen -xr" to resume with your screen session.
_________________
...it's only Rock'n'Roll, but I like it!
Back to top
View user's profile Send private message
HMC
Tux's lil' helper
Tux's lil' helper


Joined: 06 Jul 2005
Posts: 79
Location: Australia

PostPosted: Sun Aug 08, 2010 9:27 am    Post subject: Reply with quote

Okay, thanks. I should have read what was written a bit better. I have been playing with it a little. I get where you are going now, but preference would be to achieve an auto lock.
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23072

PostPosted: Sun Aug 08, 2010 6:26 pm    Post subject: Reply with quote

HMC wrote:
First bit - Not sure (read no idea) how. TMOUT ttys and how to apply that to users...
When you are in script context and preparing to set TMOUT, you can read and write other environment variables as well. As far as I know, the only time that $TERM is set to the value linux is when logged in on a real terminal, not a pty under xterm/Konsole. Therefore, you could write:
Code:

if [ "$TERM" = 'linux' ]; then
  TMOUT=90
fi
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum