02-15-2005
Dead pseudo-ttys
We are having a problem on an AIX 4.3 system, whereby users somehow exit the system in a way such that their process continues to run.
In the who listing, the user may or may not be listed. Processes are still listed in ps, and are still assigned to the pseudo-tty. Processes continue to receive CPU cycles.
One way to detect these orphaned processes is to echo "nothing" to the device, and detect the return code;
echo "\c" > /dev/pts/100 2>/dev/null
if test $? = "1"
then# bogus tty
fi
That can certainly be automated and scripts used to manage the problem, however I am looking for a root cause.
Is it possible that one of the signals has been mapped, and is causing this behavior? Is there some telnetd configuration that can be tweaked, in order to cause these processes to get cleaned up whenever a telnet socket dies?
Any hints or comments will be very appreciated.
Thanks!
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
SCO Unix OpenServer 5
I have this old impact printer that prints invoices, after about 15 pages it becomes misaligned.
ditty -a ttya04 shows -ixon -ixoff -ixany, which is not the right setting..
so, i type
ditty /dev/ttya04 ixon ixoff -ixany
when i ditty -a ttya04 again, the... (2 Replies)
Discussion started by: LowOrderBit
2 Replies
2. Programming
I need to spawn a number of foreground process by reading a configuration file. Each process needs some form of I/O. Hence I need to run it on different terminals.
How it can be done programatically , i.e. , my module needs to find which terminal is not in use, then open it, execute the process... (2 Replies)
Discussion started by: S.P.Prasad
2 Replies
3. SCO
explain differences between a device driver & a pseudo driver...????
thanks in advance (1 Reply)
Discussion started by: areef4u
1 Replies
4. Solaris
Hi I have a system that gave me some messages on bootup that I was not used to seeing:
pseudo: pseudo-device: vol0
genunix: vol0 is /pseudo/vol@0
these came with these:
Feb 13 17:42:17 system1 eri: SUNW,eri0 : 100 Mbps full duplex link up
Feb 13 17:42:21 system1sendmail: My unqualified... (0 Replies)
Discussion started by: mndavies
0 Replies
5. Solaris
Hi all,
what does this mean?
if
then
<something>
fi
here is what i know..
it checks if the specified argument no($devid) in some function call is made into a block device and then proceeds with the execution of the loop.
However am not understand what lofi@0:means?
also is there... (3 Replies)
Discussion started by: wrapster
3 Replies
6. UNIX for Advanced & Expert Users
Hi All,
I have putty on my system (Vista). I need some server details to login via internet for my personnel practice. Can any body help me out.
In case this not feasible, just let me know any other way to work with UNIX terminal on Windows Vista itself.
Please help me since i am desparately... (3 Replies)
Discussion started by: vikas_kesarwani
3 Replies
7. UNIX for Dummies Questions & Answers
Sometimes when I open up the terminal (like just now) it says
Last login: Wed Jun 17 07:29:25 on console
sometimes it says ttys (like when I exit and open a new window/tab). What's the difference? and is something fishy going on? (6 Replies)
Discussion started by: Straitsfan
6 Replies
8. AIX
I have several users connecting via a Windows-based SSH\telnet client. The previous sysadmin used FacetTerm to allow certain users to switch between multiple "windows." I'm told there are AIX-native ways to do this but I work with what I inherited.
Originally, many users were still connecting... (3 Replies)
Discussion started by: lacroix
3 Replies
9. UNIX for Dummies Questions & Answers
How can i view what my colleague is doing in the terminal pts/1 while i have logged into terminal pts/2 ?? Both have remotely logged in via ssh. (4 Replies)
Discussion started by: proactiveaditya
4 Replies
10. Solaris
sometimes I see this message in dmesg:
what does it mean?
thanks. (5 Replies)
Discussion started by: orange47
5 Replies
LEARN ABOUT MOJAVE
login_tty
OPENPTY(3) BSD Library Functions Manual OPENPTY(3)
NAME
openpty, login_tty, forkpty -- tty utility functions
SYNOPSIS
#include <util.h>
int
openpty(int *amaster, int *aslave, char *name, struct termios *termp, struct winsize *winp);
int
login_tty(int fd);
pid_t
forkpty(int *amaster, char *name, struct termios *termp, struct winsize *winp);
DESCRIPTION
The openpty(), login_tty(), and forkpty() functions perform manipulations on ttys and pseudo-ttys.
The openpty() function allocates a pseudo-tty and returns file descriptors for the master and slave in amaster and aslave. If name is non-
null, the filename of the slave is returned in name. If termp is non-null, the terminal parameters of the slave will be set to the values in
termp. If winp is non-null, the window size of the slave will be set to the values in winp.
The login_tty() function prepares for a login on the tty fd (which may be a real tty device, or the slave of a pseudo-tty as returned by
openpty()) by creating a new session, making fd the controlling terminal for the current process, setting fd to be the standard input, out-
put, and error streams of the current process, and closing fd.
The forkpty() function combines openpty(), fork(), and login_tty() to creates a new process operating in a pseudo-tty. The file descriptor
of the master side of the pseudo-tty is returned in amaster, and the filename of the slave in name if it is non-null. The termp and winp
parameters, if non-null, will determine the terminal attributes and window size of the slave side of the pseudo-tty.
RETURN VALUES
If a call to openpty(), login_tty(), or forkpty() is not successful, -1 is returned and errno is set to indicate the error. Otherwise,
openpty(), login_tty(), and the child process of forkpty() return 0, and the parent process of forkpty() returns the process ID of the child
process.
ERRORS
openpty() will fail if:
[EAGAIN] There are no available pseudo-ttys.
login_tty() will fail if ioctl() fails to set fd to the controlling terminal of the current process. forkpty() will fail if either openpty()
or fork() fails.
FILES
/dev/ptmx cloning pseudo-tty device
/dev/ttys[0-9][0-9][0-9] slave pseudo-tty devices
SEE ALSO
fork(2)
BSD
April 5, 2008 BSD