Solved

killing inactve logons done via tcpip.

Posted on 1997-11-18
5
276 Views
Last Modified: 2013-12-23
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.
0
Comment
Question by:leslie1
  • 2
  • 2
5 Comments
 

Expert Comment

by:eugene12
ID: 1582990
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
 

Author Comment

by:leslie1
ID: 1582991
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
 
LVL 51

Accepted Solution

by:
ahoffmann earned 100 total points
ID: 1582992
Use csh, tcsh (or similar) as login shell and set the autologout shell variable to an apropriate time.
0
 

Author Comment

by:leslie1
ID: 1582993
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
 
LVL 51

Expert Comment

by:ahoffmann
ID: 1582994
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

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

#Citrix #Citrix Netscaler #HTTP Compression #Load Balance
Let’s list some of the technologies that enable smooth teleworking. 
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question