Debian Bug report logs -
#159884
ifupdown: please consider adding include directive for /e/n/i
Reported by: Marc Haber <mh+debian-bugs@zugschlus.de>
Date: Fri, 6 Sep 2002 19:18:11 UTC
Severity: wishlist
Merged with 149395,
471834
Found in versions 0.6.4-4, 0.6.4-4.4tpl5
Fixed in version ifupdown/0.7~alpha4
Done: bugzilla@tut.by (Andrew O. Shadoura)
Bug is archived. No further changes may be made.
Toggle useless messages
Report forwarded to Anthony Towns <ajt@debian.org>, ifupdown@packages.qa.debian.org:
Bug#159884; Package ifupdown.
(full text, mbox, link).
Acknowledgement sent to Marc Haber <mh+debian-bugs@zugschlus.de>:
New Bug report received and forwarded. Copy sent to Anthony Towns <ajt@debian.org>, ifupdown@packages.qa.debian.org.
(full text, mbox, link).
Message #5 received at maintonly@bugs.debian.org (full text, mbox, reply):
Package: ifupdown
Version: 0.6.4-4.4tpl5
Severity: wishlist
Please consider adding the possibility to include files in
/etc/network/interfaces. We use Debian to have redundant routers, and
need some IPs to be the same on all machines in the cluster, and some
to be not the same.
We would like to have the "machine dependent" IP addresses in /e/n/i,
and to be able to include the "service dependent" IP addresses in some
other file that is included into /e/n/i to be able to rsync that
"other file" over all participating machines.
Greetings
Marc
-- System Information
Debian Release: 3.0
Architecture: i386
Kernel: Linux torres 2.4.19-psmp #1 Wed Aug 21 13:11:37 UTC 2002 i586
Locale: LANG=C, LC_CTYPE=de_DE
Versions of packages ifupdown depends on:
ii libc6 2.2.5-11.1 GNU C Library: Shared libraries an
ii net-tools 1.60-4 The NET-3 networking toolkit
Information forwarded
to debian-bugs-dist@lists.debian.org, Anthony Towns <ajt@debian.org>:
Bug#159884; Package ifupdown.
(Wed, 06 Jan 2010 11:48:03 GMT) (full text, mbox, link).
Acknowledgement sent
to "Andrew O. Shadoura" <bugzilla@tut.by>:
Extra info received and forwarded to list. Copy sent to Anthony Towns <ajt@debian.org>.
(Wed, 06 Jan 2010 11:48:03 GMT) (full text, mbox, link).
Message #12 received at 159884@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
Hello.
This patch adds "source" directive to ifupdown.
The syntax is:
source filename
--
WBR, Andrew
[ifupdown-source.patch (text/x-patch, inline)]
--- ifupdown-0.7~alpha3.orig/ifupdown.nw 2007-12-21 16:22:19.000000000 +0200
+++ ifupdown-0.7~alpha3/ifupdown.nw 2010-01-06 13:14:07.346693395 +0200
@@ -1233,14 +1233,20 @@
<<exported symbols>>=
interfaces_file *read_interfaces(char *filename);
+interfaces_file *read_interfaces_defn(interfaces_file *defn, char *filename);
@
<<config functions>>=
interfaces_file *read_interfaces(char *filename) {
- <<variables local to read interfaces>>
interfaces_file *defn;
<<allocate defn or [[return NULL]]>>
+ return read_interfaces_defn(defn, filename);
+}
+
+interfaces_file *read_interfaces_defn(interfaces_file *defn, char *filename) {
+ <<variables local to read interfaces>>
+
<<open file or [[return NULL]]>>
while (<<we've gotten a line from the file>>) {
@@ -1562,6 +1568,9 @@
if (strcmp(firstword, "mapping") == 0) {
<<process [[mapping]] line>>
currently_processing = MAPPING;
+} else if (strcmp(firstword, "source") == 0) {
+ <<process [[source]] line>>
+ currently_processing = NONE;
} else if (strcmp(firstword, "iface") == 0) {
<<process [[iface]] line>>
currently_processing = IFACE;
@@ -1590,6 +1599,18 @@
}
@
+\subsubsection{Source Line}
+
+To source another file, we just call [[read_interfaces_defn]] again.
+
+<<process [[source]] line>>=
+<<read interfaces recursively into already allocated defn>>
+@
+
+<<read interfaces recursively into already allocated defn>>=
+read_interfaces_defn(defn, rest);
+@
+
\subsubsection{Mapping Line}
Declaring a new mapping is reasonably copewithable --- we need to process
--- ifupdown-0.7~alpha3.orig/interfaces.5.pre 2007-12-21 15:30:54.000000000 +0200
+++ ifupdown-0.7~alpha3/interfaces.5.pre 2010-01-06 13:17:32.662869787 +0200
@@ -29,14 +29,16 @@
A line may be extended across multiple lines by making the last character
a backslash.
.P
-The file consists of zero or more "iface", "mapping", "auto" and "allow-"
-stanzas. Here is an example.
+The file consists of zero or more "iface", "mapping", "auto", "allow-" and
+"source" stanzas. Here is an example.
.EX
auto lo eth0
allow-hotplug eth1
iface lo inet loopback
+source interfaces.d/machine\-dependent
+
mapping eth0
script /usr/local/sbin/map\-scheme
map HOME eth0\-home
@@ -68,6 +70,10 @@
up eth0 or eth1 if it is listed in an "allow-hotplug" line. Note that
"allow-auto" and "auto" are synonyms.
.P
+Lines beginning with "source" are used to include stanzas from other files,
+so configuration can be split into many files. The word "source" is
+followed by the path of file to be sourced.
+.P
Stanzas beginning with the word "mapping" are used to determine how a
logical interface name is chosen for a physical interface that is to be
brought up. The first line of a mapping stanza consists of the word
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to debian-bugs-dist@lists.debian.org, Anthony Towns <ajt@debian.org>:
Bug#159884; Package ifupdown.
(Thu, 27 May 2010 22:39:06 GMT) (full text, mbox, link).
Acknowledgement sent
to jay binks <jaybinks@gmail.com>:
Extra info received and forwarded to list. Copy sent to Anthony Towns <ajt@debian.org>.
(Thu, 27 May 2010 22:39:06 GMT) (full text, mbox, link).
Message #17 received at 159884@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
PLEASE can we have /etc/network/interfaces.d/ parsed as well as
/etc/network/interfaces
so basically the same as what apache does.
I will see if I can write a patch that does this and submit it here
but I thought id add my 2c first
--
Sincerely
Jay
[Message part 2 (text/html, inline)]
Information forwarded
to debian-bugs-dist@lists.debian.org, Anthony Towns <ajt@debian.org>:
Bug#159884; Package ifupdown.
(Sat, 02 Oct 2010 13:33:03 GMT) (full text, mbox, link).
Acknowledgement sent
to "Andrew O. Shadoura" <bugzilla@tut.by>:
Extra info received and forwarded to list. Copy sent to Anthony Towns <ajt@debian.org>.
(Sat, 02 Oct 2010 13:33:03 GMT) (full text, mbox, link).
Message #22 received at 159884@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
Hello.
This is the updated version of the patch above, supporting glob-like
wildcards, tilde expansion and environment variable expansion as per
wordexp(3).
The syntax is still the same:
source /etc/network/interfaces.d/*
--
WBR, Andrew
[ifupdown-source-wordexp.patch (text/x-patch, inline)]
diff -pu ifupdown-0.7~alpha3.orig/ifupdown.nw ifupdown-0.7~alpha3/ifupdown.nw
--- ifupdown-0.7~alpha3.orig/ifupdown.nw 2007-12-21 16:22:19.000000000 +0200
+++ ifupdown-0.7~alpha3/ifupdown.nw 2010-10-02 16:12:20.000000000 +0300
@@ -1233,14 +1233,20 @@ helpful error message. Pretty simple, he
<<exported symbols>>=
interfaces_file *read_interfaces(char *filename);
+interfaces_file *read_interfaces_defn(interfaces_file *defn, char *filename);
@
<<config functions>>=
interfaces_file *read_interfaces(char *filename) {
- <<variables local to read interfaces>>
interfaces_file *defn;
<<allocate defn or [[return NULL]]>>
+ return read_interfaces_defn(defn, filename);
+}
+
+interfaces_file *read_interfaces_defn(interfaces_file *defn, char *filename) {
+ <<variables local to read interfaces>>
+
<<open file or [[return NULL]]>>
while (<<we've gotten a line from the file>>) {
@@ -1562,6 +1568,9 @@ if (rest == NULL) continue; /* blank lin
if (strcmp(firstword, "mapping") == 0) {
<<process [[mapping]] line>>
currently_processing = MAPPING;
+} else if (strcmp(firstword, "source") == 0) {
+ <<process [[source]] line>>
+ currently_processing = NONE;
} else if (strcmp(firstword, "iface") == 0) {
<<process [[iface]] line>>
currently_processing = IFACE;
@@ -1590,6 +1599,37 @@ switch(currently_processing) {
}
@
+\subsubsection{Source Line}
+
+% To source another file, we just call [[read_interfaces_defn]] again.
+
+When processing the [[source]] stanza, we use [[wordexp]] function to expand wildcards
+and environment variables.
+
+<<config headers>>=
+#include <wordexp.h>
+@
+
+We use [[WRDE_NOCMD]] flag, so no command substitution occurs
+because of security concerns. Then we go through the output array and read interfaces
+recursively into already allocated [[defn]].
+
+<<process [[source]] line>>=
+wordexp_t p;
+char ** w;
+int i;
+int fail = wordexp(rest, &p, WRDE_NOCMD);
+if (!fail)
+{
+ w = p.we_wordv;
+ for (i = 0; i < p.we_wordc; i++)
+ {
+ read_interfaces_defn(defn, w[i]);
+ }
+ wordfree(&p);
+}
+@
+
\subsubsection{Mapping Line}
Declaring a new mapping is reasonably copewithable --- we need to process
diff -pu ifupdown-0.7~alpha3.orig/interfaces.5.pre ifupdown-0.7~alpha3/interfaces.5.pre
--- ifupdown-0.7~alpha3.orig/interfaces.5.pre 2007-12-21 15:30:54.000000000 +0200
+++ ifupdown-0.7~alpha3/interfaces.5.pre 2010-10-02 16:20:59.000000000 +0300
@@ -29,14 +29,16 @@ NOT supported, comments must be on a lin
A line may be extended across multiple lines by making the last character
a backslash.
.P
-The file consists of zero or more "iface", "mapping", "auto" and "allow-"
-stanzas. Here is an example.
+The file consists of zero or more "iface", "mapping", "auto", "allow-" and
+"source" stanzas. Here is an example.
.EX
auto lo eth0
allow-hotplug eth1
iface lo inet loopback
+source interfaces.d/machine\-dependent
+
mapping eth0
script /usr/local/sbin/map\-scheme
map HOME eth0\-home
@@ -68,6 +70,14 @@ a command such as "ifup \-\-allow=hotplu
up eth0 or eth1 if it is listed in an "allow-hotplug" line. Note that
"allow-auto" and "auto" are synonyms.
.P
+Lines beginning with "source" are used to include stanzas from other files,
+so configuration can be split into many files. The word "source" is
+followed by the path of file to be sourced. Shell wildcards can be
+used.
+(See
+.BR wordexp (3)
+for details.)
+.P
Stanzas beginning with the word "mapping" are used to determine how a
logical interface name is chosen for a physical interface that is to be
brought up. The first line of a mapping stanza consists of the word
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to debian-bugs-dist@lists.debian.org, Anthony Towns <ajt@debian.org>:
Bug#159884; Package ifupdown.
(Mon, 21 Feb 2011 09:21:06 GMT) (full text, mbox, link).
Acknowledgement sent
to Kirill Smelkov <kirr@mns.spb.ru>:
Extra info received and forwarded to list. Copy sent to Anthony Towns <ajt@debian.org>.
(Mon, 21 Feb 2011 09:21:06 GMT) (full text, mbox, link).
Message #27 received at 159884@bugs.debian.org (full text, mbox, reply):
On Sat, Oct 02, 2010 at 04:31:13PM +0300, Andrew O. Shadoura wrote:
> Hello.
>
> This is the updated version of the patch above, supporting glob-like
> wildcards, tilde expansion and environment variable expansion as per
> wordexp(3).
>
> The syntax is still the same:
>
> source /etc/network/interfaces.d/*
Thanks a lot!
Can we please get this merged for wheezy?
Added tag(s) pending.
Request was from Andrew O. Shadoura <bugzilla@tut.by>
to control@bugs.debian.org.
(Wed, 20 Apr 2011 09:16:29 GMT) (full text, mbox, link).
Forcibly Merged 149395 159884 471834.
Request was from Andrew O. Shadoura <bugzilla@tut.by>
to control@bugs.debian.org.
(Wed, 20 Apr 2011 09:33:15 GMT) (full text, mbox, link).
Reply sent
to bugzilla@tut.by (Andrew O. Shadoura):
You have taken responsibility.
(Wed, 08 Jun 2011 12:51:47 GMT) (full text, mbox, link).
Notification sent
to Marc Haber <mh+debian-bugs@zugschlus.de>:
Bug acknowledged by developer.
(Wed, 08 Jun 2011 12:51:47 GMT) (full text, mbox, link).
Message #36 received at 159884-close@bugs.debian.org (full text, mbox, reply):
Source: ifupdown
Source-Version: 0.7~alpha4
We believe that the bug you reported is fixed in the latest version of
ifupdown, which is due to be installed in the Debian FTP archive:
ifupdown_0.7~alpha4.dsc
to main/i/ifupdown/ifupdown_0.7~alpha4.dsc
ifupdown_0.7~alpha4.tar.gz
to main/i/ifupdown/ifupdown_0.7~alpha4.tar.gz
ifupdown_0.7~alpha4_amd64.deb
to main/i/ifupdown/ifupdown_0.7~alpha4_amd64.deb
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 159884@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Andrew O. Shadoura <bugzilla@tut.by> (supplier of updated ifupdown package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160
Format: 1.8
Date: Wed, 08 Jun 2011 12:10:14 +0300
Source: ifupdown
Binary: ifupdown
Architecture: source amd64
Version: 0.7~alpha4
Distribution: experimental
Urgency: low
Maintainer: Andrew O. Shadoura <bugzilla@tut.by>
Changed-By: Andrew O. Shadoura <bugzilla@tut.by>
Description:
ifupdown - high level tools to configure network interfaces
Closes: 149395 158089 159884 196877 357929 384143 389996 408453 415285 417718 460276 471834 518924 520576 575110 584530 601705 604136 607713 610238
Changes:
ifupdown (0.7~alpha4) experimental; urgency=low
.
* New maintainer.
* Removed VCS repository from the tarball (Closes: #417718).
* Add source stanza (Closes: #159884, #149395, #471834).
* Fix bashism in example script get-mac-address.sh (Closes: #518924).
* Use DebSrc3.0 source format and dh7.
* Add auto method for IPv6, fix static method (Closes: #604136).
* Update URL for Debian Reference (Closes: #610238).
* Fix typos in the man page (Closes: #384143, #415285).
* Add GRE and IPIP tunnels support (Closes: #158089).
* Fix inet/static pointopoint option (Closes: #460276).
* Add support for enabling/disabling IPv6 privacy extension
(Closes: #520576).
* Move network state file to /run/network (Closes: #389996).
* Fix init script dependencies (Closes: #607713, #601705).
* Add MTU setting for v4tunnel (Closes: #408453, #575110).
* Allow multiple interface definitions to ease work with multiple IP per
interface.
* Allow passing PPP options, pass updetach by default (Closes: #196877).
* Add 6to4 tunnels support (Closes: #357929).
* Add CAN interface support (Closes: #584530).
* Drop 0.5.x migration script.
* Drop dependency on net-tools; suggest it instead.
* Bump Standards-Version to 3.9.2.
Checksums-Sha1:
9bec1b939c57b7aae09a8a4499c3066aaaaa19c2 797 ifupdown_0.7~alpha4.dsc
c3224838c1989925bad1c836788337f8d9cf847f 89299 ifupdown_0.7~alpha4.tar.gz
eb2502dc6efd215c320d4ea78c56669f5544148f 50234 ifupdown_0.7~alpha4_amd64.deb
Checksums-Sha256:
6f07fa02edd18666b7bb8bfea696575d95ff1bf3d17172c704ef9b419ae1047d 797 ifupdown_0.7~alpha4.dsc
c524c9e187c73a2edc652f4349a064599447eca89e8ac253a7e4d9cdb796e481 89299 ifupdown_0.7~alpha4.tar.gz
1d033c47bef1ebedd5b301ded455c73a654623b16784f5055cf035093734b205 50234 ifupdown_0.7~alpha4_amd64.deb
Files:
04f1dfcf3bf39033c8b7a736f3382b52 797 admin important ifupdown_0.7~alpha4.dsc
a48e206dadfdb2f4c11cfcca995369f3 89299 admin important ifupdown_0.7~alpha4.tar.gz
f2165f61e612e1572d3012f7c8fa7eec 50234 admin important ifupdown_0.7~alpha4_amd64.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iEYEAREDAAYFAk3vY5kACgkQVcFcaSW/uEhUSgCgz3bP6D/Ye/bSYiQWXX7QqwjI
604Ani6ozVwQF1Sr3bCZq2L0wga3CtV8
=bZeW
-----END PGP SIGNATURE-----
Reply sent
to bugzilla@tut.by (Andrew O. Shadoura):
You have taken responsibility.
(Wed, 08 Jun 2011 12:51:47 GMT) (full text, mbox, link).
Notification sent
to Andras Korn <korn-debbugs@chardonnay.math.bme.hu>:
Bug acknowledged by developer.
(Wed, 08 Jun 2011 12:51:48 GMT) (full text, mbox, link).
Reply sent
to bugzilla@tut.by (Andrew O. Shadoura):
You have taken responsibility.
(Wed, 08 Jun 2011 12:51:48 GMT) (full text, mbox, link).
Notification sent
to Bartosz Fenski aka fEnIo <fenio@debian.org>:
Bug acknowledged by developer.
(Wed, 08 Jun 2011 12:51:48 GMT) (full text, mbox, link).
Bug archived.
Request was from Debbugs Internal Request <owner@bugs.debian.org>
to internal_control@bugs.debian.org.
(Tue, 15 May 2012 07:37:57 GMT) (full text, mbox, link).
Send a report that this bug log contains spam.
Debian bug tracking system administrator <owner@bugs.debian.org>.
Last modified:
Sat Jan 6 02:37:02 2018;
Machine Name:
buxtehude
Debian Bug tracking system
Debbugs is free software and licensed under the terms of the GNU
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.
Copyright © 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson,
2005-2017 Don Armstrong, and many other contributors.