tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Over 70 instances of Tomcat after startup
Date Mon, 08 Oct 2007 14:26:09 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ray,

Ray Statham wrote:
> procid=`ps ax | grep " -Dcatalina.base=${appname} " | grep -v grep | awk '{print $1}'`

Are you sure this is line 36? It seems like this wouldn't be the one
failing, but one where you were trying to use the value of $procid.

- From the behavior you are observing and the error message, I'm guessing
that you are getting multiple pids back from your process search, which
is tripping-up your script. You might want to plan for multiple pids
coming back and take appropriate action.

Note that you can use $! to get the pid of the last-executed background
command., rather than trying to use your messy ps | grep | awk solution.
Not sure if there's a better way to see if it's already running. Most
scripts like this use a pidfile somewhere to store the pid of the
previous execution, and shutdown scripts remove that file. It's crude,
but it usually works.

http://www.gnu.org/software/bash/manual/bashref.html#SEC25

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHCj4B9CaO5/Lv0PARAvxcAJ966qImlJdwT6NJSu/E7J9HyEA31wCghRKC
qv7xfoA+n388T+efgNWYpfc=
=bzV7
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message