03-25-2005
Quote:
Under Redhat Linux how do I kill the session and log the user out and display the login screen from my script?
I have not understood the above quite perfectly.
But, here is some break.
man exit
man logout
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi there.
How do I make the DB connection see the parameter variables passed to the unix script ? The code snippet below isn't working properly.
sqlplus << EOF
user1@db1/pass1
BEGIN
PACKAGE1.perform_updates($1,$2,$3);
END;
EOF
Thanks in advance,
Abrahao. (2 Replies)
Discussion started by: 435 Gavea
2 Replies
2. Shell Programming and Scripting
Hi,
Apologies if anyone has read my recent post on the same subject in the Linux forum, just thought actually the solution might more likely come from scripting.
Essentially, I am trying to restrict access to directories based on the user's name AND their location on a session-by-session... (3 Replies)
Discussion started by: en7smb
3 Replies
3. Solaris
I am not able to login in gnome session and java session in Sun solaris 9& 10 respectively through xmanager as a nis user, I am able to login in common desktop , but gnome session its not allowing , when I have given login credentials, its coming back to login screen, what shoul I do to allow nis... (0 Replies)
Discussion started by: durgaprasadr13
0 Replies
4. Shell Programming and Scripting
hi,
im executing one script i,e sh test.sh
i want to log out the sessing after script execution.
and i do't want to user command like this.
sh test.sh ; exit
can i exit the session with the use of script
pl help (1 Reply)
Discussion started by: arvindng
1 Replies
5. HP-UX
Our network administrators implemented some sort of check to kill idle sessions and now burden is on us to run some sort of keep alive. Client based keep alive doesn't do a very good job. I have same issue with ssh. Does solution 2 provided above apply for ssh sessions also? (1 Reply)
Discussion started by: yoda9691
1 Replies
6. Shell Programming and Scripting
Besides 'who am i' and 'tty' what commands could be used to determine if a session is interactive as compared to a web process or cron process. Any command should work with the common unix variants. (3 Replies)
Discussion started by: jgt
3 Replies
7. Solaris
what is the difference between desktop session and console session in solaris
as i am wondering we use option -text for the former and -nowin for the later (1 Reply)
Discussion started by: kishanreddy
1 Replies
8. UNIX for Dummies Questions & Answers
hi,
i want to make a session logout in c++/unix which will redirect the user to the login page if the user is idle for 5mins (1 Reply)
Discussion started by: anubhav sharma
1 Replies
9. UNIX for Advanced & Expert Users
Hi,
How can I find out the login and logout time of the old UNIX session/user?. (2 Replies)
Discussion started by: sharif
2 Replies
LOGIN(3) Linux Programmer's Manual LOGIN(3)
NAME
login, logout - write utmp and wtmp entries
SYNOPSIS
#include <utmp.h>
void login(const struct utmp *ut);
int logout(const char *ut_line);
Link with -lutil.
DESCRIPTION
The utmp file records who is currently using the system. The wtmp file records all logins and logouts. See utmp(5).
The function login() takes the supplied struct utmp, ut, and writes it to both the utmp and the wtmp file.
The function logout() clears the entry in the utmp file again.
GNU Details
More precisely, login() takes the argument ut struct, fills the field ut->ut_type (if there is such a field) with the value USER_PROCESS,
and fills the field ut->ut_pid (if there is such a field) with the process ID of the calling process. Then it tries to fill the field
ut->ut_line. It takes the first of stdin, stdout, stderr that is a tty, and stores the corresponding pathname minus a possible leading
/dev/ into this field, and then writes the struct to the utmp file. On the other hand, if no tty name was found, this field is filled with
"???" and the struct is not written to the utmp file. After this, the struct is written to the wtmp file.
The logout() function searches the utmp file for an entry matching the ut_line argument. If a record is found, it is updated by zeroing
out the ut_name and ut_host fields, updating the ut_tv timestamp field and setting ut_type (if there is such a field) to DEAD_PROCESS.
RETURN VALUE
The logout() function returns 1 if the entry was successfully written to the database, or 0 if an error occurred.
FILES
/var/run/utmp
user accounting database, configured through _PATH_UTMP in <paths.h>
/var/log/wtmp
user accounting log file, configured through _PATH_WTMP in <paths.h>
CONFORMING TO
Not in POSIX.1-2001. Present on the BSDs.
NOTES
Note that the member ut_user of struct utmp is called ut_name in BSD. Therefore, ut_name is defined as an alias for ut_user in <utmp.h>.
SEE ALSO
getutent(3), utmp(5)
COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
GNU
2004-05-06 LOGIN(3)