<?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 all process by a script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-all-process-by-a-script/m-p/4661967#M677477</link>
    <description>Thanks a lot</description>
    <pubDate>Fri, 16 Jul 2010 03:40:30 GMT</pubDate>
    <dc:creator>Techsystemquery</dc:creator>
    <dc:date>2010-07-16T03:40:30Z</dc:date>
    <item>
      <title>how to kill all process by a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-all-process-by-a-script/m-p/4661960#M677468</link>
      <description>i can see&lt;BR /&gt;&lt;BR /&gt;#ps -ef | grep compress.sh |wc -l&lt;BR /&gt;500&lt;BR /&gt;&lt;BR /&gt;I want to kill all the 500 process and release memory in HP UX server</description>
      <pubDate>Thu, 15 Jul 2010 14:37:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-all-process-by-a-script/m-p/4661960#M677468</guid>
      <dc:creator>Techsystemquery</dc:creator>
      <dc:date>2010-07-15T14:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: how to kill all process by a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-all-process-by-a-script/m-p/4661961#M677470</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;So you have 500 processes with the name 'compress.sh' and you want to kill all of them?&lt;BR /&gt;&lt;BR /&gt;# PIDS=$(UNIX95= ps -C compress.sh -opid=)&lt;BR /&gt;&lt;BR /&gt;# kill ${PIDS}&lt;BR /&gt;&lt;BR /&gt;This will find only processes named 'compress.sh'; capture the corresponding pid in a list in the PIDS variable and kill those processes.&lt;BR /&gt;&lt;BR /&gt;Note the use of 'UNIX95=' with whitespace before the 'ps' command and without any semicolon.  This arms the UNIX95 (XPG4) behavior only for the duration of the command line.&lt;BR /&gt;&lt;BR /&gt;Using the UNIX95 '-C &lt;ARGUMENT&gt;' allows exact matching to a process basename rather than doing fuzzy (and potentially disastrous) matching with 'grep'.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;/ARGUMENT&gt;</description>
      <pubDate>Thu, 15 Jul 2010 14:43:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-all-process-by-a-script/m-p/4661961#M677470</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-07-15T14:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: how to kill all process by a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-all-process-by-a-script/m-p/4661962#M677472</link>
      <description>how can i kill using ps command in a single line ?&lt;BR /&gt;&lt;BR /&gt;can i use xargs kill -15 ?</description>
      <pubDate>Thu, 15 Jul 2010 15:07:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-all-process-by-a-script/m-p/4661962#M677472</guid>
      <dc:creator>Techsystemquery</dc:creator>
      <dc:date>2010-07-15T15:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: how to kill all process by a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-all-process-by-a-script/m-p/4661963#M677473</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;&amp;gt; how can i kill using ps command in a single line ?&lt;BR /&gt;&lt;BR /&gt;# kill $(UNIX95= ps -C compress.sh -opid=)&lt;BR /&gt;&lt;BR /&gt;...or if you need:&lt;BR /&gt;&lt;BR /&gt;# kill -9 $(UNIX95= ps -C compress.sh -opid=)&lt;BR /&gt;&lt;BR /&gt;The advantage to first capturing the list and then issuing the 'kill' is that you can build the list once and apply successively harder hammers:&lt;BR /&gt;&lt;BR /&gt;# kill -hup ${PIDS}&lt;BR /&gt;# kill -term ${PIDS}&lt;BR /&gt;# kill -9 ${PIDS}&lt;BR /&gt;&lt;BR /&gt;Use the 'kill -9' only as a last resort.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 15 Jul 2010 15:11:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-all-process-by-a-script/m-p/4661963#M677473</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-07-15T15:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: how to kill all process by a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-all-process-by-a-script/m-p/4661964#M677474</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;You can use any switch you want, start with the default, and work your way up to -9.&lt;BR /&gt;&lt;BR /&gt;Try 15 if you you want.&lt;BR /&gt;&lt;BR /&gt;If the -9 tries to kill the init process, process ID 1, nothing bad should happen, the request should be ignored. On unstable systems, I've seem entire systems suddenly implode.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Thu, 15 Jul 2010 19:36:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-all-process-by-a-script/m-p/4661964#M677474</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2010-07-15T19:36:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to kill all process by a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-all-process-by-a-script/m-p/4661965#M677475</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; SEP: You can use any switch you want, start with the default, and work your way up to -9.  Try 15 if you you want.&lt;BR /&gt;&lt;BR /&gt;A 'kill' without a switch defaults to 'kill -15' which is a SIGTERM or 'kill -TERM'.&lt;BR /&gt;&lt;BR /&gt;In the case of daemons, a standard practice is for the daemon to re-read its configuration file or otherwise re-initialize itself when it receives a HANGUP signal ('kill -HUP').&lt;BR /&gt;&lt;BR /&gt;Some signals can be trapped, which means that the program receiving them has the ability to ignore or invoke a signal handler (a short block of code) to perform some specific action like removing temporary files before exiting.&lt;BR /&gt;&lt;BR /&gt;A 'kill -KILL' ('kill -9') *cannot* be trapped.  That is, there is nothing that a program can do to ignore it nor to invoke any signal handler.  Using this capriciously may cause programs to leave temporary files lying about (or worse) leave shared memory segments orphaned and holding precious memory.  Using a 'kill -9' with an 'fbackup' session represents a classic case.&lt;BR /&gt;&lt;BR /&gt;A 'kill -0' ('kill -NULL') can be used to test a pid's validity,&lt;BR /&gt; &lt;BR /&gt;&amp;gt; SEP: If the -9 tries to kill the init process, process ID 1, nothing bad should happen, the request should be ignored. On unstable systems, I've seem entire systems suddenly implode.&lt;BR /&gt;&lt;BR /&gt;As far as I know, a 'kill -9 1' (which is an untrappable kill of the init daemon (pid=1)) is a "might-as-well-reboot".  Daemons have 'init' as their parent process so terminating 'initd' terminates those.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 15 Jul 2010 20:42:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-all-process-by-a-script/m-p/4661965#M677475</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-07-15T20:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: how to kill all process by a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-all-process-by-a-script/m-p/4661966#M677476</link>
      <description>&amp;gt;how can I kill using ps command in a single line?&lt;BR /&gt;&lt;BR /&gt;You shouldn't worry about this.  Your bosses don't pay you by the line.  :-)&lt;BR /&gt;If you're scripting, it is better to be more understandable.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;JRF: As far as I know, a "kill -9 1" is a "might-as-well-reboot".&lt;BR /&gt;&lt;BR /&gt;No, kill(2) says it will NOT honor a SIGKILL for PID 1:&lt;BR /&gt;pid can equal 1 unless sig is SIGKILL or SIGSTOP.&lt;BR /&gt;So SEP was right about it being ignored.</description>
      <pubDate>Fri, 16 Jul 2010 00:38:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-all-process-by-a-script/m-p/4661966#M677476</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-07-16T00:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to kill all process by a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-all-process-by-a-script/m-p/4661967#M677477</link>
      <description>Thanks a lot</description>
      <pubDate>Fri, 16 Jul 2010 03:40:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-all-process-by-a-script/m-p/4661967#M677477</guid>
      <dc:creator>Techsystemquery</dc:creator>
      <dc:date>2010-07-16T03:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: how to kill all process by a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-all-process-by-a-script/m-p/4661968#M677478</link>
      <description># kill -9 `ps -ef | grep compress.sh |awk '{print $2}' | xargs` #Cheers</description>
      <pubDate>Fri, 16 Jul 2010 08:47:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-all-process-by-a-script/m-p/4661968#M677478</guid>
      <dc:creator>Raj D.</dc:creator>
      <dc:date>2010-07-16T08:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: how to kill all process by a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-all-process-by-a-script/m-p/4661969#M677479</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Dennis: kill(2) says it will NOT honor a SIGKILL for PID 1...&lt;BR /&gt;So SEP was right about it being ignored.&lt;BR /&gt;&lt;BR /&gt;Ah, thank you for the correction.  Yes, SEP was right.  The manpages for kill(1) infer this but the manpages for kill(2) clearly state this as you noted.  I stupidly failed to read the section-2 pages :-(&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 16 Jul 2010 15:51:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-kill-all-process-by-a-script/m-p/4661969#M677479</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-07-16T15:51:04Z</dc:date>
    </item>
  </channel>
</rss>

