<?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: profile: cannot fork: too many processes in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733031#M608564</link>
    <description>As root:&lt;BR /&gt;&lt;BR /&gt;UNIX95=1 ps -efH|tee scott.txt&lt;BR /&gt;&lt;BR /&gt;And send us scott.txt&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 03 Jan 2011 15:47:43 GMT</pubDate>
    <dc:creator>Alzhy</dc:creator>
    <dc:date>2011-01-03T15:47:43Z</dc:date>
    <item>
      <title>profile: cannot fork: too many processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733028#M608561</link>
      <description>/etc/profile: cannot fork: too many processes&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I am not able to login as user scott&lt;BR /&gt;&lt;BR /&gt;su - scott &lt;BR /&gt;&lt;BR /&gt;/etc/profile: cannot fork: too many processes&lt;BR /&gt;and session killed&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;kctune | grep maxu&lt;BR /&gt;maxuprc                             512  512         Immed&lt;BR /&gt;&lt;BR /&gt;ps -fu scott | wc -l&lt;BR /&gt;514&lt;BR /&gt;&lt;BR /&gt;lsof -u scott | wc -l&lt;BR /&gt;278877&lt;BR /&gt;esxha309 root /home/siebel:lsof -u scott | head -10&lt;BR /&gt;COMMAND   PID   USER   FD   TYPE             DEVICE SIZE/OFF    NODE NAME&lt;BR /&gt;ksh      4283 scott  cwd    DIR            128,0x2     1024   55832 /siebel/inst/siebsrvr/admin/IFB/LOG&lt;BR /&gt;ksh      4283 scott  txt    REG             64,0x8   538740   12268 /usr/bin/rksh&lt;BR /&gt;ksh      4283 scott  mem    REG             64,0x8  5020468      48 /usr/lib/hpux32/libc.so.1&lt;BR /&gt;ksh      4283 scott  mem    REG             64,0x8   293088      75 /usr/lib/hpux32/libxti.so.1&lt;BR /&gt;ksh      4283 scott  mem    REG             64,0x8  1407208      72 /usr/lib/hpux32/libnsl.so.1&lt;BR /&gt;ksh      4283 scott  mem    REG             64,0x8    76236      51 /usr/lib/hpux32/libdl.so.1&lt;BR /&gt;ksh      4283 scott  mem    REG             64,0x8  1066624    1615 /usr/lib/hpux32/dld.so&lt;BR /&gt;ksh      4283 scott  mem    REG             64,0x8   177040      70 /usr/lib/hpux32/uld.so&lt;BR /&gt;ksh      4283 scott    0r  FIFO 0xe0000003725eb608      0t0 8772280&lt;BR /&gt;&lt;BR /&gt;esxha309 root /home/siebel:ps -fu scott | wc -l&lt;BR /&gt;514&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;If I kill these scott owned processes it comes again with new pid&lt;BR /&gt;some script is creating them&lt;BR /&gt;how to find the script which creates them&lt;BR /&gt;most of these scott owned process are &lt;DEFUNCT&gt; or -ksh &lt;BR /&gt;&lt;BR /&gt;Please help me to kill these defunct processes . i can not increase maxuprc.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/DEFUNCT&gt;</description>
      <pubDate>Mon, 03 Jan 2011 14:57:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733028#M608561</guid>
      <dc:creator>someoneElse_1</dc:creator>
      <dc:date>2011-01-03T14:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: profile: cannot fork: too many processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733029#M608562</link>
      <description>Can you show us some example scott process trees:&lt;BR /&gt;UNIX95=EXTENDED_PS ps -H -fu scott&lt;BR /&gt;&lt;BR /&gt;&amp;gt;ksh 4283 scott txt REG 64,0x8 538740 12268 /usr/bin/rksh&lt;BR /&gt;&lt;BR /&gt;It seems scott may be using lots of rksh?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;If I kill these scott owned processes it comes again with new pid.  some script is creating them&lt;BR /&gt;&lt;BR /&gt;You are trying to logon but don't know what scott is doing?&lt;BR /&gt;Anyway, by looking at the hierarchy you may get an idea who is starting them.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;how to find the script which creates them&lt;BR /&gt;&amp;gt;most of these scott owned process are &lt;DEFUNCT&gt; or -ksh&lt;BR /&gt;&amp;gt;Please help me to kill these defunct processes.&lt;BR /&gt;&lt;BR /&gt;You can remove the zombies by killing the zombie master.  You'll have to determine which is more important, killing the master and restarting or letting it continue.&lt;/DEFUNCT&gt;</description>
      <pubDate>Mon, 03 Jan 2011 15:12:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733029#M608562</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-01-03T15:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: profile: cannot fork: too many processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733030#M608563</link>
      <description>When you kill the process, note the PPID (parent process ID) and see if the newly spawning process has the same PPID. If so, after making sure it is not a system process and/or a critical production application, you can see what it is and kill it if it will not harm anything else. &lt;BR /&gt;&lt;BR /&gt;I have seen some "clever-above-all" developers leaving a script running on their desktop terminal, doing exactly this, who don't know how to properly code a daemon. So, thread carefully but I am sure you can find the mother of all evil in this case and eliminate it.&lt;BR /&gt;&lt;BR /&gt;Good luck</description>
      <pubDate>Mon, 03 Jan 2011 15:13:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733030#M608563</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2011-01-03T15:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: profile: cannot fork: too many processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733031#M608564</link>
      <description>As root:&lt;BR /&gt;&lt;BR /&gt;UNIX95=1 ps -efH|tee scott.txt&lt;BR /&gt;&lt;BR /&gt;And send us scott.txt&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 03 Jan 2011 15:47:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733031#M608564</guid>
      <dc:creator>Alzhy</dc:creator>
      <dc:date>2011-01-03T15:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: profile: cannot fork: too many processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733032#M608565</link>
      <description>Please find output of&lt;BR /&gt;UNIX95=1 ps -efH|tee scott.txt&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Mon, 03 Jan 2011 16:59:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733032#M608565</guid>
      <dc:creator>someoneElse_1</dc:creator>
      <dc:date>2011-01-03T16:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: profile: cannot fork: too many processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733033#M608566</link>
      <description>Wow... who/what is teh "scott" login? Can you kill all of its processes right now in aid of diagnosis?&lt;BR /&gt;&lt;BR /&gt;for PID in `ps -ef|grep -w scott|awk '{print $2}'`;do&lt;BR /&gt;   kill -9 $PID&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Also, can you check if it has a cron entry? (crontab -l scott) and see if it has a script that is to spawn additional nested ksh sessions?&lt;BR /&gt;</description>
      <pubDate>Mon, 03 Jan 2011 17:06:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733033#M608566</guid>
      <dc:creator>Alzhy</dc:creator>
      <dc:date>2011-01-03T17:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: profile: cannot fork: too many processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733034#M608567</link>
      <description>Based on the most recent attachment, user scott is doing a lot of bad things (ksh starts ksh starts ksh starts ksh....) To find all the scott processes:&lt;BR /&gt; &lt;BR /&gt;UNIX95=on ps -fH -u scott&lt;BR /&gt; &lt;BR /&gt;Then start killing the top level processes. You don't want to increase maxuprc because user scott's activities (or scripts) are broken. This is exactly what maxuprc is supposed to do -- prevent runaway scripts or processes from using up every PID.</description>
      <pubDate>Mon, 03 Jan 2011 17:10:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733034#M608567</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2011-01-03T17:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: profile: cannot fork: too many processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733035#M608568</link>
      <description>It looks like, this person is running a script and spawning sub-shells to do things in parallel and these shells do not clean up properly.&lt;BR /&gt;&lt;BR /&gt;Unless you are the Scott person and clean up this mess by instating proper error checking and properly killing processes when they are done doing what they are supposed to do, into the script/executable, your only option is to kill all the processes belonging to this person in one clean swoop, something like this:&lt;BR /&gt;&lt;BR /&gt;ps -ef | grep scott | awk {'print $2'} | xargs kill &lt;BR /&gt;&lt;BR /&gt;if plain kill do not help at the end of the pipe, you can add a "-9" to the command above. &lt;BR /&gt;&lt;BR /&gt;But what I am suggesting is putting a band-aid onto a deep cut wound. The script/executable causing this behavior, needs to be fixed in the source code.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 03 Jan 2011 17:12:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733035#M608568</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2011-01-03T17:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: profile: cannot fork: too many processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733036#M608569</link>
      <description>I am not able to find the script.&lt;BR /&gt;&lt;BR /&gt;root /:ps -ef | grep scott | awk {'print $2'} | xargs kill -9&lt;BR /&gt;kill: 2426: no such process&lt;BR /&gt;kill: 29892: no such process&lt;BR /&gt;....&lt;BR /&gt;...so on&lt;BR /&gt;&lt;BR /&gt;User has run some bad script by mistake.&lt;BR /&gt;I do not get machine rebooted. I need to kill the script causing the issue?</description>
      <pubDate>Mon, 03 Jan 2011 17:25:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733036#M608569</guid>
      <dc:creator>someoneElse_1</dc:creator>
      <dc:date>2011-01-03T17:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: profile: cannot fork: too many processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733037#M608570</link>
      <description>more than likely, killing the parent process is killing all the children processes before your kill gets to them.&lt;BR /&gt;&lt;BR /&gt;run&lt;BR /&gt;&lt;BR /&gt;ps -fu scott &lt;BR /&gt;&lt;BR /&gt;right after you run this command and see if there are any processes leftover. Please post the output here again</description>
      <pubDate>Mon, 03 Jan 2011 17:30:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733037#M608570</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2011-01-03T17:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: profile: cannot fork: too many processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733038#M608571</link>
      <description>please find the attachment&lt;BR /&gt;ps -fu scott &amp;gt; abc.txt</description>
      <pubDate>Mon, 03 Jan 2011 17:39:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733038#M608571</guid>
      <dc:creator>someoneElse_1</dc:creator>
      <dc:date>2011-01-03T17:39:12Z</dc:date>
    </item>
    <item>
      <title>Re: profile: cannot fork: too many processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733039#M608572</link>
      <description>&amp;gt; ps -ef | grep scott | awk {'print $2'} | xargs kill -9&lt;BR /&gt; &lt;BR /&gt;VERY BAD CODE. &lt;BR /&gt; &lt;BR /&gt;grep and ps can cause catastrophic results, especially when combined with kill. Never use grep to look for a user. Never use kill -9 as you can damage databases and application files. &lt;BR /&gt; &lt;BR /&gt;To kill all the processes owned by scott, FIRST list all of them:&lt;BR /&gt; &lt;BR /&gt;ps -fu scott&lt;BR /&gt; &lt;BR /&gt;Then is all of them are OK to kill, you can apply the kill (and kill -1 if necessary):&lt;BR /&gt; &lt;BR /&gt;ps -fu scott | awk '{print $2}' | xargs kill&lt;BR /&gt;and&lt;BR /&gt;ps -fu scott | awk '{print $2}' | xargs kill -1&lt;BR /&gt; &lt;BR /&gt;That should take care of all the processes, but just to make sure:&lt;BR /&gt; &lt;BR /&gt;ps -fu scott&lt;BR /&gt; &lt;BR /&gt;grep will find things (partial user names, arguments on the command line, etc) you did not intend to be found.</description>
      <pubDate>Mon, 03 Jan 2011 17:39:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733039#M608572</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2011-01-03T17:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: profile: cannot fork: too many processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733040#M608573</link>
      <description>sure. Point is noted. Thanks for the correction.</description>
      <pubDate>Mon, 03 Jan 2011 17:46:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733040#M608573</guid>
      <dc:creator>someoneElse_1</dc:creator>
      <dc:date>2011-01-03T17:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: profile: cannot fork: too many processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733041#M608574</link>
      <description>I am not able to kill these scott owned processes&lt;BR /&gt;It automatically gets created even after killing all processes owned by scott.&lt;BR /&gt;&lt;BR /&gt;ps -fu scott | awk '{print $2}' | xargs kill&lt;BR /&gt;and&lt;BR /&gt;ps -fu scott | awk '{print $2}' | xargs kill -1&lt;BR /&gt;&lt;BR /&gt;Count always remains the same :&lt;BR /&gt;ps -fu scott | wc -l&lt;BR /&gt;514&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;One more question&lt;BR /&gt;By parent-id is 1&lt;BR /&gt;scott   17613     1  0 17:52:18 ?        00:00:00   -ksh&lt;BR /&gt;scott   10636     1  0 17:48:54 ?        00:00:00   -ksh&lt;BR /&gt;scott   16406 10636  0 17:51:58 ?        00:00:00     -ksh&lt;BR /&gt;scott   16470 16406  0 17:52:00 ?        00:00:00       -ksh&lt;BR /&gt;scott   16620 16470  0 17:52:02 ?        00:00:00         -ksh&lt;BR /&gt;      -3 16619 16470  0 17:52:02 ?        00:00:00         &lt;DEFUNCT&gt;&lt;BR /&gt;      -3 16623 16406  0 17:52:02 ?        00:00:00       &lt;DEFUNCT&gt;&lt;BR /&gt;      -3 14613 10636  0 17:50:58 ?        00:00:00     &lt;DEFUNCT&gt;&lt;/DEFUNCT&gt;&lt;/DEFUNCT&gt;&lt;/DEFUNCT&gt;</description>
      <pubDate>Mon, 03 Jan 2011 17:54:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733041#M608574</guid>
      <dc:creator>someoneElse_1</dc:creator>
      <dc:date>2011-01-03T17:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: profile: cannot fork: too many processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733042#M608575</link>
      <description>put this code below in a file:&lt;BR /&gt;&lt;BR /&gt;vi /tmp/cleaner&lt;BR /&gt;&lt;BR /&gt;{ cut below excluding this line }&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;ps -fu scott | while read line &lt;BR /&gt;do&lt;BR /&gt;PID=$(echo $line | awk {'print $2'}&lt;BR /&gt;PPID=$(echo $line | awk {'print $3'}&lt;BR /&gt;if [ $PPID -eq 1 ]&lt;BR /&gt;then &lt;BR /&gt;kill $PID&lt;BR /&gt;ps -ef | grep $PID; r=$?&lt;BR /&gt;if [ $r -eq 0 ]&lt;BR /&gt;then&lt;BR /&gt;kill -1 $PID&lt;BR /&gt;fi&lt;BR /&gt;ps -ef | grep $PID; r=$?&lt;BR /&gt;if [ $r -eq 0 ]&lt;BR /&gt;then&lt;BR /&gt;echo "Process $PID won't die"&lt;BR /&gt;fi&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;{ cut above excluding this line }&lt;BR /&gt;&lt;BR /&gt;make it executable &lt;BR /&gt;&lt;BR /&gt;chmod 700 /tmp/cleaner&lt;BR /&gt;&lt;BR /&gt;run it &lt;BR /&gt;&lt;BR /&gt;/tmp/executable &amp;gt;/tmp/cleaner.out 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;please post /tmp/cleaner.out here&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 03 Jan 2011 17:56:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733042#M608575</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2011-01-03T17:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: profile: cannot fork: too many processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733043#M608576</link>
      <description>&amp;gt;ME: It seems scott may be using lots of rksh?&lt;BR /&gt;&lt;BR /&gt;(lsof picked the first hardlink as the name.)&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Alzhy: Can you kill all of its processes right now in aid of diagnosis?&lt;BR /&gt;&lt;BR /&gt;Much easier to do:&lt;BR /&gt;kill $(UNIX95=EXTENDED_PS ps -u scott -opid=)&lt;BR /&gt;Then change to kill -HUP then -9.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Bill: ksh starts ksh starts ksh starts ksh&lt;BR /&gt;&lt;BR /&gt;You have this with clearcase's setview.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Then start killing the top level processes. &lt;BR /&gt;&lt;BR /&gt;Right, a lot of them have init as the parent, possibly indicating they didn't log off correctly.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;I need to kill the script causing the issue?&lt;BR /&gt;&lt;BR /&gt;Yes.  You did that if you killed all of scott's PIDs.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Mel: killing the parent process is killing all the children processes before your kill gets to them.&lt;BR /&gt;&lt;BR /&gt;Right, that also reaps the zombies.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;please find the attachment&lt;BR /&gt;ps -fu scott &amp;gt; abc.txt&lt;BR /&gt;&lt;BR /&gt;Please use this instead:&lt;BR /&gt;UNIX95=EXTENDED_PS ps -H -fu scott &amp;gt; abc.txt&lt;BR /&gt;&lt;BR /&gt;It seems strange you still have lots of processes.  You likely have a fork bomb with every process trying to create more, no matter which you kill.&lt;BR /&gt;Or it could be a problem with .profile/.kshrc since I don't see any scripts or options on any of the ksh entries.&lt;BR /&gt;&lt;BR /&gt;You may want to stop them all then kill them:&lt;BR /&gt;kill -STOP $(UNIX95=EXTENDED_PS ps -u scott -opid=)&lt;BR /&gt;kill $(UNIX95=EXTENDED_PS ps -u scott -opid=)&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Bill: ps -fu scott | awk '{print $2}' | xargs kill&lt;BR /&gt;&lt;BR /&gt;No need to use awk and xargs:&lt;BR /&gt;kill $(UNIX95=EXTENDED_PS ps -u scott -opid=)&lt;BR /&gt;&lt;BR /&gt;&amp;gt;One more question. By parent-id is 1&lt;BR /&gt;&amp;gt;scott 17613 1 0 17:52:18 ? 00:00:00 -ksh&lt;BR /&gt;&lt;BR /&gt;Right, these orphans have had their parent killed and are adopted by init.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Mel: put this code below in a file:&lt;BR /&gt;&lt;BR /&gt;My "kill -STOP" will probably be easier.</description>
      <pubDate>Mon, 03 Jan 2011 18:13:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733043#M608576</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-01-03T18:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: profile: cannot fork: too many processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733044#M608577</link>
      <description>Please find cleaner.out output attached.&lt;BR /&gt;&lt;BR /&gt;ps -fu scott | wc -l&lt;BR /&gt;514&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 03 Jan 2011 18:13:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733044#M608577</guid>
      <dc:creator>someoneElse_1</dc:creator>
      <dc:date>2011-01-03T18:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: profile: cannot fork: too many processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733045#M608578</link>
      <description>&amp;gt;Please find cleaner.out output attached.&lt;BR /&gt;&lt;BR /&gt;This gives a lot of bogus output due to what Bill said about ps and grep.&lt;BR /&gt;&lt;BR /&gt;Instead of doing:&lt;BR /&gt;ps -ef | grep $PID; r=$?&lt;BR /&gt;if [ $r -eq 0 ]; then&lt;BR /&gt;Do:&lt;BR /&gt;ps -p $PID &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;if [ $? -eq 0 ]; then&lt;BR /&gt;Or:&lt;BR /&gt;kill -0 $PID 2&amp;gt; /dev/null&lt;BR /&gt;if [ $? -eq 0 ]; then&lt;BR /&gt;&lt;BR /&gt;Anyway, this is moot, since you need that -STOP first.&lt;BR /&gt;</description>
      <pubDate>Mon, 03 Jan 2011 18:27:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733045#M608578</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-01-03T18:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: profile: cannot fork: too many processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733046#M608579</link>
      <description>Try:&lt;BR /&gt;&lt;BR /&gt;kill -9 `ps -ef|grep -w scott|awk '{print $2}'`&lt;BR /&gt;ps -fu scott|wc -l&lt;BR /&gt;ps -ef -u scott|tee scott.txt&lt;BR /&gt;&lt;BR /&gt;Paste so there is no "wait" in between...</description>
      <pubDate>Mon, 03 Jan 2011 18:39:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733046#M608579</guid>
      <dc:creator>Alzhy</dc:creator>
      <dc:date>2011-01-03T18:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: profile: cannot fork: too many processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733047#M608580</link>
      <description>#!/usr/bin/sh&lt;BR /&gt;ps -fu scott | while read line &lt;BR /&gt;do&lt;BR /&gt;PID=$(echo $line | awk {'print $2'}&lt;BR /&gt;PPID=$(echo $line | awk {'print $3'}&lt;BR /&gt;if [ $PPID -eq 1 ]&lt;BR /&gt;then &lt;BR /&gt;    kill -0 $PID 2&amp;gt; /dev/null&lt;BR /&gt;    if [ $? -eq 0 ]; then&lt;BR /&gt;       kill -1 $PID 2&amp;gt; /dev/null&lt;BR /&gt;    fi&lt;BR /&gt;    if [ $? -eq 0 ]&lt;BR /&gt;    then&lt;BR /&gt;         echo "Process $PID won't die"&lt;BR /&gt;    fi&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Dennis where to put -STOP in above code&lt;BR /&gt;is above code ok to run</description>
      <pubDate>Mon, 03 Jan 2011 19:00:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/profile-cannot-fork-too-many-processes/m-p/4733047#M608580</guid>
      <dc:creator>someoneElse_1</dc:creator>
      <dc:date>2011-01-03T19:00:30Z</dc:date>
    </item>
  </channel>
</rss>

