<?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: help with ksh fuser kill script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-ksh-fuser-kill-script/m-p/3095933#M806871</link>
    <description>This is the BCV server.  When we take it down, we actually make it disappear and rebuild the entire thing from the primary server with a BCV synch/split.&lt;BR /&gt;#&lt;BR /&gt;So, we don't care what happens to it.  We only shut down Oracle to make it easy to unmount the disks.  I could just kill -9 everything.  I just don't want to hang anything and force a reboot.</description>
    <pubDate>Fri, 17 Oct 2003 09:39:41 GMT</pubDate>
    <dc:creator>Stuart Abramson_2</dc:creator>
    <dc:date>2003-10-17T09:39:41Z</dc:date>
    <item>
      <title>help with ksh fuser kill script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-ksh-fuser-kill-script/m-p/3095928#M806866</link>
      <description>Our nightly BCV scripts unmount file systems so that we can synch them to the STDs.&lt;BR /&gt;#&lt;BR /&gt;Occasionally they fail because the file system is busy.  We have an "fuser -kcu" section that kills processes in the script, but I want to know the name of the process involved (because it should already be gone).&lt;BR /&gt;#&lt;BR /&gt;Can someone help me get it out of this file, please?&lt;BR /&gt;#&lt;BR /&gt;fuser -kcu $DIR 1&amp;gt;file1 2&amp;gt;file2&lt;BR /&gt;#&lt;BR /&gt;"file1" looks like this.  It could have one entry in one line or 40 entries in 4 lines.  It fills a line with PIDs and then moves to the next line.  There are a variable number of spaces between PIDs, depending on the length of the PID, and how many fill a line.  (There are 4 spaces between PIDs in this example.  The ITRC Forum web page condenses spaces.) I can't figure out how to get a single PID in a variable all by itself one at a time:&lt;BR /&gt;#&lt;BR /&gt;# cat file1&lt;BR /&gt;#&lt;BR /&gt;   13751   14052   14061   13735   13898   13742   13747   13745   13755   13836   13731   13737   13765   13775   14042   13767   13769   13771   13773   13779   13777   13847   13855   13856   13859   13861   13870   13871   13890   13886   13888   13901   14056   13740&lt;BR /&gt;</description>
      <pubDate>Fri, 17 Oct 2003 08:13:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-ksh-fuser-kill-script/m-p/3095928#M806866</guid>
      <dc:creator>Stuart Abramson_2</dc:creator>
      <dc:date>2003-10-17T08:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: help with ksh fuser kill script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-ksh-fuser-kill-script/m-p/3095929#M806867</link>
      <description>This should do the trick:&lt;BR /&gt;&lt;BR /&gt;for pid in $(cat file1)&lt;BR /&gt;do&lt;BR /&gt;    ps -fp $pid&lt;BR /&gt;done&lt;BR /&gt;</description>
      <pubDate>Fri, 17 Oct 2003 08:19:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-ksh-fuser-kill-script/m-p/3095929#M806867</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2003-10-17T08:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: help with ksh fuser kill script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-ksh-fuser-kill-script/m-p/3095930#M806868</link>
      <description>The problem is that you will have already killed the processes by the time you go to run the ps command.&lt;BR /&gt;&lt;BR /&gt;I would suggest that you run "fuser -cu $DIR 1&amp;gt; file1 2&amp;gt; file2" (without the kill) first .  &lt;BR /&gt;&lt;BR /&gt;Then use the suggested loop in the last response.&lt;BR /&gt;&lt;BR /&gt;Then redo your current fuser command.&lt;BR /&gt;&lt;BR /&gt;Or &lt;BR /&gt;&lt;BR /&gt;do the fuser without kill then do the ps script, but after the ps and before the done add :  kill -SIGKILL $pid&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;&lt;BR /&gt;Kent M. Ostby&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 17 Oct 2003 08:24:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-ksh-fuser-kill-script/m-p/3095930#M806868</guid>
      <dc:creator>Kent Ostby</dc:creator>
      <dc:date>2003-10-17T08:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: help with ksh fuser kill script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-ksh-fuser-kill-script/m-p/3095931#M806869</link>
      <description>You are absolutily right.  How simple!</description>
      <pubDate>Fri, 17 Oct 2003 08:26:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-ksh-fuser-kill-script/m-p/3095931#M806869</guid>
      <dc:creator>Stuart Abramson_2</dc:creator>
      <dc:date>2003-10-17T08:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: help with ksh fuser kill script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-ksh-fuser-kill-script/m-p/3095932#M806870</link>
      <description>I would strongly endorse Kent's suggestion not to blindly kill processes, especially in a database system. A database needs to be properly shutdown to avoid corrupted pointers or indexes so if the current method fails to provide a clean termination, I would devote full attention to solving the 'busy filesystem' problem first and use fuser to verify things went well.</description>
      <pubDate>Fri, 17 Oct 2003 09:05:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-ksh-fuser-kill-script/m-p/3095932#M806870</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2003-10-17T09:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: help with ksh fuser kill script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-ksh-fuser-kill-script/m-p/3095933#M806871</link>
      <description>This is the BCV server.  When we take it down, we actually make it disappear and rebuild the entire thing from the primary server with a BCV synch/split.&lt;BR /&gt;#&lt;BR /&gt;So, we don't care what happens to it.  We only shut down Oracle to make it easy to unmount the disks.  I could just kill -9 everything.  I just don't want to hang anything and force a reboot.</description>
      <pubDate>Fri, 17 Oct 2003 09:39:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-ksh-fuser-kill-script/m-p/3095933#M806871</guid>
      <dc:creator>Stuart Abramson_2</dc:creator>
      <dc:date>2003-10-17T09:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: help with ksh fuser kill script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-ksh-fuser-kill-script/m-p/3095934#M806872</link>
      <description>Stuart Kill -9 still can hang a process or a child process...&lt;BR /&gt;&lt;BR /&gt;I would suggest -15 or -18 first then -9... &lt;BR /&gt; &lt;BR /&gt;-9 will disregard any children and abandon them...when it kills the named process.</description>
      <pubDate>Fri, 17 Oct 2003 10:39:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-ksh-fuser-kill-script/m-p/3095934#M806872</guid>
      <dc:creator>Todd McDaniel_1</dc:creator>
      <dc:date>2003-10-17T10:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: help with ksh fuser kill script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-ksh-fuser-kill-script/m-p/3095935#M806873</link>
      <description>&lt;BR /&gt;I prefer avoiding temp files by using arrays, but they are limited in length.&lt;BR /&gt;&lt;BR /&gt;set -A dirs /dir1 /dir2 /dir3&lt;BR /&gt;set -A pids $(fuser -c ${dirs[@]})&lt;BR /&gt;&lt;BR /&gt;# tell me about all the processes&lt;BR /&gt;ps -fp "${pids[@]}"&lt;BR /&gt;&lt;BR /&gt;# better yet, use lsof!&lt;BR /&gt;lsof -nPp "$(echo ${pids[@]} | sed -e 's/ /,/g')&lt;BR /&gt;&lt;BR /&gt;# terminate them as gracefully as possible&lt;BR /&gt;kill -TERM ${pids[@]}&lt;BR /&gt;&lt;BR /&gt;If you want to iterate a long list of processes, then this may help.&lt;BR /&gt;&lt;BR /&gt;fuser -c ${dirs[@]} | while read pids&lt;BR /&gt;do&lt;BR /&gt;for pid in $pids&lt;BR /&gt;do&lt;BR /&gt;ps -fp $pid&lt;BR /&gt;kill -TERM $pid&lt;BR /&gt;done&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;I do hope some of this helps.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 17 Oct 2003 18:35:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-ksh-fuser-kill-script/m-p/3095935#M806873</guid>
      <dc:creator>Jordan Bean</dc:creator>
      <dc:date>2003-10-17T18:35:27Z</dc:date>
    </item>
  </channel>
</rss>

