killing inactve logons done via tcpip.

I have inherited responsibility for a SPARC SOLARIS 5.5 system. The problem is simply that of users leaving for the night by shutting down their pc's. Connection to the Unix system is via tcpip In the morning, the users sign on again, and instead of having unique sessions, they are on
twice, or more often.

Can someone refer me to a skeleton script or to the name of a text book whereby the clues as to how to  route the output from the "ps -ef " and "who"  commands  to some script that would eliminate the surplus/hung
logons. Essentially, I want to eliminate users whose sessions have been inactive for a certain amount of time.  Your help would be appreciated.

BTW, with dialup, there is no problem. The user's session is killed.
leslie1Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
ahoffmannConnect With a Mentor Commented:
Use csh, tcsh (or similar) as login shell and set the autologout shell variable to an apropriate time.
0
 
eugene12Commented:
This sounds like it could best be handled by using perl and a cron file. A good book is "teach yourself perl 5 in 21 days" that should allow you to set up the perl script. The cron file will allow this to be done unassisted late at night.
0
 
leslie1Author Commented:
I appreciate the recommendation to look at perl. However, I don't know if perl is even installed on our system. Assume
that our system is vanilla. The only thing we do with it is run MK, a business package from Computer Associates.   CA will support their application, but not unix.
0
 
leslie1Author Commented:
In the VM operating system (which is not unix), there was the
possiblity to stack the output from a command, and then to read the stack.  If I could stack the output of ps -ef, and then pass
it to a shell, my job would be done. Alternatively I could pipe the output from PS to a program which would analyse the output from PS and react accordingly.

Switching shell's is an idea I will explore. However, I am concerned that I should delete only the shell tasks that are started, and not the daughter tasks.
0
 
ahoffmannCommented:
a quick'n dirty check for such users could be:
   ps -ef|awk '($8 ~ /^-/){print}'

Killing the login shell should also kill all its children.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.