<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: L00pek's Code Snippets</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Sat, 30 Aug 2008 03:40:02 GMT</pubDate>
    <description>DZone Snippets: L00pek's Code Snippets</description>
    <item>
      <title>Killing Tomcat on Linux</title>
      <link>http://snippets.dzone.com/posts/show/318</link>
      <description>&lt;code&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;&lt;br /&gt;#args to pass to kill&lt;br /&gt;ARG=$1&lt;br /&gt;&lt;br /&gt;for file in `find /proc -regex /proc/[0-9]+ 2&gt; /dev/null`; do&lt;br /&gt;&lt;br /&gt;    # FIXME: this will execute the command but I don't think that grep &lt;br /&gt;    # if `grep org.apache.catalina.startup.Bootstrap $file/cmdline`; then &lt;br /&gt;&lt;br /&gt;    if `grep --silent org.apache.catalina.startup.Bootstrap $file/cmdline 2&gt; /dev/null`; then &lt;br /&gt;&lt;br /&gt;        #get the localname of this process id.&lt;br /&gt;        #cat $file/cmdline&lt;br /&gt;&lt;br /&gt;        #now go ahead and kill this guy&lt;br /&gt;        base=`basename $file`&lt;br /&gt;        echo kill $ARG $base&lt;br /&gt;        kill $ARG $base&lt;br /&gt;&lt;br /&gt;    fi &lt;br /&gt;&lt;br /&gt;done&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Tue, 24 May 2005 23:59:24 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/318</guid>
      <author>l00pek (l00pek)</author>
    </item>
  </channel>
</rss>
