<?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: control the process in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627100#M236809</link>
    <description>thx Alessandro Pilati ,&lt;BR /&gt;&lt;BR /&gt;your solution is work perfect , but I want to have one more requirement , your script will kill the process with block letter D , but I may be change the process name to other name like "Deve" instead of "oracle" later , so it seems not suit for me . if I want to check the status column , if it is not D , then kill it , how to do it ? thx</description>
    <pubDate>Thu, 15 Sep 2005 11:31:54 GMT</pubDate>
    <dc:creator>peterchu</dc:creator>
    <dc:date>2005-09-15T11:31:54Z</dc:date>
    <item>
      <title>control the process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627097#M236806</link>
      <description>I use "ps -auf" to check there are many process in the unix system , I want to kill all the process that its process name are "orcale" and the process status is not "D" , like the below process ( the process status is "S" )  , could suggest the method / script ? thx&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;root     15757  0.0  0.0  2352 1196 ?        S    17:47   0:00 login -- orcale</description>
      <pubDate>Thu, 15 Sep 2005 10:44:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627097#M236806</guid>
      <dc:creator>peterchu</dc:creator>
      <dc:date>2005-09-15T10:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: control the process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627098#M236807</link>
      <description>Try this 1-line command:&lt;BR /&gt;ps -efl|grep "oracle"|awk '{print $2" "$4}'|grep -v ^D|awk '{ print $2 }'|xargs kill -9&lt;BR /&gt;&lt;BR /&gt;You wrote "orcale", I guess you mean "oracle"...&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Alex</description>
      <pubDate>Thu, 15 Sep 2005 11:03:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627098#M236807</guid>
      <dc:creator>Alessandro Pilati</dc:creator>
      <dc:date>2005-09-15T11:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: control the process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627099#M236808</link>
      <description>What release are you running?  When I try, it get:&lt;BR /&gt;&lt;BR /&gt;$ ps -auf&lt;BR /&gt;ps: unknown user f&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Thu, 15 Sep 2005 11:05:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627099#M236808</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2005-09-15T11:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: control the process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627100#M236809</link>
      <description>thx Alessandro Pilati ,&lt;BR /&gt;&lt;BR /&gt;your solution is work perfect , but I want to have one more requirement , your script will kill the process with block letter D , but I may be change the process name to other name like "Deve" instead of "oracle" later , so it seems not suit for me . if I want to check the status column , if it is not D , then kill it , how to do it ? thx</description>
      <pubDate>Thu, 15 Sep 2005 11:31:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627100#M236809</guid>
      <dc:creator>peterchu</dc:creator>
      <dc:date>2005-09-15T11:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: control the process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627101#M236810</link>
      <description>Peter,&lt;BR /&gt;if I understood your question rightly...&lt;BR /&gt;substitute to the command the word "oracle" with the word "Dave"...&lt;BR /&gt;&lt;BR /&gt;Alex&lt;BR /&gt;</description>
      <pubDate>Thu, 15 Sep 2005 11:34:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627101#M236810</guid>
      <dc:creator>Alessandro Pilati</dc:creator>
      <dc:date>2005-09-15T11:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: control the process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627102#M236811</link>
      <description>Peter,&lt;BR /&gt;do you mean process name = oracle or process userid = oracle ?&lt;BR /&gt;</description>
      <pubDate>Thu, 15 Sep 2005 11:37:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627102#M236811</guid>
      <dc:creator>Alessandro Pilati</dc:creator>
      <dc:date>2005-09-15T11:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: control the process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627103#M236812</link>
      <description>thx again,&lt;BR /&gt;&lt;BR /&gt;Actually , I will use multi process name in the script , include "oracle" , "Deve" and many many others , so I think it is more accurate if check the process status process . thx</description>
      <pubDate>Thu, 15 Sep 2005 11:47:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627103#M236812</guid>
      <dc:creator>peterchu</dc:creator>
      <dc:date>2005-09-15T11:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: control the process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627104#M236813</link>
      <description>If you can get the list of names,&lt;BR /&gt;you can make a while cicle where you launch the command above, substituiting &lt;BR /&gt;grep "oracle"&lt;BR /&gt;with&lt;BR /&gt;grep $name&lt;BR /&gt;&lt;BR /&gt;where $name is the cycled variable containing your process names...&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;Alessandro</description>
      <pubDate>Thu, 15 Sep 2005 12:02:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627104#M236813</guid>
      <dc:creator>Alessandro Pilati</dc:creator>
      <dc:date>2005-09-15T12:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: control the process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627105#M236814</link>
      <description>thx Alessandro Pilati  again,&lt;BR /&gt;&lt;BR /&gt;I am not too understand what is the suggestion , if I simply want to check the status column , could suggest what can I do ? thx</description>
      <pubDate>Thu, 15 Sep 2005 12:05:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627105#M236814</guid>
      <dc:creator>peterchu</dc:creator>
      <dc:date>2005-09-15T12:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: control the process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627106#M236815</link>
      <description>Hi peterchu,&lt;BR /&gt;I think the solution of pilati itlsef can be modified to get what you are looking for as:&lt;BR /&gt;&lt;BR /&gt;ps -efl|grep "oracle"|grep -v " D " | awk '{print $2" "$4}'|grep -v ^D|awk '{ print $2 }'|xargs kill -9&lt;BR /&gt;&lt;BR /&gt;Hope that helps.&lt;BR /&gt;Regards,&lt;BR /&gt;</description>
      <pubDate>Thu, 15 Sep 2005 12:16:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627106#M236815</guid>
      <dc:creator>Bharat Katkar</dc:creator>
      <dc:date>2005-09-15T12:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: control the process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627107#M236816</link>
      <description>sorry ignore the earlier one.&lt;BR /&gt;I think it should be like this:&lt;BR /&gt;&lt;BR /&gt;# ps -efl|grep "oracle"|grep -v " D " | awk '{print $2" "$4}'|awk '{ print $2 }'|xargs kill -9&lt;BR /&gt;&lt;BR /&gt;Trailing and leading spaces for letter D should help you ignore those process. This may not work if your process name itself is D.&lt;BR /&gt;Also instead of 'grep "oracle"' you can use 'grep $process_name' and then set this variable according to your requirement.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;</description>
      <pubDate>Thu, 15 Sep 2005 12:22:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627107#M236816</guid>
      <dc:creator>Bharat Katkar</dc:creator>
      <dc:date>2005-09-15T12:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: control the process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627108#M236817</link>
      <description>thx Bharat Katkar  ,&lt;BR /&gt;&lt;BR /&gt;it seems exclude the process that its name contains "D" , is it possible to meet my above requirement ? pls advise ? thx&lt;BR /&gt;</description>
      <pubDate>Thu, 15 Sep 2005 12:27:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627108#M236817</guid>
      <dc:creator>peterchu</dc:creator>
      <dc:date>2005-09-15T12:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: control the process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627109#M236818</link>
      <description>thx Bharat Katkar, &lt;BR /&gt;&lt;BR /&gt;If I also want to check if the owner is not "root' and the tty is not "?" , then kill it , can suggest how to modify the script ? thx.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;root 15757 0.0 0.0 2352 1196 ? S 17:47 0:00 login -- orcale</description>
      <pubDate>Thu, 15 Sep 2005 18:18:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627109#M236818</guid>
      <dc:creator>peterchu</dc:creator>
      <dc:date>2005-09-15T18:18:47Z</dc:date>
    </item>
    <item>
      <title>Re: control the process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627110#M236819</link>
      <description>Sorry Barhat and Peterchu,&lt;BR /&gt;but in my first command, I wrote&lt;BR /&gt;grep -v ^D&lt;BR /&gt;the "^" character let the command to consider only rows that start with D, so it cannot impact the name of the process.&lt;BR /&gt;&lt;BR /&gt;OK?&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Alex</description>
      <pubDate>Fri, 16 Sep 2005 07:07:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627110#M236819</guid>
      <dc:creator>Alessandro Pilati</dc:creator>
      <dc:date>2005-09-16T07:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: control the process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627111#M236820</link>
      <description>UNIX95= ps -uoracle -o pid= -o state=|awk '$2~/S/ {print $0}'&lt;BR /&gt;&lt;BR /&gt;Now you can pipe this through and kill it.&lt;BR /&gt;&lt;BR /&gt;UNIX95= ps -uroot -o pid= -o state=|awk '$2~/S/ {print $1}' | xargs kill -15</description>
      <pubDate>Fri, 16 Sep 2005 07:29:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627111#M236820</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2005-09-16T07:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: control the process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627112#M236821</link>
      <description>awk only solution:&lt;BR /&gt;&lt;BR /&gt;UNIX95= ps -e -o ruser -o state -o pid -o comm | awk '$1 != "root" &amp;amp;&amp;amp; $2 != "D" &amp;amp;&amp;amp; $4 == "oracle" {print $3}' | xargs kill -9 &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;$1 != "root"    //user is not root&lt;BR /&gt;$2 != "D"       //state is not D&lt;BR /&gt;$4 == "oracle"  //command is oracle&lt;BR /&gt;&lt;BR /&gt;You can modify is as you like...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 16 Sep 2005 07:32:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627112#M236821</guid>
      <dc:creator>Orhan Biyiklioglu</dc:creator>
      <dc:date>2005-09-16T07:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: control the process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627113#M236822</link>
      <description>You can completely eliminate grep and the big mistakes made when grep finds a line with user oracle (not process oracle) or even a process called oracleD or Doracle. Use the -C option ps as in:&lt;BR /&gt; &lt;BR /&gt;UNIX95= ps -fC oracle&lt;BR /&gt; &lt;BR /&gt;This is always an exact match to the process name. If you want just the process ID's that match, use something like this:&lt;BR /&gt; &lt;BR /&gt;UNIX95= ps -C oracle -o pid=&lt;BR /&gt; &lt;BR /&gt;Or assign the result to a variable:&lt;BR /&gt; &lt;BR /&gt;ID=$(UNIX95= ps -C oracle -o pid=)&lt;BR /&gt; &lt;BR /&gt;The -o option allows you to select whatever columns you want and you can assign a custom label to the column (-o pid=MyPIDvalue) or you can eliminate the label with pid= and nothing else. If you want 3 columns but no header line over each column:&lt;BR /&gt; &lt;BR /&gt;UNIX95= ps -C oracle -o pid= -o ruser= -o args=</description>
      <pubDate>Fri, 16 Sep 2005 08:39:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627113#M236822</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2005-09-16T08:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: control the process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627114#M236823</link>
      <description>thx all replies,&lt;BR /&gt;&lt;BR /&gt;Orhan Biyiklioglu's solution seems quite simple and good for me , &lt;BR /&gt;&lt;BR /&gt;If I want to have one more condition, only kill the process that idle for 30 minutes , could suggest how to update it ? thx</description>
      <pubDate>Fri, 16 Sep 2005 10:00:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627114#M236823</guid>
      <dc:creator>peterchu</dc:creator>
      <dc:date>2005-09-16T10:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: control the process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627115#M236824</link>
      <description>I am not sure whether there is an easy method to trace process idle times unless the process supports this by some kind of an heartbeat mechanism. Neither ps nor top or gpm report idle time on process basis.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;PS: some points should be appreciated if you find any of the solutions usefull:)</description>
      <pubDate>Sat, 17 Sep 2005 03:32:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627115#M236824</guid>
      <dc:creator>Orhan Biyiklioglu</dc:creator>
      <dc:date>2005-09-17T03:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: control the process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627116#M236825</link>
      <description>thx reply ,&lt;BR /&gt;&lt;BR /&gt;what "heartbeat mechanism" can do it ? what advise the method ? thx</description>
      <pubDate>Mon, 19 Sep 2005 10:44:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/control-the-process/m-p/3627116#M236825</guid>
      <dc:creator>peterchu</dc:creator>
      <dc:date>2005-09-19T10:44:28Z</dc:date>
    </item>
  </channel>
</rss>

