LOGIN(3) BSD Library Functions Manual LOGIN(3)NAME
login, logout, logwtmp -- login utility functions (DEPRECATED)
SYNOPSIS
#include <util.h>
void
login(struct utmp *ut);
int
logout(const char *line);
void
logwtmp(const char *line, const char *name, const char *host);
DESCRIPTION
The login(), logout(), and logwtmp() functions are DEPRECATED; use pututxline(3) instead.
These functions operate on the database of current users in /var/run/utmpx and the system log file. Superuser permission is required.
The login() function updates the /var/run/utmpx files with user information contained in ut (after converting to a struct utmpx, as described
in pututxline(3)).
The logout() function removes the entry from /var/run/utmpx corresponding to the device line.
The logwtmp() function adds an entry to the system log file. Since login() will add the appropriate entry during a login, logwtmp() is usu-
ally used for logouts.
RETURN VALUES
logout() returns non-zero if it was able to find and delete an entry for line, and zero if there is no entry for line in /var/run/utmpx.
However, there is no error indication due to lack of permissions.
FILES
/dev/*
/var/run/utmpx
SEE ALSO pututxline(3), utmp(5), utmpx(5)BSD December 14, 1995 BSD
Check Out this Related Man Page
UPDWTMP(3) Linux Programmer's Manual UPDWTMP(3)NAME
updwtmp, logwtmp - append an entry to the wtmp file
SYNOPSIS
#include <utmp.h>
void updwtmp(const char *wtmp_file, const struct utmp *ut);
void logwtmp(const char *line, const char *name, const char *host);
DESCRIPTION
updwtmp() appends the utmp structure ut to the wtmp file.
logwtmp() constructs a utmp structure using line, name, host, current time and current process ID. Then it calls updwtmp() to append the
structure to the wtmp file.
FILES
/var/log/wtmp
database of past user logins
CONFORMING TO
Not in POSIX.1-2001. Present on Solaris, NetBSD, and perhaps other systems.
AVAILABILITY
Both functions are available under glibc2, but not under libc5. However, logwtmp() used to occur in the old libbsd. These days, the
logwtmp() function is included in libutil. (Hence you'll need to add -lutil to your compiler command line to get it.)
NOTES
For consistency with the other "utmpx" functions (see getutxent(3)), glibc provides (since version 2.1):
#include <utmpx.h>
void updwtmpx (const char *wtmpx_file, const struct utmpx *utx);
This function performs the same task as updwtmp(), but differs in that it takes a utmpx structure as its last argument.
SEE ALSO getutxent(3), wtmp(5)COLOPHON
This page is part of release 3.53 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 2008-07-02 UPDWTMP(3)
I would like to automatically logout from the system inactive users depending on their functions.
For example there are users that I would like to logout after 15 minutes of inactivity, but there are others that I would like to logout after 30 minutes of inactivity.
It's possible to do this??? (6 Replies)
hi, Is there any way that I can ask ppl's ID when they wana log out in KDE? I wana know who's the last person who worked with the computer and I need his ID to find it out! (5 Replies)
In sco unix sysyem, we can see the users by suing w. at the idel column we can know how long a user who login the system but do noting.
My question is how can I auto logout such users like above? (6 Replies)
hi all
The "last" command shows the last login time of the user. is there any command for last logout time.
as usual, replies are appreciated. thanks boys.
raguram R (6 Replies)
hai
i want to place every work done by me in a file form login to logout.
ex:-
login : abc
password: xxxx
$pwd
/home/abc
$ls -l
list of files in dir
$logout
now i want to place all commands given by me in a file for later reference. (5 Replies)
I am wondering if solaris captures id's associated w/invalid login attempts?
when I try to login as "test1" several (3-5) times, I do not find any userID info under "/var/adm" files:
utmpx
wtmpx
messages
lastlog
Is there another location/log I should be checking?
Is it necessary for... (6 Replies)
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)
dear all,
I have some problem in my file system :
df -k result :
...
/dev/md/dsk/d3 3101839 2736380 303423 91% /var
...
it occupied around 2.7 gb
but when I tried command
du -sk /var
813991 /var
so /var only have around 800Mb , Do you know why there is many difference... (6 Replies)
Hi
I am using UNIX version.
HP-UX HP-UNIX B.11.00
I am writing a script which on certain condition should logout of unix.
But with exit command i am not able to get this..
Plz suggest how i should logout of the session directly. (9 Replies)
Hi Experts,
This is my input file.
input.txt
0 /dev/fd
25 /var
1 /tmp
1 /var/run
1. If this file has single line, then leave it, print the single line
else
merge the 4 lines above into 1 line as below
e.g (6 Replies)
I am required to develop a script to look for specific strings in the /var/adm/messages file on our Solaris10 host. When an entry is found in the file then I need that line to be piped to a log file. I have a script with the criteria i just need help with the manipulation of the text string.
1.... (6 Replies)
Hi,
Can you please let me know how can and where we will find the logs. ie,which user is login and logout from server and by using which ip address they accessed server.
please let me know the steps and folder, file names to trace the logs from server . we are using System = SunOS 5.10.
Please... (10 Replies)
Hello All,
I am having this issue...where I am actually having hard time understanding the problem:
The code is as follows:
#include<iostream.h>
void fxn(char*** var)
{
int i =4;
*var = (char**)malloc(i*sizeof(char*));
for(int j =0; j<4; j++)
{
*var = "name";
cout<<*var;... (6 Replies)
Hello,
I want to modify the /var/run fs from 86G to say 2G. How to go about it? Thanks.
swap 64G 38K 64G 1% /var/run
Regards.
Edit/Delete Message (6 Replies)
i have four files that have 777 permission
find /var/tttt/ -type f -perm 0777
/var/ttt/1
/var/ttt/2
/var/ttt/3
/var/ttt/4
if any file other than above 4 have 777 permission then move that file to /garbage/yyyy-mmm-dd . Also email me that this have abcd have 777 permission. (6 Replies)