Hi,

On Tue, Aug 17, 2010 at 07:44:56AM +0200, Florian Forster wrote:
> On Sun, Aug 15, 2010 at 12:58:18PM +0200, Sebastian Harl wrote:
> > > So the described behavior is expected and has been like this since
> > > the feature was introduced in version 4.3 (Lenny features 4.4.2-3).
> > > If you have any idea how I could detect a "pattern not found"
> > > condition, please let me know.
> > 
> > Well, in case wordexp() returned a single "match" and that file does
> > not exist and the filename includes any of the characters '*', '?' or
> > '[' (wordexp() should return an error already, if there is an
> > unmatched bracket, I presume) and if that character is not escaped,
> > that file could be ignored.
> 
> I don't think that's a good idea: Imagine someone making a mistake in
> the Include directive, for example giving "*.cnof". Then the broken out
> config files will be ignored because the pattern doesn't match without
> any indication, which I don't think is very user friendly.

Agreed, that's why I've raised the concerns in the part of my message
you did not quote ;-)

> With this in mind, I think that including a pattern that doesn't expand
> to a file is an error and should be reported to the user. Since other
> tools, such as "ls", report a "file not found" in this case, too, the
> error message we give should be familiar to most users and help them
> find the source of the problem quickly. That's, imho, the best we can do
> here. I'm open for suggestions, though :)

Well, this is what's implemented currently. Since you're talking about
an error, do you suggest to terminate collectd in that case (which is
not currently the case)? If not, I suggest appending a warning telling
the user that the file/error is being ignored to indicate that the
daemon keeps running.

Cheers,
Sebastian

-- 
Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/

Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety.         -- Benjamin Franklin

Attachment: signature.asc
Description: Digital signature

Reply via email to