Re: processing order for configuration files in /etc/network/interfaces.d

2018-08-28 Thread David Wright
On Sun 26 Aug 2018 at 21:36:30 (+0300), Martin T wrote:
> Hi David,
> 
> > You need to post your evidence, starting with your /etc/network/interfaces
> > file. You say you're using ifup, so we can perhaps discount this paragraph:
> >
> >Currently, "source-directory" isn't supported by
> >network-manager and guessnet.

Actually, I haven't quite figured out what this means. AIUI if an
interface is defined in /e/n/i then NM shouldn't configure it anyway.
Does it mean that if you define one in a "source-directory" directory,
NM won't realise and so might try to configure it itself?

> > but we don't know whether you're using "source-directory" or "source",
> > for example.
> 
> I'm using "source":
> 
> # cat /etc/network/interfaces
> # This file describes the network interfaces available on your system
> # and how to activate them. For more information, see interfaces(5).
> 
> source /etc/network/interfaces.d/*
> #
> 
> > If you care about the order in which these files are sourced,
> > for the time being I would source them individually in the order you
> > want.
> 
> Yes, this is probably a good idea. However, ideally, "man interfaces"
> should state in which order files in /etc/network/interfaces.d/ are
> processed.

We also need to look at your evidence as to the configuration order
actually executed. I'm not yet convinced that your /tmp/interfaces_test
tells the right answer in view of the following statement:

   "When ifupdown is being called with the --all option, before doing
anything to interfaces, if calls all the hook scripts (pre-up or
down) with IFACE set to "--all", LOGICAL set to the current value
of --allow parameter (or "auto" if it's not set), ADDRFAM="meta"
and METHOD="none". After all the interfaces have been brought up
or taken down, the appropriate scripts (up or post-down) are
executed."

That includes  ifup -a  of course.

Cheers,
David.



Re: processing order for configuration files in /etc/network/interfaces.d

2018-08-27 Thread Reco
Hi.

On Mon, Aug 27, 2018 at 11:46:37AM -0500, David Wright wrote:
> On Mon 27 Aug 2018 at 19:24:01 (+0300), Reco wrote:
> > Hi.
> > 
> > On Mon, Aug 27, 2018 at 12:01:23PM -0400, Greg Wooledge wrote:
> > > On Mon, Aug 27, 2018 at 06:41:25PM +0300, Reco wrote:
> > > > Last sentence says to me that wordexp output should be always sorted.
> > > 
> > > This only tells us that it *reads* the config files in glob-sorted order.
> > > And peeking into the actual source code of ifupdown, yes, it appears to
> > > do this.  (File config.c starting at line 436, in the stretch source.)
> > > It even uses wordexp() as advertised.
> > > 
> > > What's less clear to me at this moment is what happens *after* the
> > > interface configuration file(s) have been read into memory.
> > > 
> > > Moving over to main.c, it looks like it reads the interfaces (line 639),
> > > and that function was called from line 1190.  After line 1190, it loops
> > > over the "target_iface" array, and processes them in the order they appear
> > > in that array.
> > > 
> > > So... next question is how they get packed into that array.
> > > 
> > > Returning to the select_interfaces function, it looks like the ordering
> > > is created by a call to find_allowup.
> > > 
> > > And... this is where I stopped reading, because it got confusing.  Maybe
> > > someone else can take a stab at deciphering that part.
> > 
> > select_interfaces() is called on "ifup -a" invocation.
> > read_interfaces() is called by it.
> > read_interfaces() calls read_interfaces_defn().
> > read_interfaces_defn() parses "iface" and "source" directives, and calls
> > read_interfaces_defn() once again on each file specified by "source" in
> > order defined by wordexp(3).
> > 
> > Therefore defn[] array should be filled in this order (assuming that one
> > specifies "source" only at /e/n/i):
> > 
> > 1) any interface definition at /e/n/i in order encountered, until
> > "source" directive.
> > 2) any interface definition provided by "source" directive in order
> > defined by wordexp(3).
> > 3) any interface definition at /e/n/i in order encountered, after the
> > "source" directive.
> > 
> > I'd use ltrace(1) to check it, but building test environment is
> > something that I lack the time to do.
> 
> That's still the order in which the stanzas are read. Don't we now
> need to know what the contents of each stanza is, ie is it an "auto"
> or an "allow-hotplug" stanza, etc?

I simplified things. After defn[] is filled at read_interfaces(),
find_allowup() is called, defn[] being the first argument.
find_allowup() iterates on defn[], using a pointer to defn->allowups.
defn->allowups, unless I'm reading it wrong, is filled by the same
read_interfaces_defn(), in the same order that /e/n/i and "source" are
evaluated.
This filling is done by add_allow_up() each time one specifies "auto" or
"allow-" stanzas.

Reco



Re: processing order for configuration files in /etc/network/interfaces.d

2018-08-27 Thread David Wright
On Mon 27 Aug 2018 at 19:24:01 (+0300), Reco wrote:
>   Hi.
> 
> On Mon, Aug 27, 2018 at 12:01:23PM -0400, Greg Wooledge wrote:
> > On Mon, Aug 27, 2018 at 06:41:25PM +0300, Reco wrote:
> > > Last sentence says to me that wordexp output should be always sorted.
> > 
> > This only tells us that it *reads* the config files in glob-sorted order.
> > And peeking into the actual source code of ifupdown, yes, it appears to
> > do this.  (File config.c starting at line 436, in the stretch source.)
> > It even uses wordexp() as advertised.
> > 
> > What's less clear to me at this moment is what happens *after* the
> > interface configuration file(s) have been read into memory.
> > 
> > Moving over to main.c, it looks like it reads the interfaces (line 639),
> > and that function was called from line 1190.  After line 1190, it loops
> > over the "target_iface" array, and processes them in the order they appear
> > in that array.
> > 
> > So... next question is how they get packed into that array.
> > 
> > Returning to the select_interfaces function, it looks like the ordering
> > is created by a call to find_allowup.
> > 
> > And... this is where I stopped reading, because it got confusing.  Maybe
> > someone else can take a stab at deciphering that part.
> 
> select_interfaces() is called on "ifup -a" invocation.
> read_interfaces() is called by it.
> read_interfaces() calls read_interfaces_defn().
> read_interfaces_defn() parses "iface" and "source" directives, and calls
> read_interfaces_defn() once again on each file specified by "source" in
> order defined by wordexp(3).
> 
> Therefore defn[] array should be filled in this order (assuming that one
> specifies "source" only at /e/n/i):
> 
> 1) any interface definition at /e/n/i in order encountered, until
> "source" directive.
> 2) any interface definition provided by "source" directive in order
> defined by wordexp(3).
> 3) any interface definition at /e/n/i in order encountered, after the
> "source" directive.
> 
> I'd use ltrace(1) to check it, but building test environment is
> something that I lack the time to do.

That's still the order in which the stanzas are read. Don't we now
need to know what the contents of each stanza is, ie is it an "auto"
or an "allow-hotplug" stanza, etc?

Cheers,
David.



Re: processing order for configuration files in /etc/network/interfaces.d

2018-08-27 Thread Reco
Hi.

On Mon, Aug 27, 2018 at 12:01:23PM -0400, Greg Wooledge wrote:
> On Mon, Aug 27, 2018 at 06:41:25PM +0300, Reco wrote:
> > Last sentence says to me that wordexp output should be always sorted.
> 
> This only tells us that it *reads* the config files in glob-sorted order.
> And peeking into the actual source code of ifupdown, yes, it appears to
> do this.  (File config.c starting at line 436, in the stretch source.)
> It even uses wordexp() as advertised.
> 
> What's less clear to me at this moment is what happens *after* the
> interface configuration file(s) have been read into memory.
> 
> Moving over to main.c, it looks like it reads the interfaces (line 639),
> and that function was called from line 1190.  After line 1190, it loops
> over the "target_iface" array, and processes them in the order they appear
> in that array.
> 
> So... next question is how they get packed into that array.
> 
> Returning to the select_interfaces function, it looks like the ordering
> is created by a call to find_allowup.
> 
> And... this is where I stopped reading, because it got confusing.  Maybe
> someone else can take a stab at deciphering that part.

select_interfaces() is called on "ifup -a" invocation.
read_interfaces() is called by it.
read_interfaces() calls read_interfaces_defn().
read_interfaces_defn() parses "iface" and "source" directives, and calls
read_interfaces_defn() once again on each file specified by "source" in
order defined by wordexp(3).

Therefore defn[] array should be filled in this order (assuming that one
specifies "source" only at /e/n/i):

1) any interface definition at /e/n/i in order encountered, until
"source" directive.
2) any interface definition provided by "source" directive in order
defined by wordexp(3).
3) any interface definition at /e/n/i in order encountered, after the
"source" directive.

I'd use ltrace(1) to check it, but building test environment is
something that I lack the time to do.

Reco



Re: processing order for configuration files in /etc/network/interfaces.d

2018-08-27 Thread Greg Wooledge
On Mon, Aug 27, 2018 at 06:41:25PM +0300, Reco wrote:
> Last sentence says to me that wordexp output should be always sorted.

This only tells us that it *reads* the config files in glob-sorted order.
And peeking into the actual source code of ifupdown, yes, it appears to
do this.  (File config.c starting at line 436, in the stretch source.)
It even uses wordexp() as advertised.

What's less clear to me at this moment is what happens *after* the
interface configuration file(s) have been read into memory.

Moving over to main.c, it looks like it reads the interfaces (line 639),
and that function was called from line 1190.  After line 1190, it loops
over the "target_iface" array, and processes them in the order they appear
in that array.

So... next question is how they get packed into that array.

Returning to the select_interfaces function, it looks like the ordering
is created by a call to find_allowup.

And... this is where I stopped reading, because it got confusing.  Maybe
someone else can take a stab at deciphering that part.



Re: processing order for configuration files in /etc/network/interfaces.d

2018-08-27 Thread tomas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Mon, Aug 27, 2018 at 06:41:25PM +0300, Reco wrote:

[...]

> Assuming that glibc stays true to POSIX, 2001 standard - [1] says that:
> 
> The wordexp() function [...] The words shall be in order as described
> in the Shell and Utilities volume of IEEE Std 1003.1-2001, Section
> 2.6, Word Expansions.
> 
> Last sentence says to me that wordexp output should be always sorted.

This seems to settle the case, yes.

Cheers
- -- tomás
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAluEHNsACgkQBcgs9XrR2kan9QCfQUNK0KiThl1I5+zJ8NEWbJRn
12UAnA0U3zRkVh3+WOeB6WFz5Jq3h01U
=r0MO
-END PGP SIGNATURE-



Re: processing order for configuration files in /etc/network/interfaces.d

2018-08-27 Thread Reco
Hi.

On Mon, Aug 27, 2018 at 04:49:06PM +0200, to...@tuxteam.de wrote:
> On Mon, Aug 27, 2018 at 04:32:26PM +0300, Reco wrote:
> > Hi.
> > 
> > On Mon, Aug 27, 2018 at 09:08:19AM -0400, Greg Wooledge wrote:
> > > > Hm. Interfaces man page refers to wordexp(3), but this one doesn't say
> > > > anything about sorted results
> > > 
> > > In the absence of such information, the best thing to conclude is that
> > > the order is unspecified.  It may be using the raw unsorted directory
> > > contents from readdir(3), or it may be starting them all in parallel
> > > threads, in which case the order will be nondeterministic.
> > 
> > wordexp(3) invokes glob(3).
> > 
> > glob(3) states that one *needs* to specify GLOB_NOSORT to get resultes
> > pathnames in no particular order, as by default the result will be
> > sorted.
> > 
> > Unless I'm reading glibc source wrong, the only non-default argument
> > that wordexp(3) passes to glob(3) is GLOB_NOCHECK.
> 
> Thanks for looking into the source.
> 
> The remaining problem is, since the doc seems pretty fuzzy about that,
> whether one can rely on this behaviour, or whether this is just an
> implementation detail which can change under one at any time.

Assuming that glibc stays true to POSIX, 2001 standard - [1] says that:

The wordexp() function shall store the number of generated words into
pwordexp->we_wordc and a pointer to a list of pointers to words in
pwordexp->we_wordv. Each individual field created during field splitting
(see the Shell and Utilities volume of IEEE Std 1003.1-2001, Section
2.6.5, Field Splitting) or pathname expansion (see the Shell and
Utilities volume of IEEE Std 1003.1-2001, Section 2.6.6, Pathname
Expansion) shall be a separate word in the pwordexp->we_wordv list. The
words shall be in order as described in the Shell and Utilities volume
of IEEE Std 1003.1-2001, Section 2.6, Word Expansions.

Last sentence says to me that wordexp output should be always sorted.

Latest edition I could find - 2017 standard - [2] contains similar
wording.

Reco

[1] http://pubs.opengroup.org/onlinepubs/009695299/functions/wordexp.html

[2] http://pubs.opengroup.org/onlinepubs/9699919799/



Re: processing order for configuration files in /etc/network/interfaces.d

2018-08-27 Thread tomas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Mon, Aug 27, 2018 at 04:32:26PM +0300, Reco wrote:
>   Hi.
> 
> On Mon, Aug 27, 2018 at 09:08:19AM -0400, Greg Wooledge wrote:
> > > Hm. Interfaces man page refers to wordexp(3), but this one doesn't say
> > > anything about sorted results
> > 
> > In the absence of such information, the best thing to conclude is that
> > the order is unspecified.  It may be using the raw unsorted directory
> > contents from readdir(3), or it may be starting them all in parallel
> > threads, in which case the order will be nondeterministic.
> 
> wordexp(3) invokes glob(3).
> 
> glob(3) states that one *needs* to specify GLOB_NOSORT to get resultes
> pathnames in no particular order, as by default the result will be
> sorted.
> 
> Unless I'm reading glibc source wrong, the only non-default argument
> that wordexp(3) passes to glob(3) is GLOB_NOCHECK.

Thanks for looking into the source.

The remaining problem is, since the doc seems pretty fuzzy about that,
whether one can rely on this behaviour, or whether this is just an
implementation detail which can change under one at any time.

Cheers
- -- t 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAluED2IACgkQBcgs9XrR2kZF+wCdFpzaW8GZDiKF4LxaJp/RJpG7
3VsAnjHEgqjKgjhu2i9pg+ORE3kqyyF/
=8T3S
-END PGP SIGNATURE-



Re: processing order for configuration files in /etc/network/interfaces.d

2018-08-27 Thread Reco
Hi.

On Mon, Aug 27, 2018 at 09:08:19AM -0400, Greg Wooledge wrote:
> > Hm. Interfaces man page refers to wordexp(3), but this one doesn't say
> > anything about sorted results
> 
> In the absence of such information, the best thing to conclude is that
> the order is unspecified.  It may be using the raw unsorted directory
> contents from readdir(3), or it may be starting them all in parallel
> threads, in which case the order will be nondeterministic.

wordexp(3) invokes glob(3).

glob(3) states that one *needs* to specify GLOB_NOSORT to get resultes
pathnames in no particular order, as by default the result will be
sorted.

Unless I'm reading glibc source wrong, the only non-default argument
that wordexp(3) passes to glob(3) is GLOB_NOCHECK.

Reco



Re: processing order for configuration files in /etc/network/interfaces.d

2018-08-27 Thread tomas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Mon, Aug 27, 2018 at 09:08:19AM -0400, Greg Wooledge wrote:
> On Mon, Aug 27, 2018 at 10:18:29AM +0200, to...@tuxteam.de wrote:
> > On Sun, Aug 26, 2018 at 09:36:30PM +0300, Martin T wrote:
> > > I'm using "source":
> > 
> > Wait a sec... this is not run-parts, then, but the shell builtin 'source'
> > you are using, like in:
> > 
> > > source /etc/network/interfaces.d/*
> 
> It's not a shell's builtin "source" [...]

Er... yes, you are right. That's a config item which is implemented
by wordexp(3), if we believe the interfaces man page. The above is
just leftovers from a post which I corrected (incompletely) after
I found out exactly this. Grmpf.

Note to self: always re-read a third time.

[...]

> In the absence of such information, the best thing to conclude is that
> the order is unspecified.  It may be using the raw unsorted directory
> contents from readdir(3), or it may be starting them all in parallel
> threads, in which case the order will be nondeterministic.

Agreed, although this seems somewhat unfortunate.

Cheers
- -- tomás
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAluD+3EACgkQBcgs9XrR2kZp4wCeMY7EMt74Q8N5VdzUERSg6Cwp
hiIAn1q5rEwqiINkspih37t730qPqkVL
=20hc
-END PGP SIGNATURE-



Re: processing order for configuration files in /etc/network/interfaces.d

2018-08-27 Thread Greg Wooledge
On Mon, Aug 27, 2018 at 10:18:29AM +0200, to...@tuxteam.de wrote:
> On Sun, Aug 26, 2018 at 09:36:30PM +0300, Martin T wrote:
> > I'm using "source":
> 
> Wait a sec... this is not run-parts, then, but the shell builtin 'source'
> you are using, like in:
> 
> > source /etc/network/interfaces.d/*

It's not a shell's builtin "source" command either, but rather, something
implemented by the Debian ifupdown software.

> Hm. Interfaces man page refers to wordexp(3), but this one doesn't say
> anything about sorted results

In the absence of such information, the best thing to conclude is that
the order is unspecified.  It may be using the raw unsorted directory
contents from readdir(3), or it may be starting them all in parallel
threads, in which case the order will be nondeterministic.



Re: processing order for configuration files in /etc/network/interfaces.d

2018-08-27 Thread tomas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Sun, Aug 26, 2018 at 09:36:30PM +0300, Martin T wrote:
> Hi David,
> 
> > You need to post your evidence, starting with your /etc/network/interfaces
> > file. You say you're using ifup, so we can perhaps discount this paragraph:
> >
> >Currently, "source-directory" isn't supported by
> >network-manager and guessnet.
> >
> > but we don't know whether you're using "source-directory" or "source",
> > for example.
> 
> I'm using "source":

Wait a sec... this is not run-parts, then, but the shell builtin 'source'
you are using, like in:

> # cat /etc/network/interfaces
> # This file describes the network interfaces available on your system
> # and how to activate them. For more information, see interfaces(5).
> 
> source /etc/network/interfaces.d/*
> #

Hm. Interfaces man page refers to wordexp(3), but this one doesn't say
anything about sorted results (although it cites glob as cousin which
_by default_ is sorted, although one can switch that off).

That's unfortunate.

> Yes, this is probably a good idea. However, ideally, "man interfaces"
> should state in which order files in /etc/network/interfaces.d/ are
> processed.

Definitely.

Sorry for bringing up "run-parts". That was a red herring.

Cheers
- -- tomás
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAluDs9UACgkQBcgs9XrR2kYMbgCfRZRIthRQROzHVnqd3WaV4HmZ
MG8An03Oe3OZZm1hJaRgiNBmfPpky4qj
=JATa
-END PGP SIGNATURE-



Re: processing order for configuration files in /etc/network/interfaces.d

2018-08-26 Thread Zenaan Harkness
On Sun, Aug 26, 2018 at 09:36:30PM +0300, Martin T wrote:
> Hi David,
> 
> > You need to post your evidence, starting with your /etc/network/interfaces
> > file. You say you're using ifup, so we can perhaps discount this paragraph:
> >
> >Currently, "source-directory" isn't supported by
> >network-manager and guessnet.
> >
> > but we don't know whether you're using "source-directory" or "source",
> > for example.
> 
> I'm using "source":
> 
> # cat /etc/network/interfaces
> # This file describes the network interfaces available on your system
> # and how to activate them. For more information, see interfaces(5).
> 
> source /etc/network/interfaces.d/*
> #
> 
> > If you care about the order in which these files are sourced,
> > for the time being I would source them individually in the order you
> > want.
> 
> Yes, this is probably a good idea. However, ideally, "man interfaces"
> should state in which order files in /etc/network/interfaces.d/ are
> processed.

It should indeed, and it should also be in lexical order according to
"C" utf-8 "locale", in a manner similar to "run-parts".

Perhaps you could raise a bug for this - it certainly feels
appropriate to do so.



Re: processing order for configuration files in /etc/network/interfaces.d

2018-08-26 Thread Martin T
Hi David,

> You need to post your evidence, starting with your /etc/network/interfaces
> file. You say you're using ifup, so we can perhaps discount this paragraph:
>
>Currently, "source-directory" isn't supported by
>network-manager and guessnet.
>
> but we don't know whether you're using "source-directory" or "source",
> for example.

I'm using "source":

# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*
#

> If you care about the order in which these files are sourced,
> for the time being I would source them individually in the order you
> want.

Yes, this is probably a good idea. However, ideally, "man interfaces"
should state in which order files in /etc/network/interfaces.d/ are
processed.


Martin



Re: processing order for configuration files in /etc/network/interfaces.d

2018-08-26 Thread David Wright
On Sun 26 Aug 2018 at 15:41:05 (+0300), Martin T wrote:
> On Thu, Aug 23, 2018 at 6:04 PM  wrote:
> > On Thu, Aug 23, 2018 at 05:31:57PM +0300, Martin T wrote:
> > > According to "man interfaces", the ifup brings the named interfaces up
> > > in the order listed in /etc/network/interfaces file. However, what is
> > > the order for files in /etc/network/interfaces.d/? Alphabetical, i.e
> > > same as "ls -l /etc/network/interfaces.d/"?
> >
> > I assume the files there are invoked by run-parts (man interfaces(5) at
> > least hints at that). In that case yes, they are run in lexical order.
> >
> > But I'd double-check the run-parts part (heh). I've been caught spewing
> > nonsense here ;-)
> I added "pre-up echo $IFACE >> /tmp/interfaces_test" line to each
> interface configuratio file in /etc/network/interfaces.d/ and looks
> like the invoke order is not lexical. I have four files in
> /etc/network/interfaces.d/:
> 
> # ls -l /etc/network/interfaces.d/
> total 16
> -rw-r--r-- 1 root root 338 Aug 26 14:10 br0
> -rw-r--r-- 1 root root 555 Aug 26 14:10 eth0
> -rw-r--r-- 1 root root  96 Aug 26 14:09 eth0.100
> -rw-r--r-- 1 root root 109 Aug 26 14:09 lo
> #
> 
> However, the content of the /tmp/interfaces_test is alwayse(I rebooted
> the machine 5 times) following:
> 
> # cat /tmp/interfaces_test
> br0
> lo
> eth0
> eth0.100
> #
> 
> I thought that ifup processes those files in order which they appear
> in /etc/network/interfaces.d/*, but this does not seem to be true. Any
> other ideas?

You need to post your evidence, starting with your /etc/network/interfaces
file. You say you're using ifup, so we can perhaps discount this paragraph:

   Currently, "source-directory" isn't supported by
   network-manager and guessnet.

but we don't know whether you're using "source-directory" or "source",
for example. The former might not be expected to run eth0.100 at all.
There's conflicting evidence on the web about such matters.

If you care about the order in which these files are sourced,
for the time being I would source them individually in the order you
want. I'm not sure where the lexical sorting is documented, but man
interfaces(5) does not yield much when searched for "lex", "sort"
and "order".

I'd be interested to find the script(s) that the system is using to
select configuration files for execution, and to see if it agrees
with the documentation (which is a bit lax here).

Cheers,
David.



Re: processing order for configuration files in /etc/network/interfaces.d

2018-08-26 Thread Martin T
On Thu, Aug 23, 2018 at 6:04 PM  wrote:
>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> On Thu, Aug 23, 2018 at 05:31:57PM +0300, Martin T wrote:
> > Hi!
> >
> > According to "man interfaces", the ifup brings the named interfaces up
> > in the order listed in /etc/network/interfaces file. However, what is
> > the order for files in /etc/network/interfaces.d/? Alphabetical, i.e
> > same as "ls -l /etc/network/interfaces.d/"?
>
> I assume the files there are invoked by run-parts (man interfaces(5) at
> least hints at that). In that case yes, they are run in lexical order.
>
> But I'd double-check the run-parts part (heh). I've been caught spewing
> nonsense here ;-)
>
> Cheers
> - -- tomás
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.12 (GNU/Linux)
>
> iEYEARECAAYFAlt+zN8ACgkQBcgs9XrR2kbV9wCeKwl3eILQA2d5rA6QgDKIIwQy
> 5scAn1NM68w35jLdQxrcD6F1dqCNpRpI
> =JRHj
> -END PGP SIGNATURE-
>

Tomas,

I added "pre-up echo $IFACE >> /tmp/interfaces_test" line to each
interface configuratio file in /etc/network/interfaces.d/ and looks
like the invoke order is not lexical. I have four files in
/etc/network/interfaces.d/:

# ls -l /etc/network/interfaces.d/
total 16
-rw-r--r-- 1 root root 338 Aug 26 14:10 br0
-rw-r--r-- 1 root root 555 Aug 26 14:10 eth0
-rw-r--r-- 1 root root  96 Aug 26 14:09 eth0.100
-rw-r--r-- 1 root root 109 Aug 26 14:09 lo
#

However, the content of the /tmp/interfaces_test is alwayse(I rebooted
the machine 5 times) following:

# cat /tmp/interfaces_test
br0
lo
eth0
eth0.100
#

I thought that ifup processes those files in order which they appear
in /etc/network/interfaces.d/*, but this does not seem to be true. Any
other ideas?


thanks,
Martin



Re: processing order for configuration files in /etc/network/interfaces.d

2018-08-23 Thread tomas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Thu, Aug 23, 2018 at 05:31:57PM +0300, Martin T wrote:
> Hi!
> 
> According to "man interfaces", the ifup brings the named interfaces up
> in the order listed in /etc/network/interfaces file. However, what is
> the order for files in /etc/network/interfaces.d/? Alphabetical, i.e
> same as "ls -l /etc/network/interfaces.d/"?

I assume the files there are invoked by run-parts (man interfaces(5) at
least hints at that). In that case yes, they are run in lexical order.

But I'd double-check the run-parts part (heh). I've been caught spewing
nonsense here ;-)

Cheers
- -- tomás
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlt+zN8ACgkQBcgs9XrR2kbV9wCeKwl3eILQA2d5rA6QgDKIIwQy
5scAn1NM68w35jLdQxrcD6F1dqCNpRpI
=JRHj
-END PGP SIGNATURE-



processing order for configuration files in /etc/network/interfaces.d

2018-08-23 Thread Martin T
Hi!

According to "man interfaces", the ifup brings the named interfaces up
in the order listed in /etc/network/interfaces file. However, what is
the order for files in /etc/network/interfaces.d/? Alphabetical, i.e
same as "ls -l /etc/network/interfaces.d/"?


thanks,
Martin