Tomas Heran wrote:
> Hi Mats ... please see my comment below.

Hello Tomas!

[snip]

>>>>     if pgrep $NAME >/dev/null; then
>>>>         echo "'$NAME' is already running"
> 
> I suspect the problem is how you are using pgrep(1) here. Please note,
> that if you do "pgrep inadyn", it'll match not only process with name
> inadyn, but also your SMF method script called inadyn-script (which is
> running at the time you're doing the check). That's why the script says
> that "inadyn is already running" even though you checked before that
> inadyn is not running.
> 
> Please note the -x option for pgrep(1):
>      -x              Considers  only  processes  whose   argument
>                      string   or  executable  file  name  exactly
>                      matches the specified pattern to be matching
>                      processes.  The  pattern match is considered
>                      to be  exact  when  all  characters  in  the
>                      process  argument  string or executable file
>                      name match the pattern.
> 
> Hope that helps!

Excellent! That solved the problem! I added the -x to both pgrep and
pkill and now it works like a charm.

Thanks again!
-- 
Mats Kindahl
Replication Team
MySQL AB, www.mysql.com



-------------- next part --------------
A non-text attachment was scrubbed...
Name: mats.vcf
Type: text/x-vcard
Size: 199 bytes
Desc: not available
URL: 
<http://mail.opensolaris.org/pipermail/smf-discuss/attachments/20061114/dd28c258/attachment.vcf>

Reply via email to