Re: [Dnsmasq-discuss] extension of configuration files
On Sun, Jul 5, 2009 at 4:29 PM, Carlos Carvalhocar...@fisica.ufpr.br wrote: Simon Kelley (si...@thekelleys.org.uk) wrote on 5 July 2009 16:41: I guess the problem is knowing _which_ files should be ignored ( how many conventions are there?) and not ignoring files which someone, somewhere, thinks are perfectly OK and should be used. That's clearly impossible. If you decide to do it there are only two possibilities: define the (only) extension in dnsmasq, or do it like apache, as Michael says. I think the later is too much bloat. I'd rather not have any exclusion but since you ruled this out we're left with the first alternative. What about just leaving it as it's now? :-) How about a compromise -- not a full wildcard syntax, but a user-controlled literal suffix match? e.g. conf-dir-suffix=.conf Or you could let other programs do the heavy lifting and have a just-in-time config command whose output is processed. Dangerous because it has to be run before forking as nobody, but very powerful: jit-config=/bin/sh -c cat /etc/conf.d/dnsmasq/*.conf ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Re: [Dnsmasq-discuss] extension of configuration files
On Sun, Jul 5, 2009 at 5:20 PM, richardvo...@gmail.comrichardvo...@gmail.com wrote: How about a compromise -- not a full wildcard syntax, but a user-controlled literal suffix match? e.g. conf-dir-suffix=.conf Or you could let other programs do the heavy lifting and have a just-in-time config command whose output is processed. Dangerous because it has to be run before forking as nobody, but very powerful: jit-config=/bin/sh -c cat /etc/conf.d/dnsmasq/*.conf Just a couple of thoughts and I'll let Simon finish digesting this thread. I have an objection to the apache multiple includes approach. I think that the only way to make room for this is to rip out the current behavior of accommodating for the various emacs patterns Simon mentioned earlier in the thread to make room for this. I question the need for the apache include approach since apache will let you specify more than one include statement. Dnsmasq has few enough options that a single directory with multiple files is really sufficient. the conf-dir-suffix idea really seems to be the most flexible, and the easiest to add in the current mix.
Re: [Dnsmasq-discuss] extension of configuration files
Helmut Hullen wrote: Hallo, Carlos, Du meintest am 05.07.09: I guess the problem is knowing _which_ files should be ignored ( how many conventions are there?) and not ignoring files which someone, somewhere, thinks are perfectly OK and should be used. That's clearly impossible. If you decide to do it there are only two possibilities: define the (only) extension in dnsmasq, or do it like apache, as Michael says. I think the later is too much bloat. I'd rather not have any exclusion but since you ruled this out we're left with the first alternative. If dnsmasq had defined allowed extensions from the beginning there would be no problem, but it hasn't. And therefore every user may have declared his own extensions (or no one). Therefor dnsmasq cannot change its behaviour - I had forgotten this small problem ... What about just leaving it as it's now? :-) Under my slackware installation I'll write my special slackware extension watcher ... it first has to look what's the name of conf- dir. Ugly. There's an alternative which is backwards compatible: extend the --conf-dir option optionally allow extensions which should _NOT_ be used, so the correct form to solve the initial problem would be --conf-dir=/etc/dnsmasq.d,.new I guess that for completeness, more than one extension should be allowed. That would meant that (for instance) the Debian dnsmasq package, which automatically reads /etc/dnsmasq.d for config fragments dropped by other packages, could ignore *.dpkg-dist *.dpkg-old and *.dpkg-new. That's a useful improvement. Cheers, Simon.
Re: [Dnsmasq-discuss] extension of configuration files
Hallo, Simon, Du meintest am 06.07.09: Under my slackware installation I'll write my special slackware extension watcher ... it first has to look what's the name of conf- dir. Ugly. There's an alternative which is backwards compatible: extend the --conf-dir option optionally allow extensions which should _NOT_ be used, so the correct form to solve the initial problem would be --conf-dir=/etc/dnsmasq.d,.new I guess that for completeness, more than one extension should be allowed. Sounds very good - thank you! Viele Gruesse! Helmut
Re: [Dnsmasq-discuss] extension of configuration files
On Mon, Jul 6, 2009 at 1:17 AM, Helmut Hullenhul...@t-online.de wrote: Hallo, richardvo...@gmail.com, Du meintest am 05.07.09: What about just leaving it as it's now? :-) How about a compromise -- not a full wildcard syntax, but a user-controlled literal suffix match? e.g. conf-dir-suffix=.conf And then many old installations which have files with no extensions get problems ... Perhaps something like either no extension or extension = .conf may solve the most problems. Or you could let other programs do the heavy lifting and have a just-in-time config command whose output is processed. Dangerous because it has to be run before forking as nobody, but very powerful: jit-config=/bin/sh -c cat /etc/conf.d/dnsmasq/*.conf My distribution (slackware) has no /etc/conf.d directory - that's the second problem. Each user (sysadm) can define his (or her) own conf- dir. Viele Gruesse! Helmut I guess I didn't explain these were meant to be examples of configuration options, that the user could edit to suit themselves, just like every other configuration option dnsmasq provides. If slackware doesn't have /etc/conf.d then supply your own command for finding the configuration. And the default would be no external configuration directory, just like it is today. But Simon's solution of a user-defined list of suffixes to exclude seems an ideal tradeoff between flexibility and complexity.
Re: [Dnsmasq-discuss] extension of configuration files
Helmut Hullen wrote: Hallo, Simon, Du meintest am 06.07.09: Under my slackware installation I'll write my special slackware extension watcher ... it first has to look what's the name of conf- dir. Ugly. There's an alternative which is backwards compatible: extend the --conf-dir option optionally allow extensions which should _NOT_ be used, so the correct form to solve the initial problem would be --conf-dir=/etc/dnsmasq.d,.new I guess that for completeness, more than one extension should be allowed. Sounds very good - thank you! Try this: http://www.thekelleys.org.uk/dnsmasq/test-releases/dnsmasq-2.50test6.tar.gz which implements it (many extensions). Cheers, Simon.
Re: [Dnsmasq-discuss] extension of configuration files
Hallo, Simon, Du meintest am 06.07.09: --conf-dir=/etc/dnsmasq.d,.new I guess that for completeness, more than one extension should be allowed. http://www.thekelleys.org.uk/dnsmasq/test-releases/dnsmasq-2.50test6.tar.gz which implements it (many extensions). Works like a charm - thank you! One more problem solved. Viele Gruesse! Helmut
Re: [Dnsmasq-discuss] extension of configuration files
Hallo, RevRagnarok, Du meintest am 05.07.09 zum Thema Re: [Dnsmasq-discuss] extension of configuration files: Could dnsmasq exclude *.new files from reading? Some other programs do so. By extension, it should probably just ignore everything not *.conf, since other package managers use other methods, e.g. .rpmnew and .rpmold. Sounds reasonable. Please keep the traffic in the mailing list! Viele Gruesse! Helmut
Re: [Dnsmasq-discuss] extension of configuration files
Rance Hall wrote: On Sun, Jul 5, 2009 at 7:56 AM, Helmut Hullenhul...@t-online.de wrote: Hallo, RevRagnarok, Du meintest am 05.07.09 zum Thema Re: [Dnsmasq-discuss] extension of configuration files: Could dnsmasq exclude *.new files from reading? Some other programs do so. By extension, it should probably just ignore everything not *.conf, since other package managers use other methods, e.g. .rpmnew and .rpmold. Sounds reasonable. Please keep the traffic in the mailing list! Viele Gruesse! Helmut ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss I think this is a great idea but I don't think it belongs in dnsmasq proper. I think it makes the code base bigger for no real feature gain. This is something that could be handled in an init script stanza prior to actually launching dnsmasq. set a variable for the main config file parse it looking for config_dir if found, check contents for updated scripts (test will be different for each distro I suspect) mv the updated files to config_dir.update start dnsmasq the normal way If you did this in the init script then it would be much more flexible for per distro variations. Personally, I've never seen a distro actually populate the config_dir usually its commented out of the main config file Its ultimately up to Simon, but I've seen other comments from him that indicate code size is important for him as he knows that dnsmasq is used in embedded devices. I don't see embedded devices benefiting from this change. I'd be in a stronger position to refuse to do this if the code didn't already weed out filenames which look like .file and file~ and #file#. I'm an emacs user and those last two are emacs droppings. I guess the problem is knowing _which_ files should be ignored ( how many conventions are there?) and not ignoring files which someone, somewhere, thinks are perfectly OK and should be used. Cheers, Simon.
Re: [Dnsmasq-discuss] extension of configuration files
Hallo, Rance, Du meintest am 05.07.09: Could dnsmasq exclude *.new files from reading? Some other programs do so. By extension, it should probably just ignore everything not *.conf, since other package managers use other methods, e.g. .rpmnew and .rpmold. I think this is a great idea but I don't think it belongs in dnsmasq proper. I think it makes the code base bigger for no real feature gain. ??? Instead of include $conf-dir/* there would be include $conf-dir/*.conf Nothing more to do. This is something that could be handled in an init script stanza prior to actually launching dnsmasq. set a variable for the main config file parse it looking for config_dir if found, check contents for updated scripts (test will be different for each distro I suspect) mv the updated files to config_dir.update start dnsmasq the normal way I may not write (and test, and debug) such a wrapper ... Viele Gruesse! Helmut
Re: [Dnsmasq-discuss] extension of configuration files
I think, there is a really easy solution: conf-dir should expect a expression at the end. Or a new attribute have to be added like include. In Apache you can say include /etc/httpd/conf.d/*.conf now i am very flexible to include as many patterns as i need. Michael. Am 05.07.2009 17:41, schrieb Simon Kelley: Rance Hall wrote: On Sun, Jul 5, 2009 at 7:56 AM, Helmut Hullenhul...@t-online.de wrote: Hallo, RevRagnarok, Du meintest am 05.07.09 zum Thema Re: [Dnsmasq-discuss] extension of configuration files: Could dnsmasq exclude *.new files from reading? Some other programs do so. By extension, it should probably just ignore everything not *.conf, since other package managers use other methods, e.g. .rpmnew and .rpmold. Sounds reasonable. Please keep the traffic in the mailing list! Viele Gruesse! Helmut ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss I think this is a great idea but I don't think it belongs in dnsmasq proper. I think it makes the code base bigger for no real feature gain. This is something that could be handled in an init script stanza prior to actually launching dnsmasq. set a variable for the main config file parse it looking for config_dir if found, check contents for updated scripts (test will be different for each distro I suspect) mv the updated files to config_dir.update start dnsmasq the normal way If you did this in the init script then it would be much more flexible for per distro variations. Personally, I've never seen a distro actually populate the config_dir usually its commented out of the main config file Its ultimately up to Simon, but I've seen other comments from him that indicate code size is important for him as he knows that dnsmasq is used in embedded devices. I don't see embedded devices benefiting from this change. I'd be in a stronger position to refuse to do this if the code didn't already weed out filenames which look like .file and file~ and #file#. I'm an emacs user and those last two are emacs droppings. I guess the problem is knowing _which_ files should be ignored ( how many conventions are there?) and not ignoring files which someone, somewhere, thinks are perfectly OK and should be used. Cheers, Simon. ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss