<?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: ps -ef command in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-command/m-p/2591436#M32971</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;The simplest way I could think of was this:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;ps -ef | while read UID PID PPID DUMMY&lt;BR /&gt;  do&lt;BR /&gt;    if [ "${PPID}" = "1" ]&lt;BR /&gt;      then&lt;BR /&gt;        ps -p ${PID} -f&lt;BR /&gt;      fi&lt;BR /&gt;  done&lt;BR /&gt;&lt;BR /&gt;Regards, Clay</description>
    <pubDate>Mon, 08 Oct 2001 21:10:18 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2001-10-08T21:10:18Z</dc:date>
    <item>
      <title>ps -ef command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-command/m-p/2591435#M32970</link>
      <description>I need the command options to get a list of running processes that have a PPID of 1 (root).&lt;BR /&gt;I have an appliction that orphans it's processes to root and I amd workling on a script to clean them up. Any ideas/ Thanks.</description>
      <pubDate>Mon, 08 Oct 2001 20:55:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-command/m-p/2591435#M32970</guid>
      <dc:creator>Scott E Smith</dc:creator>
      <dc:date>2001-10-08T20:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: ps -ef command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-command/m-p/2591436#M32971</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;The simplest way I could think of was this:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;ps -ef | while read UID PID PPID DUMMY&lt;BR /&gt;  do&lt;BR /&gt;    if [ "${PPID}" = "1" ]&lt;BR /&gt;      then&lt;BR /&gt;        ps -p ${PID} -f&lt;BR /&gt;      fi&lt;BR /&gt;  done&lt;BR /&gt;&lt;BR /&gt;Regards, Clay</description>
      <pubDate>Mon, 08 Oct 2001 21:10:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-command/m-p/2591436#M32971</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-10-08T21:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: ps -ef command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-command/m-p/2591437#M32972</link>
      <description>&lt;BR /&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;ps -ef | grep $process | grep -v grep | cut -c 10-14,15-20,39-44 | tr -s " "&lt;BR /&gt;&lt;BR /&gt;This will give outpur of all runaway process. &lt;BR /&gt;$process should  be replaced by the process name&lt;BR /&gt;&lt;BR /&gt;Good Luck &lt;BR /&gt;-USA..</description>
      <pubDate>Mon, 08 Oct 2001 21:12:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-command/m-p/2591437#M32972</guid>
      <dc:creator>Uday_S_Ankolekar</dc:creator>
      <dc:date>2001-10-08T21:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: ps -ef command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-command/m-p/2591438#M32973</link>
      <description>Hi Scott:&lt;BR /&gt;&lt;BR /&gt;# PIDS=`ps -el|awk '$3 &amp;gt; 100 &amp;amp;&amp;amp; $5 = 1 &amp;amp;&amp;amp; $12 ~/\?/ {print $4}'`&lt;BR /&gt;&lt;BR /&gt;...will give you a list of candidates.  Field-3 is the 'uid' for which you want to return only "safe" *user* processes.  Since I start "normal" user definitions in /etc/passwd at 100 and above, I have shown this case. Field-5 is the 'ppid' you seek; and field-4 is the 'pid' you might kill.&lt;BR /&gt;&lt;BR /&gt;If you are going to kill processes, do so with a simple (-15) kill and/or a hangup signal (kill -1) rather than a 'kill -9'.  This gives processes a chance to cleanup temporarary files, shared memory and otherwise terminate gracefully.&lt;BR /&gt;&lt;BR /&gt;The capture of your candidate list in a variable like "PIDS" allows you to issue a 'kill -1' for instance; wait 5-10 seconds; and then (if you must), issue a 'kill -9' using the variable list again.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 08 Oct 2001 21:16:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-command/m-p/2591438#M32973</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-10-08T21:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: ps -ef command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-command/m-p/2591439#M32974</link>
      <description>Try this way,&lt;BR /&gt;&lt;BR /&gt;UNIX95= ps -e -o "ppid args" &lt;BR /&gt;&lt;BR /&gt;You can do anything with the output.&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Mon, 08 Oct 2001 21:17:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-command/m-p/2591439#M32974</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2001-10-08T21:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: ps -ef command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-command/m-p/2591440#M32975</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt; Try the following command:&lt;BR /&gt;&lt;BR /&gt;UNIX95= ps -e -o user,pid,ppid,comm |sort -nk3 | more&lt;BR /&gt;&lt;BR /&gt;  This will list the  processes with the PPID&lt;BR /&gt;in the ascending order.&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;raj</description>
      <pubDate>Mon, 08 Oct 2001 21:19:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-command/m-p/2591440#M32975</guid>
      <dc:creator>Roger Baptiste</dc:creator>
      <dc:date>2001-10-08T21:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: ps -ef command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-command/m-p/2591441#M32976</link>
      <description>I guess I should be more specific.&lt;BR /&gt;&lt;BR /&gt;To find out all the processes that has the PPID of 1, use awk to filter the processes&lt;BR /&gt;&lt;BR /&gt;UNIX95= ps -e -o "ppid args" |awk '$1 = 1 {print $2}'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;To verify the above output try the same replacing $2 with $0.&lt;BR /&gt;&lt;BR /&gt;BTW UNIX95 gives XPG4 behaviour of PS that is very handy.&lt;BR /&gt;&lt;BR /&gt;-Sri&lt;BR /&gt;</description>
      <pubDate>Mon, 08 Oct 2001 21:23:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-command/m-p/2591441#M32976</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2001-10-08T21:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: ps -ef command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-command/m-p/2591442#M32977</link>
      <description>export KILL_PID=`ps -ef | grep -v root | awk '{ if ( $3 -eq&lt;BR /&gt; 1 ) print $1" "$2 }' `&lt;BR /&gt;&lt;BR /&gt;then you can test with&lt;BR /&gt;if [[ ! -z $KILL_PID ]];then&lt;BR /&gt;......&lt;BR /&gt;.....&lt;BR /&gt;&lt;BR /&gt;then to kill you could do..&lt;BR /&gt;export TOKILL=`echo $KILL_PID |awk '{print $2}'&lt;BR /&gt;kill -9 $TOKILL</description>
      <pubDate>Mon, 08 Oct 2001 21:26:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-command/m-p/2591442#M32977</guid>
      <dc:creator>Kevin Wright</dc:creator>
      <dc:date>2001-10-08T21:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: ps -ef command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-command/m-p/2591443#M32978</link>
      <description>Hi Scott:&lt;BR /&gt;&lt;BR /&gt;Whatever you do, don't kill these guys with a kill -9 - that is almost always a BAD idea because no cleanup is done (Remove temp files, shared memory, etc.)&lt;BR /&gt;&lt;BR /&gt;I would write a function to kill these guys&lt;BR /&gt;with a kill -15, kill -1, kill -2, kill -11 in that order. You can test with a kill -0 to see if the process is still around. kill -11 is almost as sure a kill as kill -9 and does cleanup. It you want to add kill -9 to the end of that list - well that's up to you.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 08 Oct 2001 21:41:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-command/m-p/2591443#M32978</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-10-08T21:41:28Z</dc:date>
    </item>
  </channel>
</rss>

