Subject: Re: /etc/default
To: None <Chris_G_Demetriou@BALVENIE.PDL.CS.CMU.EDU>
From: Szabolcs Szigeti (PinkPanther) <>
List: current-users
Date: 07/24/1995 10:55:33
> > I was just playing with a svr4 machine (solaris) and really liked the
> > idea of /etc/default. Here you can define things like default device
> > for dump, without recompiling.
> so, uh, what reads these files, and sets the 'defaults'?
> > What is the general view about this? Is it a Good or a Bad thing?
> if the kernel has to read them, it's a Very Bad Idea.

Sorry, I wasn't clear about it, I meant defaults for user progs.

These files are read by user programs, like tar or dump
and info are extracted from them. This way you can edit /etc/default/tar
to contain, say /dev/rfd0a and then tar will make this as a default
device instead of /dev/rmt0.

I don't really know how it's done in svr4, so I describe here what
i've done.
I my implementation, i expanded the default files to contain an optional
subclass to be able to give more classes of defaults to one prog.
A library routine is provided:

val=getdefault(class, subclass, defdef). with this you'd be able
to say in dump(1) device=getdefault("dump", "device", "/dev/rmt0") and
                  bpi=atoi(getdefault("dump", "bpi", "1600"))

then you make a file /etc/default/dump which contains:

device /dev/rmt1
bpi 5600

of course this can be done by proper command line switches, or recompiling,
but they sometimes can be annoying, specially for the novice sysadmins.