<?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: how to kill users in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-users/m-p/3262326#M177232</link>
    <description>you should probably just use a kill as opposed to a kill -9. Keep track of those you can't get rid of with a kill and then use a kill -9.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 28 Apr 2004 23:37:20 GMT</pubDate>
    <dc:creator>Scott Van Kalken</dc:creator>
    <dc:date>2004-04-28T23:37:20Z</dc:date>
    <item>
      <title>how to kill users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-users/m-p/3262323#M177229</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Our ERP clients connects server using telnet over the WAN. If in between connection drops user session hungs inbetween.&lt;BR /&gt;&lt;BR /&gt;How can I schedule that system should check the users who are inactive from last 30 or more minutes and kill that ID's automatically.&lt;BR /&gt;&lt;BR /&gt;HP Unix version is 11i.</description>
      <pubDate>Wed, 28 Apr 2004 23:21:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-users/m-p/3262323#M177229</guid>
      <dc:creator>Rajesh_47</dc:creator>
      <dc:date>2004-04-28T23:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to kill users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-users/m-p/3262324#M177230</link>
      <description>You can write a scirpt for this..i can give some guide lines for the same.&lt;BR /&gt;1. # w &lt;BR /&gt;this output will give who all are logged in.&lt;BR /&gt;2. # cut &lt;BR /&gt;Use this command to get Value of Idle field from the ouput&lt;BR /&gt;3. Repeat same to get ttty no of the same.&lt;BR /&gt;4. # ps -t &lt;TTY no.=""&gt;&lt;BR /&gt;This will list all the processes fo that user with PID&lt;BR /&gt;5. # kill -9 &lt;PID&gt;&lt;BR /&gt;Kill all processes using this along with shell process for that particular user and your user is logged out.&lt;BR /&gt;&lt;BR /&gt;Hope this helps you&lt;BR /&gt;&lt;/PID&gt;&lt;/TTY&gt;</description>
      <pubDate>Wed, 28 Apr 2004 23:28:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-users/m-p/3262324#M177230</guid>
      <dc:creator>Bharat Katkar</dc:creator>
      <dc:date>2004-04-28T23:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: how to kill users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-users/m-p/3262325#M177231</link>
      <description>I forgot one last thing about scheduling.&lt;BR /&gt;# crontab -e &lt;BR /&gt;Use this command to put your shell script in CRON for scheduling its execution.&lt;BR /&gt;&lt;BR /&gt;see man cut, man ps, man contab if required.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 28 Apr 2004 23:31:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-users/m-p/3262325#M177231</guid>
      <dc:creator>Bharat Katkar</dc:creator>
      <dc:date>2004-04-28T23:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: how to kill users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-users/m-p/3262326#M177232</link>
      <description>you should probably just use a kill as opposed to a kill -9. Keep track of those you can't get rid of with a kill and then use a kill -9.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 28 Apr 2004 23:37:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-users/m-p/3262326#M177232</guid>
      <dc:creator>Scott Van Kalken</dc:creator>
      <dc:date>2004-04-28T23:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to kill users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-users/m-p/3262327#M177233</link>
      <description>"how to kill users" !?&lt;BR /&gt;&lt;BR /&gt;Maybe you're in the wrong forum ;-)&lt;BR /&gt;&lt;BR /&gt;Perhaps you can set TMOUT=1800 in /etc/profile (look in manpage of sh or ksh).</description>
      <pubDate>Thu, 29 Apr 2004 02:03:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-users/m-p/3262327#M177233</guid>
      <dc:creator>hein coulier</dc:creator>
      <dc:date>2004-04-29T02:03:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to kill users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-users/m-p/3262328#M177234</link>
      <description>You can add the var TMOUT to the users .profile (or the /etc/profile for system wide effect) and set to the # of seconds the usr may remain idle before being logged out: ie&lt;BR /&gt;&lt;BR /&gt;TMOUT=300     # Time out in 5 minutes&lt;BR /&gt;export TMOUT&lt;BR /&gt;&lt;BR /&gt;Unfortunatlly, I think this only works if the user is truly idle.  If they are running a menu program or editor or some such thing, even though they may not be doing any I/O, I don't think they will be logged out, but I could be wrong.</description>
      <pubDate>Fri, 30 Apr 2004 07:38:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-users/m-p/3262328#M177234</guid>
      <dc:creator>Robert True</dc:creator>
      <dc:date>2004-04-30T07:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to kill users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-users/m-p/3262329#M177235</link>
      <description>As mentioned, kill -9 is a very bad thing to do. This is especially true for processes that keep multiple open files and the data in the files must be synchronized. kill -9 must be a *LAST* resort. Use kill -15 (or just plain kill). Note that you must kill the top-level parent, typically the login shell. From the w command, you will see the tty device so you can find all the processes associated with a specific login by using:&lt;BR /&gt; &lt;BR /&gt;ps -ft pts/ta&lt;BR /&gt; &lt;BR /&gt;where pts/ta (or perhaps ttyr3) is the tty device mentioned in w. The login shell will always end with a - as in: sh- or ksh- and that is the process to kill. If you use w -l, then you'll get the top-level process as the last field. To extract the last process name, you'll have to use awk's NF value since the number of fields in w variesd because of null information.&lt;BR /&gt; &lt;BR /&gt;Be very careful with testing your shell script: always exclude root since you may kill an important process someone is running, and also be careful that a particular process that someone may be running should not be killed...that is application dependent.&lt;BR /&gt; &lt;BR /&gt;As mentioned, TMOUT can be used to expire the shell, but only is the shell is running. If a user runs a process like vi, vi will never terminate if the user walks away and the shell will never run.</description>
      <pubDate>Fri, 30 Apr 2004 08:04:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-users/m-p/3262329#M177235</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2004-04-30T08:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: how to kill users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-users/m-p/3262330#M177236</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;If you are using database then you must first kill the process involved in that. First kill from database end and then kill from unix end. Though kill -9 is not recommended first, you first choose -15 option and then -9. Here is the script which can help you.This scrip will kill users who are idle since 30 to 59 minutes. Keep it in cron or run manually.&lt;BR /&gt;&lt;BR /&gt;who -u |grep query| cut -c 1-10,39-50| grep -e "[0]:[30-59]"  &amp;gt; current &lt;BR /&gt;for i in `cat current | awk '{print &lt;BR /&gt;$3}'`                          &lt;BR /&gt;do                                          &lt;BR /&gt;kill -15 $i&lt;BR /&gt;kill -9 $i&lt;BR /&gt;$i                           &lt;BR /&gt;done                                                               &lt;BR /&gt;Rgds&lt;BR /&gt;Tapas</description>
      <pubDate>Fri, 30 Apr 2004 08:27:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-users/m-p/3262330#M177236</guid>
      <dc:creator>Tapas Jha</dc:creator>
      <dc:date>2004-04-30T08:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: how to kill users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-users/m-p/3262331#M177237</link>
      <description>I have long used a c program that walks the tree and trys nice kills waits a short time then tries a meaner  kill until the -9  &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;But I have thought that is worth discussing.&lt;BR /&gt;who -tu has the following output:&lt;BR /&gt;rory       pts/3        Apr 30 08:41  1:33  18310  rrhammond:0.0&lt;BR /&gt;&lt;BR /&gt;fuser -uk /dev/pts/3&lt;BR /&gt;&lt;BR /&gt;kills all of the process associated with that login.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 30 Apr 2004 16:30:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-users/m-p/3262331#M177237</guid>
      <dc:creator>Rory R Hammond</dc:creator>
      <dc:date>2004-04-30T16:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: how to kill users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-users/m-p/3262332#M177238</link>
      <description>Rajesh,&lt;BR /&gt;&lt;BR /&gt;KIll -9 pid is vary bad practice, and will certainly leave accounting connections open if you use the w command.&lt;BR /&gt;&lt;BR /&gt;Kill -15 pid is the better option and more tidy!&lt;BR /&gt;&lt;BR /&gt;TMOUT in the profile sounds good for shell sessions but not always practical for db applications that may want the db connection closing in a more desirable method.&lt;BR /&gt;&lt;BR /&gt;The best method for accuracy &amp;amp; control is to perform the kill manually, unfortunately this can be laborious and not the answer you are looking for.&lt;BR /&gt;&lt;BR /&gt;Keith</description>
      <pubDate>Sat, 01 May 2004 02:24:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-users/m-p/3262332#M177238</guid>
      <dc:creator>Keith Bevan_1</dc:creator>
      <dc:date>2004-05-01T02:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: how to kill users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-users/m-p/3262333#M177239</link>
      <description>Dear All,&lt;BR /&gt;&lt;BR /&gt;Thanx for your response to my query. I got the perfect ans for my query. I want to share it with you. I am using the following command to kill users who are ideal.&lt;BR /&gt;&lt;BR /&gt;/usr/bin/who -u | /usr/bin/awk '{print $6" "$7}' | /usr/bin/grep 0:[345] | /usr/bin/awk '{print "/usr/bin/kill -9 "$2}' | usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Rajesh</description>
      <pubDate>Sun, 02 May 2004 21:40:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-users/m-p/3262333#M177239</guid>
      <dc:creator>Rajesh_47</dc:creator>
      <dc:date>2004-05-02T21:40:28Z</dc:date>
    </item>
  </channel>
</rss>

