[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: init script config files



On Fri, Jul 07, 2000 at 04:49:09PM -0700, Joey Hess wrote:
> So it's really not that bad to go in and edit stuff if something has changed.
> This doesn't address the problem of what happens if an essential new variable
> needs to be added though. But I have a simple solution:
> 
> /etc/init.d/foo:
> 
> #!/bin/sh
> # Don't touch these ..
> FOO=bar
> NEWVAR=/tmp/killme
> # .. edit this file instead!
> if [ -f /etc/default/foo ]; then
> 	. /etc/default/foo
> fi
> #
> rm -rf /$NEWVAR
> start-stop-daemon foo -- $FOO
> 
> So the point is, init scripts could set all the variables to sane
> settings, and allow sourcing the file to overwrite those settings, and
> this becomes a non-problem.

perfect.  simple, easy, and extremely sensible.  in hindsight, the obvious
solution.

i had thought of (and dismissed) the idea of having two files in
/etc/default, one provided by the package and one edited by the
user...sourced in that order. but your idea does the same thing without
the ugly need for an extra file...much better.

craig

--
craig sanders



Reply to: