Gracefully logging off another user.

Rashkae ubuntu at tigershaunt.com
Tue Nov 11 21:28:56 UTC 2008


Colin Murphy wrote:
> On my home, family machine, members of the household are quite happy 
> to 'Switch User' and open up a session for themselves - they seem far less 
> happy to log out again at the end of a session.  This usually means there are 
> several, three, maybe four, active sessions running on the one machine.  If 
> one of these sessions has some processor intensive task running, say they've 
> left a browser on some flash rich page, system response times really plummet.
> 
> Instruction and education to family members, some times with a larting stick, 
> has not reaped the rewards one might have hoped for.  So ...
> 
> What is the most graceful way, as a super user, to log out another user 
> closing all of their processes and ending their session?
> 

There is no graceful way.

You can sudo killall -u username, which will send the sigterm signal.
In theory.. applications should respect it and shut down, but will often
ignore saving session information or data.

If the concern is a cpu hungry task, you can always simply renice or
suspend the process.  However, if system response time is suffering so
badly, I suspect your issue is more likely to be RAM starvation, and the
system response slugishness is caused by swapping.




More information about the ubuntu-users mailing list