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

Re: Goals for 1.3?




On Sat, 21 Dec 1996, Marek Michalkiewicz wrote:

> Hmm, I feel a little nervous about putting thigs like
> 
> SULOGIN=`cfgtool --get boot.sulogin`
> 
> at the very beginning of /etc/init.d/boot.  Why not just:

What about

        SULOGIN="`cfgdb --print /admin/boot/sulogin`" || SULOGIN="no"

In fact, I rewrote some of the scripts in /etc/init.d/ this way (but
featuring my own tool called "cfgdb" [formerly "nod"]).

I'm really concerned how nervous you get when you see my web-interface to
this database tool.  :-)
[I expect the not-so-fancy version for the end of next week.]


> . /etc/default/boot
>
> and have a tool to modify (carefully - create the new file with
> different name, fsync() it, then rename() it) files containing
> name=value pairs - the shell already gives us all the tools we
> need to read them.  Are there any problems with this?

Yes. Not with your careful programming, but with your use of defaults.

My understanding of "defaults" are "fallback values" which should be used
until I specify other ones. But I would never overwrite those defaults
because then they wouldn't be defaults any longer (according to my
definition).

It's the same situation as with the application defaults in
"/usr/X11R6/lib/X11/app-defaults": those files are read-only ...
If one wants to overwrite a setting from those app-defaults, it's
suggested he does not touch those files at all (otherwise his
modifications are lost at the time of the next upgrade).

"/etc/X11/Xresourses" (or even "~/.Xresources") is the way to go.

So sourcing in /etc/defaults/boot is ok as long as no tool modifies this
file. Even "dpkg" is happy with this policy because the sysadmin does not
need to modify the configuration files (= default configuration) a package
ships.

Above is the main idea behind my "cfgdb". It's more or less the equivalent
to "xrdb".


Now, I could also have used 

        . /etc/default/boot

        if cfgdb --exists /admin/boot/sulogin
        then
            VALUE="`cfgdb --print /admin/boot/sulogin`" && SULOGIN="$VALUE"
        fi

but this is less intuitive (people allready complained that "cfgdb" is not
intuitive at all). And if /etc/default/boot gets deleted, we are in
trouble, too. Therefore I would say hardcoding the default settings into
important shell-scripts is better (it's another issue when it comes to
not-so-mission-critical X-resources).


-Winfried


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-REQUEST@lists.debian.org . Trouble? e-mail to Bruce@Pixar.com


Reply to: