From: "Mr. Kenneth L. Atchinson" <katchins () sandstone ! baldwinw ! edu>
To: tru64-unix-managers
Subject: Summary: logout command
Date: Tue, 09 Jan 1996 19:49:07 +0000 [thread overview]
Message-ID: <96076327921141.tru64-unix-managers.marc@archive.invalid> (raw)
Hello Managers,
Here is a summary of all of the responses I got for this problem (stated)
> If you use the Korn Shell, and have an Korn
> Shell written application which performs various tasks including LOGGING
> off, there is no "logoff" (logout) command in Korn Shell nor in DEC UNIX.
> Performing an "exit" in a ksh script only exits the script. Thus my
> users in this script can not logoff the system using the script.
Reply from: Donald L. Ritchey <dritchey@cecc.chi.gov>
Try running the command 'stty 0' to set the baud rate on your tty to
0, effectively sending a hang-up signal to the connected shell and all
child processes.
Reply From: Jason Neil <jan@nzxray.galen.co.nz>
try setting up aliases for commands. see ksh - alias
Reply From: Hannu Paakko <Hannu.Paakko@ktt.ktt.fi>
You could send hup-signal to the shell process.
In .profile set
export MPID=$$
logout script:
kill -hup $MPID
Reply From: Dave Roberts <djr@saa-cons.co.uk>
Issuing a `kill 0` should kill the login process for that user. This
should work all flavours of Un*x. AIX is fairly unique in having a
logout command, it also doesn't exist on SCO, HP or DRS/NX.
Reply From: Eric Bennett <bennett@hpel.umd.edu>
You could define a function or alias which exec's your script:
alias logoff="exec /somepath/logoff"
You could do something like this to kill the parent process:
set `ps -fp $$`
kill -HUP $3
exit ## Never reached?
If you are persistent, how about:
upkill () {
set $1 `ps -o ppid -p $1`
if [ 0$3 -gt 1 ]; then upkill $3; fi
/bin/kill -HUP $1 2>/dev/null
}
upkill $$
Of course, this will also try to kill inetd and telnetd. (Shrug)
Reply From: Jon Trulson <trulsonj@mscd.edu>
You might try putting a kill -15 0 (or kill -9 0) in your
script. PID 0, when passed to a kill command will send that signal to
the process group. So doing a kill -9 0 in your script will kill all
processes started by the user that are still a part of the user's
process group.
Reply From: Jason Neil <jan@nzxray.galen.co.nz>
Reply From: msdc!daleb@uunet.uu.net (William D. Blasingame)
The 'logout' command is a builtin for csh, and, as you noted,
doesn't appear to be there for ksh. The problem you describe
might be solved by:
- letting the "Korn Shell written application" be the users' login
shell (in /etc/passwd). This way, when they exit this shell,
they're logged off.
- execute the application from the login shell with the 'exec' shell
command, thus making the current shell the application and not
creating a new (i.e., another) process. Again, when they quit
the current shell, they're off.
Thanks again from everyone for the responses.
===============================================================================
Kenneth Atchinson Baldwin-Wallace College
UNIX System Administrator 275 Eastland Rd.
katchins@baldwinw.edu Berea, Ohio 44017
Voice: (216) 826-6967 FAX: (216) 826-6545
reply other threads:[~1996-01-09 19:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox