Sponsored Content
Top Forums UNIX for Advanced & Expert Users Login and logout time of a session Post 302174100 by sharif on Monday 10th of March 2008 05:03:22 AM
Old 03-10-2008
Login and logout time of a session

Hi,
How can I find out the login and logout time of the old UNIX session/user?.
 

9 More Discussions You Might Find Interesting

1. Red Hat

How do you logout from a session?

Hello all - I'm finishing up a script that I wrote. This is what I did: I added some lines to the .bash_profile that will call my startup script: cd $HOME/startup ./startup.scr This startup script will create some directories, move some files, and then startup an application: cd... (4 Replies)
Discussion started by: Heron
4 Replies

2. UNIX for Dummies Questions & Answers

Login and logout script

Hi all I know ho I can run a script when a user logs in, viz using the .login or .profile file, however what can I use to run a script when a user logouts ? Thanks J :confused: (1 Reply)
Discussion started by: jhansrod
1 Replies

3. Shell Programming and Scripting

detecting login or logout

what function would tell me that a user has logged in or out? i already know from my script the users name i already know in real time there was an event how an I tell if that event was a login or logout? Any ideas? # i did try comparing the file sizes for change but various users may... (8 Replies)
Discussion started by: nortypig
8 Replies

4. Solaris

I am not able to login in gnome session and java session in Sun solaris 9& 10

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

5. Shell Programming and Scripting

session logout

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

6. OS X (Apple)

Login/Logout script

Dear readers I use SnowLeopard 10.6.2 and need to do some special tasks at login and logout of an sepcific user. My problem is, how do I send a string "login" respectively "logout" from computer "A", where the login/logout script runs, to computer "B" where some other tasks need to be done. ... (3 Replies)
Discussion started by: tthaler
3 Replies

7. Shell Programming and Scripting

Determining if session is a login session

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

8. UNIX for Dummies Questions & Answers

Session logout

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. Shell Programming and Scripting

Login/Logout Information in report

Hello Experts, Am very much new to the bash shell scripting.I need a small favour,I need a shell script to get Login and Logout information in a csv file.Can some one help me out please. Regards, (1 Reply)
Discussion started by: ahmed.vaghar
1 Replies
getlogin(2)							System Calls Manual						       getlogin(2)

NAME
getlogin, getlogin_r, setlogin - Gets and sets login name SYNOPSIS
#include <unistd.h> char *getlogin(void); int getlogin_r( char *name, size_t len); int setlogin( char *name); The following function does not conform to current standards and is supported only for backward compatibility: int getlogin_r(char *name, int len); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: getlogin(), getlogin_r(): XSH5.0 Refer to the standards(5) reference page for more information about industry standards and associated tags. PARAMETERS
Points to the login name. Specifies the length of the buffer pointed to by name. DESCRIPTION
The getlogin() function returns the login name of the user associated with the current session. The name is normally associated with a login shell at the time a session is created, and is inherited by all processes descended from the login shell. (This is true even if some of those processes assume another user ID, for example when the su command is used.) The setlogin() function sets the login name of the user associated with the current session to name. This call is restricted to the supe- ruser, and is normally used only when a new session is being created on behalf of the named user (for example, at login time, or when a remote shell is invoked). The getlogin_r() function is the reentrant version of getlogin(). Upon successful completion, the login name is stored in name. RETURN VALUES
Upon successful completion, the getlogin() function returns a pointer to a null-terminated string in a static buffer or a null pointer if the user's login name cannot be found. If getlogin() fails, a null pointer is returned, and errno is set to indicate the error. Upon successful completion, the setlogin() function returns a value of 0 (zero). If setlogin() fails, then a value of -1 is returned and an error code is placed in errno. Upon successful completion, the getlogin_r() function returns a value of 0 (zero). Otherwise, an error number is returned. [Tru64 UNIX] Upon successful completion, the obsolete version of the getlogin_r() function returns a value of 0 (zero). Otherwise, -1 is returned and errno is set to indicate the error. ERRORS
If the getlogin(), getlogin_r(), or setlogin() function fails, errno may be set to one of the following values: [Tru64 UNIX] The name parameter gave an invalid address. [Tru64 UNIX] The name parameter pointed to a string that was too long. [Tru64 UNIX] Login names are limited to 64 characters, as specified by MAXLOGNAME (which is defined in sys/user.h). However, this name limit must be enabled in the kernel at boot time by explicitly setting the generic subsystem's login_name_max attribute to 64. For backward compatibility reasons, 12 is the default value of the login_name_max attribute. An additional value for a setlogin() failure is the following: [Tru64 UNIX] The caller tried to set the login name and was not the supe- ruser. RELATED INFORMATION
Commands: su(1) Functions: setsid(2) Standards: standards(5) delim off getlogin(2)
All times are GMT -4. The time now is 07:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy