<?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 determine a particular process on a particular box in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-determine-a-particular-process-on-a-particular-box/m-p/2440393#M7146</link>
    <description>Hi Boyd,&lt;BR /&gt;&lt;BR /&gt;Firstly, I don't advise using kill -9 routinely. It pulls the rug from under the feet of the process. So, any locks/semaphores/shared memory etc don't get released.&lt;BR /&gt;&lt;BR /&gt;So, I'd recommend at least changing the kill -9 to kill -1 or kill -15.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 28 Aug 2000 12:17:55 GMT</pubDate>
    <dc:creator>Andy Monks</dc:creator>
    <dc:date>2000-08-28T12:17:55Z</dc:date>
    <item>
      <title>How to determine a particular process on a particular box</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-determine-a-particular-process-on-a-particular-box/m-p/2440389#M7142</link>
      <description>In HP-UX 10.20,&lt;BR /&gt;&lt;BR /&gt;I want a script to kill and restart a process (dtwm, in particular).  My script has the following:&lt;BR /&gt;&lt;BR /&gt;kill -9 `ps -deaf | grep -v grep | grep dtwm | grep $user_x | awk '{print $2}'`&lt;BR /&gt;dtwm &amp;amp;&lt;BR /&gt;&lt;BR /&gt;where $user_x was the one running the script.&lt;BR /&gt;However, when someone tested the script, it failed because that person just happen&lt;BR /&gt;to be logged in the same system but at a different terminal.&lt;BR /&gt;&lt;BR /&gt;How can I revise my script to kill the process that is on the box where they are at?&lt;BR /&gt;&lt;BR /&gt;I don't want the process at some other box killed.  When I do a "ps -deaf" for the&lt;BR /&gt;process the tty is listed as "?".   It's the same for the process on the other box.&lt;BR /&gt;&lt;BR /&gt;Any ideas?&lt;BR /&gt;&lt;BR /&gt;thank you,&lt;BR /&gt;&lt;BR /&gt;Boyd</description>
      <pubDate>Mon, 28 Aug 2000 11:44:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-determine-a-particular-process-on-a-particular-box/m-p/2440389#M7142</guid>
      <dc:creator>Boyd Kodama</dc:creator>
      <dc:date>2000-08-28T11:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to determine a particular process on a particular box</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-determine-a-particular-process-on-a-particular-box/m-p/2440390#M7143</link>
      <description>&lt;BR /&gt;try the who -u command, it matches up a login with the IP address theyre coming from, this should be enough to make your script unique. I thought to restart somebodys window manager (dtwm) you needed to export your DISPLAY variable to their IP anyway ?</description>
      <pubDate>Mon, 28 Aug 2000 12:05:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-determine-a-particular-process-on-a-particular-box/m-p/2440390#M7143</guid>
      <dc:creator>Stefan Farrelly</dc:creator>
      <dc:date>2000-08-28T12:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to determine a particular process on a particular box</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-determine-a-particular-process-on-a-particular-box/m-p/2440391#M7144</link>
      <description>Hi Boyd,&lt;BR /&gt;&lt;BR /&gt;Try using  this:&lt;BR /&gt;ee=`ps -ef|grep dtwm|grep "?"|cut -c2-8`&lt;BR /&gt;kill -9 $ee&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 28 Aug 2000 12:10:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-determine-a-particular-process-on-a-particular-box/m-p/2440391#M7144</guid>
      <dc:creator>CHRIS_ANORUO</dc:creator>
      <dc:date>2000-08-28T12:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to determine a particular process on a particular box</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-determine-a-particular-process-on-a-particular-box/m-p/2440392#M7145</link>
      <description>grep for a process PID and not a user PID.&lt;BR /&gt;&lt;BR /&gt;If the process only runs while a particular user is logged in, run in background so the process keeps running after the user logs out.</description>
      <pubDate>Mon, 28 Aug 2000 12:13:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-determine-a-particular-process-on-a-particular-box/m-p/2440392#M7145</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2000-08-28T12:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to determine a particular process on a particular box</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-determine-a-particular-process-on-a-particular-box/m-p/2440393#M7146</link>
      <description>Hi Boyd,&lt;BR /&gt;&lt;BR /&gt;Firstly, I don't advise using kill -9 routinely. It pulls the rug from under the feet of the process. So, any locks/semaphores/shared memory etc don't get released.&lt;BR /&gt;&lt;BR /&gt;So, I'd recommend at least changing the kill -9 to kill -1 or kill -15.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 28 Aug 2000 12:17:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-determine-a-particular-process-on-a-particular-box/m-p/2440393#M7146</guid>
      <dc:creator>Andy Monks</dc:creator>
      <dc:date>2000-08-28T12:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to determine a particular process on a particular box</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-determine-a-particular-process-on-a-particular-box/m-p/2440394#M7147</link>
      <description>Tried the who -u and the so-called IP address came up as ts044d44.lap-ca.concentric.net.  I am not sure who to determine which&lt;BR /&gt;dtwm would relate to which box give an IP address like this.&lt;BR /&gt;&lt;BR /&gt;By the way, the script is run by the owner of the dtwm.  The script would&lt;BR /&gt;not be killing somebody else's process, i.e. root will not run this script.  I found no need for using $DISPLAY.&lt;BR /&gt;&lt;BR /&gt;Tried the following:&lt;BR /&gt;`ps -ef|grep dtwm|grep "?"|cut -c2-8` &lt;BR /&gt;but that provides the owner of the process.  And since our situation involves a user&lt;BR /&gt;with two dtwm processes and we want only one particular one killed, I don't see&lt;BR /&gt;how this method will help distinguish the one we want killed.&lt;BR /&gt;&lt;BR /&gt;Here's some output after executing `ps -deaf | grep -v grep | grep dtwm | grep tester`:&lt;BR /&gt;&lt;BR /&gt; tester 20367 20248  0 09:12:55 ?         0:01 dtwm&lt;BR /&gt; tester 19219 19143  0 08:33:08 ?         0:07 dtwm&lt;BR /&gt;&lt;BR /&gt;For the idea to "grep for a process PID and not a user PID", I am not sure how grepping for the process PID will help me know which one of these is the right&lt;BR /&gt;one to terminate, unless you had in mind a process other than dtwm.&lt;BR /&gt;&lt;BR /&gt;Yes, using `kill -15` is a better choice than using `kill -9`.&lt;BR /&gt;&lt;BR /&gt;Still looking how to pinpoint the dtwm process to terminate.&lt;BR /&gt;&lt;BR /&gt;thanks,&lt;BR /&gt;&lt;BR /&gt;Boyd</description>
      <pubDate>Mon, 28 Aug 2000 12:50:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-determine-a-particular-process-on-a-particular-box/m-p/2440394#M7147</guid>
      <dc:creator>Boyd Kodama</dc:creator>
      <dc:date>2000-08-28T12:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to determine a particular process on a particular box</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-determine-a-particular-process-on-a-particular-box/m-p/2440395#M7148</link>
      <description>Download and install the lsof program from this link: &lt;A href="http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/lsof-4.48/" target="_blank"&gt;http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/lsof-4.48/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;This program lists all run processes.</description>
      <pubDate>Mon, 28 Aug 2000 13:35:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-determine-a-particular-process-on-a-particular-box/m-p/2440395#M7148</guid>
      <dc:creator>CHRIS_ANORUO</dc:creator>
      <dc:date>2000-08-28T13:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to determine a particular process on a particular box</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-determine-a-particular-process-on-a-particular-box/m-p/2440396#M7149</link>
      <description>&lt;BR /&gt;When a user logs in set a variable in their .profile/.dtprofile  which is their DISPLAY (IP address), if this is from an X session then DISPLAY should be set by default, else use it from who -u. Now that session knows its own IP so later if you need to restart their dtwm process you know which one to kill.</description>
      <pubDate>Mon, 28 Aug 2000 13:47:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-determine-a-particular-process-on-a-particular-box/m-p/2440396#M7149</guid>
      <dc:creator>Stefan Farrelly</dc:creator>
      <dc:date>2000-08-28T13:47:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to determine a particular process on a particular box</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-determine-a-particular-process-on-a-particular-box/m-p/2440397#M7150</link>
      <description>I was finally able to acheive what I wanted with the following script:&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;this_pid=$$&lt;BR /&gt;orig_pid=$$&lt;BR /&gt;command=""&lt;BR /&gt;&lt;BR /&gt;while [ "`basename $command`" != "dtsession" ]&lt;BR /&gt;do&lt;BR /&gt;  ps -ef | awk '( $2 == '"$this_pid"' ) { print $3, $8 }' | read ppid command&lt;BR /&gt;  orig_pid=$this_pid&lt;BR /&gt;  this_pid=$ppid&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;kill -s SIGKILL `ps -ef | awk '( $3 == '"$orig_pid"' &amp;amp;&amp;amp; $8 == "dtwm" ) { print $2 }'`&lt;BR /&gt;&lt;BR /&gt;dtwm &amp;amp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;thanks,</description>
      <pubDate>Mon, 28 Aug 2000 19:52:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-determine-a-particular-process-on-a-particular-box/m-p/2440397#M7150</guid>
      <dc:creator>Boyd Kodama</dc:creator>
      <dc:date>2000-08-28T19:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to determine a particular process on a particular box</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-determine-a-particular-process-on-a-particular-box/m-p/2440398#M7151</link>
      <description>Try using lsof (a public domain tool) to list open files.  Grep for port 6000:&lt;BR /&gt;&lt;BR /&gt;# lsof -u rbeldin  | grep 6000&lt;BR /&gt;dtterm    1869 rbeldin    4u  inet 0x40ef0c68  0t1931356    TCP wallace:49534-&amp;gt;rbeldin3107.atl.hp.com:6000 (ESTABLISHED)&lt;BR /&gt;dtterm    3514 rbeldin    4u  inet 0x40ff6868   0t802704    TCP wallace:61128-&amp;gt;rbeldin3107.atl.hp.com:6000 (ESTABLISHED)&lt;BR /&gt;Xnest     3723 rbeldin    6u  inet 0x40d5b668  0t1533916    TCP wallace:61499-&amp;gt;rbeldin3107.atl.hp.com:6000 (ESTABLISHED)&lt;BR /&gt;</description>
      <pubDate>Wed, 30 Aug 2000 13:05:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-determine-a-particular-process-on-a-particular-box/m-p/2440398#M7151</guid>
      <dc:creator>Rick Beldin</dc:creator>
      <dc:date>2000-08-30T13:05:51Z</dc:date>
    </item>
  </channel>
</rss>

