<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Kill pts? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212528#M571024</link>
    <description>ps -u"user_name"&lt;BR /&gt;&lt;BR /&gt;Then kill all processes.</description>
    <pubDate>Mon, 08 Mar 2004 14:58:45 GMT</pubDate>
    <dc:creator>RAC_1</dc:creator>
    <dc:date>2004-03-08T14:58:45Z</dc:date>
    <item>
      <title>Kill pts?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212525#M571021</link>
      <description>All,&lt;BR /&gt;&lt;BR /&gt;    I have searched the entire forum and internet looking for a solution to a serious problem we have.&lt;BR /&gt;&lt;BR /&gt;Situation:&lt;BR /&gt;    A user at a remote location starts 3 telnet sessions, and that user is only authorized to have 3 sessions.  The frame relay circuit dies for whatever reason, then comes back online.  When the user tries to log back into the system (RP8400, HP-UX 11.11), the system still thinks the user has 3 open sessions.  Due to the circuit outage, the pts session wasn't closed out properly.&lt;BR /&gt;&lt;BR /&gt;    The only way I have found to clear these "dead" pts sessions is to reboot the server.  Does anyone have a better solution?  Authorizing more telnet sessions is not a valid answer for security and performance issues.&lt;BR /&gt;&lt;BR /&gt;D</description>
      <pubDate>Mon, 08 Mar 2004 14:42:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212525#M571021</guid>
      <dc:creator>Dwyane Everts_1</dc:creator>
      <dc:date>2004-03-08T14:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: Kill pts?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212526#M571022</link>
      <description># ps -ef | grep username&lt;BR /&gt;&lt;BR /&gt;Note the PIDs of the processes&lt;BR /&gt;&lt;BR /&gt;# kill list_of_PIDs&lt;BR /&gt;&lt;BR /&gt;Use 'kill' with NO ARGUMENTS first.  That should clean up anything left hanging.  Note that this may not perform any application cleanup that is necessary.</description>
      <pubDate>Mon, 08 Mar 2004 14:50:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212526#M571022</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2004-03-08T14:50:53Z</dc:date>
    </item>
    <item>
      <title>Re: Kill pts?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212527#M571023</link>
      <description>Patrick,&lt;BR /&gt;&lt;BR /&gt;I have tried to kill the the PIDs associated with the pts sessions.  The problem is, the system tells me that the PIDs don't exist; even though they are listed next to the pts.&lt;BR /&gt;&lt;BR /&gt;D</description>
      <pubDate>Mon, 08 Mar 2004 14:54:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212527#M571023</guid>
      <dc:creator>Dwyane Everts_1</dc:creator>
      <dc:date>2004-03-08T14:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: Kill pts?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212528#M571024</link>
      <description>ps -u"user_name"&lt;BR /&gt;&lt;BR /&gt;Then kill all processes.</description>
      <pubDate>Mon, 08 Mar 2004 14:58:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212528#M571024</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2004-03-08T14:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: Kill pts?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212529#M571025</link>
      <description>I guess I need to explain myself a bit more....&lt;BR /&gt;&lt;BR /&gt;If I type "who -a | grep &lt;USERID_IN_QUESTION&gt;," I will see 3 open sessions with associated pts and PIDs.  If I then type "ps -ef | grep &lt;USERID_IN_QUESTION&gt;," I will not see the user running any processes on the system.&lt;BR /&gt;&lt;BR /&gt;I thought maybe this was a corrupted "utmp" issue, but even by clearing the "utmp" the issue remains.&lt;BR /&gt;&lt;BR /&gt;D&lt;/USERID_IN_QUESTION&gt;&lt;/USERID_IN_QUESTION&gt;</description>
      <pubDate>Mon, 08 Mar 2004 15:03:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212529#M571025</guid>
      <dc:creator>Dwyane Everts_1</dc:creator>
      <dc:date>2004-03-08T15:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: Kill pts?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212530#M571026</link>
      <description>What about adding a auto logout for idle time? &lt;BR /&gt;&lt;BR /&gt;Add (15 minutes):&lt;BR /&gt;&lt;BR /&gt;TMOUT=900&lt;BR /&gt;&lt;BR /&gt;to user's .profile - or for all users, add to /etc/profile&lt;BR /&gt;&lt;BR /&gt;If they use csh, then I believe the parameter is:&lt;BR /&gt;&lt;BR /&gt;autologout&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 08 Mar 2004 15:04:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212530#M571026</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2004-03-08T15:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: Kill pts?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212531#M571027</link>
      <description>I will test "TMOUT."  Under the circumstances, I'm not sure if that will work since the system in one respect thinks the user is logged out, but in another respect thinks the user is still logged in.&lt;BR /&gt;&lt;BR /&gt;D</description>
      <pubDate>Mon, 08 Mar 2004 15:10:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212531#M571027</guid>
      <dc:creator>Dwyane Everts_1</dc:creator>
      <dc:date>2004-03-08T15:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: Kill pts?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212532#M571028</link>
      <description>While I took the information that you have here , I went to the executive meditation facility (center stall) and thought you might be able to do this in a more elegant way by closing the sockets opened on the HP box.&lt;BR /&gt;&lt;BR /&gt;It would take the port (easy enought to find and the socket number). Then do a reopen and a close and it might just clean up your problem...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Tim&lt;BR /&gt;</description>
      <pubDate>Mon, 08 Mar 2004 16:55:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212532#M571028</guid>
      <dc:creator>Tim Sanko</dc:creator>
      <dc:date>2004-03-08T16:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: Kill pts?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212533#M571029</link>
      <description>Does a TCP/IP connection exist for these orphans?  (Do you see the connection still in &lt;BR /&gt;netstat -an | grep 23&lt;BR /&gt; ?)&lt;BR /&gt;&lt;BR /&gt;Does &lt;BR /&gt;who -T&lt;BR /&gt;show anything funny about the status of the process?&lt;BR /&gt;&lt;BR /&gt;Don't know if it will work on HPUX but:&lt;BR /&gt;&lt;BR /&gt;"cwtmp" &lt;A href="ftp://ftp.armory.com/pub/scobins/cwtmp" target="_blank"&gt;ftp://ftp.armory.com/pub/scobins/cwtmp&lt;/A&gt; is a freely &lt;BR /&gt;available utility that clears stale logins.&lt;BR /&gt;&lt;BR /&gt;Just tried the link and it works.  Haven't tried the program.  Think it needs to be compiled.  &lt;BR /&gt;&lt;BR /&gt;cwtmp.tar.gz     16KB Clean up utmp &amp;amp; wtmp files (discard entries; fix corruption).    2003-Jan-15&lt;BR /&gt;&lt;BR /&gt;Ron&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 08 Mar 2004 18:20:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212533#M571029</guid>
      <dc:creator>Ron Kinner</dc:creator>
      <dc:date>2004-03-08T18:20:21Z</dc:date>
    </item>
    <item>
      <title>Re: Kill pts?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212534#M571030</link>
      <description>You might also want to take a look at some of the ndd parameters.  Specifically I think the tcp_keepalive_timer may apply.  The default setting for this is 2 hours I think.  You might try setting it down to 15 minutes or so.&lt;BR /&gt;&lt;BR /&gt;Do a 'man ndd' for more info.</description>
      <pubDate>Mon, 08 Mar 2004 18:50:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212534#M571030</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2004-03-08T18:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: Kill pts?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212535#M571031</link>
      <description>All,&lt;BR /&gt;&lt;BR /&gt;    I'm going to do my best to relpy to each of you...&lt;BR /&gt;&lt;BR /&gt;Geoff W. - I tried the "TMOUT," that doesn't fix the problem :(&lt;BR /&gt;&lt;BR /&gt;Tim S. - Firstly, thanks for the mental picture, now I need help from a shrink :)  Secondly, the ports/sockets for these sessions no longer exist.  So, I can't kill them :(&lt;BR /&gt;&lt;BR /&gt;Ron K. - As mentioned to Tim S., the tcp/port/socket was terminated.  "who -T" shows the session as terminated also. (I'll have to look into "cwtmp.")&lt;BR /&gt;&lt;BR /&gt;Patrick W. - The tcp_keepalive_timer might work.  I assume this variable is set in the /etc/rc.config.d/nddconf file?  Although, if "TMOUT" doesn't work, why might this?&lt;BR /&gt;&lt;BR /&gt;All - it appears the tcp session is definitely closed out, but the OS from a "who" stand point is still logged in.  Does anyone have any further suggestions?&lt;BR /&gt;&lt;BR /&gt;D</description>
      <pubDate>Tue, 09 Mar 2004 07:21:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212535#M571031</guid>
      <dc:creator>Dwyane Everts_1</dc:creator>
      <dc:date>2004-03-09T07:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: Kill pts?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212536#M571032</link>
      <description>Yes, change the way you determine how many times a user is logged on.&lt;BR /&gt; &lt;BR /&gt;Instead of checking the output of "who" try doing something with "ps" or even incrementing a number you store to a file when you log in and decrementing it when a user logs out.  That way, at least you get just change the number to 0 if a user can't log in again.</description>
      <pubDate>Tue, 09 Mar 2004 07:36:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212536#M571032</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2004-03-09T07:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: Kill pts?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212537#M571033</link>
      <description>Mark,&lt;BR /&gt;&lt;BR /&gt;   I have been thinking about (and testing) a new way of determining how many login seesions a user actually has.  This will certainly fix the immediate problem, but not the root cause.  Thanks for the input.&lt;BR /&gt;&lt;BR /&gt;D</description>
      <pubDate>Tue, 09 Mar 2004 07:41:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212537#M571033</guid>
      <dc:creator>Dwyane Everts_1</dc:creator>
      <dc:date>2004-03-09T07:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: Kill pts?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212538#M571034</link>
      <description>All,&lt;BR /&gt;&lt;BR /&gt;Mark brought up a very good point.  Here is the entry in each .profile that determines the number of times a user is logged in:&lt;BR /&gt;&lt;BR /&gt;UNUM="$(who|/usr/bin/grep $LOGNAME|wc -l)"&lt;BR /&gt;if [ "$UNUM" -gt 4 ]&lt;BR /&gt;   then&lt;BR /&gt;         echo "\n You are logged in more than" $UNUM "times\n "&lt;BR /&gt;         echo "\n You can not login more than 4 times\n "&lt;BR /&gt;&lt;BR /&gt;        sleep 5&lt;BR /&gt;        exit&lt;BR /&gt;   else&lt;BR /&gt;        exec   &lt;APP name=""&gt;&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;As you can see, I don't allow users to log in to a command prompt :)  Instead, an application is immediately started.  If anyone can think of a better way....?&lt;BR /&gt;&lt;BR /&gt;D&lt;/APP&gt;</description>
      <pubDate>Tue, 09 Mar 2004 07:46:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212538#M571034</guid>
      <dc:creator>Dwyane Everts_1</dc:creator>
      <dc:date>2004-03-09T07:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: Kill pts?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212539#M571035</link>
      <description>Well, if you are able to use "who"&lt;BR /&gt; &lt;BR /&gt;[ `who | grep $LOGNAME | wc -l` -gt 3 ] &amp;amp;&amp;amp; echo "Logged in too many times" &amp;amp;&amp;amp; exit&lt;BR /&gt; &lt;BR /&gt;Will do it, but trying the increment/decrement file approach.  In .profile&lt;BR /&gt;&lt;BR /&gt;count=0 # Stop test complaining first time we use this&lt;BR /&gt; &lt;BR /&gt;count=`cat .loginfile 2&amp;gt;/dev/null`&lt;BR /&gt;[ $count -gt 3 ] &amp;amp;&amp;amp; echo "Too keen!" &amp;amp;&amp;amp; exit&lt;BR /&gt;count=`expr $count + 1`&lt;BR /&gt;echo $count &amp;gt; .loginfile&lt;BR /&gt; &lt;BR /&gt;# blah &lt;BR /&gt;&lt;BR /&gt;# Run your application here&lt;BR /&gt;myapplication&lt;BR /&gt; &lt;BR /&gt;count=`cat .loginfile`&lt;BR /&gt;count=`expr $count - 1`&lt;BR /&gt;echo $count &amp;gt; .loginfile&lt;BR /&gt;exit&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;Looks a bit horrid doesn't it.&lt;BR /&gt; &lt;BR /&gt;Or perhaps&lt;BR /&gt; &lt;BR /&gt;[ `ps -ef | grep $LOGNAME | grep "\-sh" | grep -v grep` -gt 3 ] &amp;amp;&amp;amp; echo "Nope sorry" &amp;amp;&amp;amp; exit&lt;BR /&gt; &lt;BR /&gt;Will do it for you as "-sh" is login shells</description>
      <pubDate>Tue, 09 Mar 2004 08:16:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212539#M571035</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2004-03-09T08:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: Kill pts?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212540#M571036</link>
      <description>Mark,&lt;BR /&gt;&lt;BR /&gt;I was actually in the process of testing your second option.  And I have a new "if" statement that will work.  Thanks again!&lt;BR /&gt;&lt;BR /&gt;Does anyone have any more ideas on how to solve the root issue?&lt;BR /&gt;&lt;BR /&gt;D</description>
      <pubDate>Tue, 09 Mar 2004 08:26:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212540#M571036</guid>
      <dc:creator>Dwyane Everts_1</dc:creator>
      <dc:date>2004-03-09T08:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: Kill pts?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212541#M571037</link>
      <description>I think Patrick has the right idea with reducing tcp_keepalive_interval.&lt;BR /&gt;&lt;BR /&gt;TMOUT will just affect shell sessions that are idle for long periods of time. &lt;BR /&gt;&lt;BR /&gt;tcp_keepalive_interval controls the interval between when TCP connections are verified.  Reducing it to a few minutes will allow the disconnect to be discovered sooner and to release the port at that time to allow its reuse. &lt;BR /&gt;&lt;BR /&gt;good luck&lt;BR /&gt;fwc</description>
      <pubDate>Tue, 09 Mar 2004 09:14:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212541#M571037</guid>
      <dc:creator>Floyd Curtis</dc:creator>
      <dc:date>2004-03-09T09:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: Kill pts?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212542#M571038</link>
      <description>Floyd,&lt;BR /&gt;&lt;BR /&gt;I have looked into changing this parameter; but I'm being this issue is related to the "wtmp" file getting corrupted by the "unclean" disconnect.  Any ideas how to uncorrupt the "wtmp" file without a reboot?&lt;BR /&gt;&lt;BR /&gt;D</description>
      <pubDate>Tue, 09 Mar 2004 09:20:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212542#M571038</guid>
      <dc:creator>Dwyane Everts_1</dc:creator>
      <dc:date>2004-03-09T09:20:01Z</dc:date>
    </item>
    <item>
      <title>Re: Kill pts?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212543#M571039</link>
      <description>fwtmp can take care of corrupt wtmp file.&lt;BR /&gt;But I think, you need some code/program that will take care of ressting login count when frame relay dies, and when user comes back after frame relay comes up. So TMOUT and reducing TCP_Keepalive_interval should take care of your problem.&lt;BR /&gt;&lt;BR /&gt;Anil</description>
      <pubDate>Tue, 09 Mar 2004 09:32:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212543#M571039</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2004-03-09T09:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: Kill pts?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212544#M571040</link>
      <description>What is the period between frame relay dies and when it comes back again?&lt;BR /&gt;&lt;BR /&gt;What I am thinking is restrict user logins to 3 as you want, then if user comes for the forth time, I will check what all process are owned by pervious three logins sessions. Kill them and allow 4th login. Here I assume that the user comes back for the fourth time because of frame relay problem. Also is there any way to monitoe the frame relay from hp-ux box? IF yes we can do something here.&lt;BR /&gt;&lt;BR /&gt;Anil</description>
      <pubDate>Tue, 09 Mar 2004 09:45:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-pts/m-p/3212544#M571040</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2004-03-09T09:45:35Z</dc:date>
    </item>
  </channel>
</rss>

