FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 04-25-2008, 04:48 AM
"Joseph L. Casale"
 
Default Bash script to logout user from console

I am stumped to figure out how to logout a user after they run a script interactively when logged into the console. I see how to do it if in x, but this server does not have x installed.
*
Thanks!

jlc


_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 04-25-2008, 08:06 AM
"Jeff Larsen"
 
Default Bash script to logout user from console

On Thu, Apr 24, 2008 at 11:48 PM, Joseph L. Casale
<jcasale@activenetwerx.com> wrote:
> I am stumped to figure out how to logout a user after they run a script
> interactively when logged into the console. I see how to do it if in x, but
> this server does not have x installed.

There are 2 possible interpretations to your post.

1. You want the last action of the script being run by the user on the
console to log out the user. In this case make the last command of the
shell script

kill -HUP `pgrep -s 0 -o`

This kills the login shell.

2. The user neglects to log out and you as root wish to force a logoff
without having to go to the console. The console session will have a
parent process that shows as "login -- <username>" in a ps -ef output.
Kill that process.

--
Jeff
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 12:47 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org