On 05/03/2012 18:44, Denys Vlasenko wrote:
On the other hand simply looking for the --exec string to match anywhere in
the /proc/pid/cmdline appears to solve both cases, ie use strstr rather than
strcmp?
strstr is too permissive. Think how many processes --exec n (for example)
will match.
Actually, at most 1 ...
Remember my proposal is that this is only effective for the specific
case of --exec AND --pidfile.
Using only one has risks of killing the wrong process if say the
original daemon died. Using both together is quite precise and can kill
at most one process (tree). The only risk is by loosening the --exec
match that some process dies AND some new process with a very similar
name is lucky enough to get the same pid... The benefit is that fuzzy
matching matches what gentoo does and also handles daemons that change
their cmdline in a reasonable way
I'm not on a soapbox over this, but I can see a reasonable value in
(lets call it fuzzy matching) in the specific case that we also have a pid
Thanks - will leave it there - perhaps you can give it further
consideration though?
Cheers
Ed W
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox