I have a perl application.In one of the low level scripts, it's possible that it must "logout" the user.Basically, exit the shell that this application is running. Are there Any ideas on how to accomplish this?
This is just off the top of my head mind you but you can determine the parent process id of the perl script via getppid
You could use this to kill the login shell.
kill 'STOP', getppid;
From a Perl Manual:
This function sends a signal to a list of processes. The first element of the list must be the signal to send.
You may use a signal name in quotes (without a SIG on the front). The function returns the number of
processes successfully signaled. If the signal is negative, the function kills process groups instead of
processes. (On System V, a negative process number will also kill process groups, but that's not
$cnt = kill 1, $child1, $child2;
kill 9, @goners;
kill 'STOP', getppid; # Can *so* suspend my login shell...