-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

>>>>> What do you think about this patch to require a perfect
>>>>> match
>>>>>>>>> when sending invoking pkill/pgrep?
>>>>> 
>>>>> Won't work. Carefully read pgrep(1) again.
>>> 
>>> After reading the man page again I even found something more
>>> fitting:
>>> 
>>>>> -x      Require an exact match of the process name, or
>>>>> argument list if -f is given.  The default is to match any
>>>>> substring.
>>> 
>>> Since it seems to do what I'm aiming for, could you give me an
>>> example for what won't work?
>>> 
>>> thanks!
>>> 
>>> my tests:
>>> 
>>> # ps ax|grep tor 24508 ??  S       0:03.85 tor -f torrc2 19493
>>> ??  S       0:00.79 tor -f torrc
>>> 
>>> # pgrep -fx tor       # no result expected
>>> 
>>> # pgrep -fx 'tor -f torrc'  # expected result: 19493 but NOT
>>> 24508 19493
>>> 
>>> # pgrep -fx 'tor -f torrc2'  # expected result: 24508 24508
> Some daemons will happend more stuffs to the command line than just
> $daemon $daemon_flags

Then $pexp should include everything that a daemon can append via
rc.conf.local settings?

> So this cannot be used as a generic solution.

Wouldn't it make sense to use '-x' by defaut in rc.subr to be more
strict and less likely to unintentionally kill other daemons in general?


> If you want to match the exact complete command line, adapt pexp
> accordingly and end it with '$'.

Can $pexp be set via /etc/rc.conf.local?
-----BEGIN PGP SIGNATURE-----

iQIcBAEBCgAGBQJVhcKOAAoJEFv7XvVCELh0qVoP/jdy1m0vE9/k8qVQfmlPlpMz
QiXwM0y7SoGThrDnALeCuPflVGvenTtitNj7RtaSDsJRTyFKRW+VOQYJO/mP/3u/
DdKjvuEe6MtrcJYBgZLrcQw3EeWZM0NBsfO3wscC3hoWkN6dDeoNGh2w2GlUqm0J
414QZT5YwAuL2QwSHOZjPa3ks83JK1egs+g33YdSml3/ur8NAHqUX9V2aAWDaNcv
HPZoQEf5JIRcfET28RxGYFIswybSQW5suZ2hcXrImZcypuTXqGv+e4pXs9YI4Jc2
jaae+HGc5UDIZmu8yBEmhdSm4OG+em6CwiG4MTyFrPte9a+AoAjp8gC9LiiFqbWl
cNv5vugMJZHsXlaBwE4Be/w69L8/+r/gSnepEnSjJhUzygDCyv0MzrwkEdvHnxzu
7YZv1opDFkuOjWMNhPKA73lIDW0qmlti2Xl3q4BHb2XlvPhvOtWn2t1JhoHDl+nd
r24UdruJLfOv+oXHr2nObIr1KlBvZ1DaPxm3ybRsJvdFLzHmBdWGGGVerA8Jlcv4
izZuKjTqQMfA/J4ESdqoLbcHzY/DGm/sbB8Grmez0rCtAzuinKCauQ5zX9IPV8p4
IskuzIwxHoXSPNN74+ycN+3XSlc/at/y5KxJBT2Nuf5ZR1H/V4Vp0IkedkM5qhmL
l4j33IkmBZAG7e7T1UWT
=9Asr
-----END PGP SIGNATURE-----

Reply via email to