LFS-6.0 print process

Bryan Kadzban bryan at kadzban.is-a-geek.net
Thu Jul 8 20:46:41 PDT 2004

Bryan Kadzban wrote:
> Nathan Coulson wrote:
>> Between the 3 of us, perhaps one of us wont get stuck (::.
> <snip lots of stuff>

Forgot to mention:  ifdown brings services down in the same order that
they were brought up, not the reverse order.  Keeping global variables
while reversing the order of everything else looks to be VERY hard.

Although it occurs to me now -- wouldn't it be a lot simpler to have
ifconfig.eth0 (or whatever) be a directory, with a file for each
protocol or address or whatever?  Then ifup can sort the files in one
direction, and ifdown can sort in the other.  Not sure how, but that can
be figured out later.

Each file's name can be the same as the name of the service (with a
couple digits at the start, for sequencing and allowing multiple
invocations of one service for the same interface).  If desired, each
file can even set LABEL (or whatever) to allow the service script to
tell them apart when giving messages to the user.

If we did it that way, we wouldn't have to read them in ifup at all.
We'd just do something like:

for SCRIPT in $network_devices/ifconfig.$1/*
     # a bit of error checking

     ${SCRIPT} $1 up

like before.  Each service script would find its $SERVICE as
${0##*/[0-9][0-9]} (or however many digits to strip off), then source
$network_devices/ifconfig.$1/$SERVICE to get the variables it needs, and
also $network_devices/ifconfig.$1/globals (if it exists) to get the
globals.  Or whatever we want to call them -- "all" would also work.
Then we don't have to worry about hardly any of the problems with my
previous patch.

The only issue is, it's not readily compatible with previous sysconfig
directories.  But that's easily worked around with a check whether
ifconfig.$1 is a file or directory -- and *that* is more backward
compatible than the previous patch.  The old processing can go into the
"file" branch of the check, and the new can go into the "directory"
branch.  Directories will require LABEL to be set in each file (if we
want that at all), while files won't.

I think that's the way to go, personally.  Forget my previous two
patches, I'll see what I can do with a directory based implementation
tomorrow.  Assuming more real-life stuff doesn't come up.

More information about the lfs-dev mailing list