Solved

killing inactve logons done via tcpip.

Posted on 1997-11-18
5
278 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This is an article about my experiences with remote access to my clients (so that I may serve them) and eventually to my home office system via Radmin Remote Control. I have been using remote access for over 10 years and have been improving my metho…
If you're not part of the solution, you're part of the problem.   Tips on how to secure IoT devices, even the dumbest ones, so they can't be used as part of a DDoS botnet.  Use PRTG Network Monitor as one of the building blocks, to detect unusual…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

749 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