Your message dated Fri, 09 Aug 2013 16:04:00 +0000
with message-id <[email protected]>
and subject line Bug#712869: fixed in uruk 20130809-1
has caused the Debian Bug report #712869,
regarding [wsl.uvt.nl: Re: [uruk] autodetect met /sbin/ip patch]
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
712869: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=712869
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: uruk


Hi Casper and Wessel,

Thanks, I'll apply it soonish.  Patch for documentation/NEWS-file welcome too.

Bye,

Joost


Casper Gielen wrote:

----

hierbij een kleine patch die ip-autodetectie met behulp van /sbin/ip
toevoegt. De code komt uit onze rc-file en is waarschijnlijk door Wessel
geschreven. De huidige autodetectie-code werkt prima voor normale
systemen maar niet voor onze Blackboard-systemen.

De foutieve aanname is dat als /lib/uruk/init/autodetect-ips bestaat dat
er dan ook altijd een /etc/sysconfig/network-scripts/ifcfg-eth? (of
/etc/network/interfaces) bestaat.

Dit probleem is aan het licht gekomen nu we ook Redhat-systemen
autoconfigureren. Ik dacht hier een oplossing voor te hebben door een
'pre' file te gebruiken. In test werkt dat prima maar in praktijk moet
die code draaien voor dat er een schrijfbaar filesystem beschikbaar is.
Ook dat gaat in praktijk goed zolang je die file maar van te voren
aanmaakt en je IP niet veranderd tijdens een reboot,
Helaas is dat precies wat er wel gebeurd wanneer je een kloon maakt.

Vandaar deze patch die autodetectie doet met /sbin/ip als de andere
methodes niet werken. Een klein nadeel is dat we huidige de code nog
niet kunnen schrappen uit de 'rc' file zonder te controleren dat alle
systemen een moderne uruk hebben (met autodetect-ips).

--------


There is an objection to this patch as it likely to fail in practice.
This code assumes that the interface is up when Uruk starts. That may
not be the case, especially on systems with a non-standard
network-configuration.
However, that situation is currently not supported either, so nothing
will be broken that isn't failing already.


My specific use-case is that the interface is configured by udev and not
through the normal configuration files. The /sbin/ip method works fine
but it is not used as it is not in autodetect-ips. Therefor I moved the
/sbin/ip method to autodetect-ips.


------




----- Forwarded message from Wessel Dankers <wsl.uvt.nl> -----

Date: Thu, 20 Jun 2013 12:16:36 +0200
From: Wessel Dankers
Subject: Re: [uruk] autodetect met /sbin/ip patch
Message-ID: <[email protected]>
References: <[email protected]> <[email protected]> 
<[email protected]>
        <[email protected]> <[email protected]>
In-Reply-To: <[email protected]>
X-oi: oi
X-Organization: Universiteit van Tilburg: IT Services

Hoi,

On 2013‒06‒20 12:14:21+0200, Wessel Dankers wrote:
> On 2013‒06‒20 12:03:20+0200, Casper Gielen wrote:
>> patch cancelled. sorry, the last patch breaks on debian. I have no time
>> to fix it properly. maybe later.
>
> Geattacht een versie die misschien wel gaat werken. Niet uitputtend kunnen
> testen.

Zeg ik.

Met vriendelijke groet,

-- 
Wessel Dankers <wsl.uvt.nl> – LIS UNIX®                                 あ!


diff --git a/uruk/init/autodetect-ips b/uruk/init/autodetect-ips
index 56946aa..13b626d 100644
--- a/uruk/init/autodetect-ips
+++ b/uruk/init/autodetect-ips
@@ -6,6 +6,7 @@
 #   net{,6}_<interface>_default
 
 # Copyright © 2012 Wessel Dankers
+# Copyright © 2013 Casper Gielen
 
 # This file is free software; you can redistribute it and/or modify it under
 # the terms of the GNU General Public License as published by the Free
@@ -32,6 +33,7 @@
 # For each interface <if> in interfaces, ip_<if> should be defined.
 
 # First try Red Hat's init scripts
+found_rhel_network_script=false
 for f in /etc/sysconfig/network-scripts/ifcfg-*
 do
     test -e $f || continue
@@ -46,11 +48,15 @@ do
         echo ip6_${i}_default=${IPV6ADDR%/*}
         echo net6_${i}_default=$IPV6ADDR
     )"
+       found_rhel_network_script=true
 done
 
-# Second, Debian's init scripts
-if test -f /etc/network/interfaces
+if $found_rhel_network_script
 then
+       # nothing to do
+elif test -f /etc/network/interfaces
+then
+       # Second, Debian's init scripts
     eval "$(
         while read -r key val val1 rest
         do
@@ -84,5 +90,21 @@ then
             esac
         done </etc/network/interfaces
     )"
-fi
+elif test -x /sbin/ip
+then
+       # This may fail when using DHCP: in that case the interface address
+       # may not be configured yet when this piece of code is ran. You can
+       # hardcode the addresses in $etcdir/ip or change the boot order.
 
+       for i in $interfaces
+       do
+               autodetect_cidr=$(/sbin/ip a l $i | awk '$1 == "inet" { print 
$2; exit }')
+               eval ip_${i}_default=${autodetect_cidr%/*}
+
+               # inet6 fe80::250:56ff:fe31:3831/64 scope link
+               # we rely on the first match being 'scope global'.
+               # we want to set the IP even if theres only a 'scope link' one.
+               autodetect_ipv6=$(/sbin/ip a l $i | awk '$1 == "inet6" { print 
$2; exit }')
+               eval ip6_${i}_default=${autodetect_ipv6%/*}
+       done
+fi




----- End forwarded message -----

Attachment: signature.asc
Description: Digital signature


--- End Message ---
--- Begin Message ---
Source: uruk
Source-Version: 20130809-1

We believe that the bug you reported is fixed in the latest version of
uruk, which is due to be installed in the Debian FTP archive.

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 [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Joost van Baal-Ilić <[email protected]> (supplier of updated uruk 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 [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Fri, 02 Aug 2013 08:14:42 +0200
Source: uruk
Binary: uruk
Architecture: source all
Version: 20130809-1
Distribution: unstable
Urgency: low
Maintainer: Joost van Baal-Ilić <[email protected]>
Changed-By: Joost van Baal-Ilić <[email protected]>
Description: 
 uruk       - Very small firewall script, for configuring iptables
Closes: 712869
Changes: 
 uruk (20130809-1) unstable; urgency=low
 .
   * New upstream release: The Corbeşti Release.  (Missed 20130619 The Het De
     Siptenpad Release.)
     - init/autodetect-ips: detect IPs currently assigned to interfaces by
       calling ip(8) if needed. Closes: #712869
   * copyright: updated.
Checksums-Sha1: 
 8ad522501ce20518302bb29c05e1a0493d1a50f9 1346 uruk_20130809-1.dsc
 c70064936625319b3028f7fd85836845b6c9bfed 211670 uruk_20130809.orig.tar.gz
 f9e63870fb23fd38d6bfbc68e956017c934d824e 10336 uruk_20130809-1.debian.tar.gz
 dae78d60dbf0c1f7ce82aae44fe1d9e2e722e8a8 95710 uruk_20130809-1_all.deb
Checksums-Sha256: 
 cf5bc061d81bea1e6eb82f2476f74274df9001f0624ab82239ef1b6a849172b4 1346 
uruk_20130809-1.dsc
 742b82b646d2d1c081ca982d22e5a29fa7bcb780719ca1a7b002a0288c448840 211670 
uruk_20130809.orig.tar.gz
 2f4bf4b740702eb9bb2773ae405b1e9cd64b79ca4b3ed12f56ea8690c196fcdc 10336 
uruk_20130809-1.debian.tar.gz
 c536d46720ead78735072fb2284508820bde938169c39b4b115f96bcef04946e 95710 
uruk_20130809-1_all.deb
Files: 
 16a61f4f120ea07a9a53670dc52af2ae 1346 net optional uruk_20130809-1.dsc
 a1fa559bc04e361393022cd96499bec5 211670 net optional uruk_20130809.orig.tar.gz
 205d415a2a7b812eb069ce8e98aea141 10336 net optional 
uruk_20130809-1.debian.tar.gz
 69226cb62f1ebd38c38a1bdd5883651c 95710 net optional uruk_20130809-1_all.deb

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

iQEcBAEBAgAGBQJSBRFNAAoJEDNRenKl5rDIJ/wH/itxhSFdIZk524xSDtaegM7p
MvsSz9+pYmD5PlOqyoX287hmXexr83hH48WQaDYRl3pn5Oj2XgfS7ameAQ7fddmw
DBCJmfmZIyRKzIjWp5ImytWppQOt9yjVvcXOAhk/JpWKTS/Bk+d3kelePfn2UZPh
6ZeJ9vyduCs7yYxvpNSOZpWGwX3kDqvcN8GqXpb2zUjLwAw1BulT03zK8NcAME7R
1BW9/Bd501PqzGbbpriLMaaDOcHbcqQV+luLES5g32TAQkNqnqNzm0pZzh2816Ny
zfonMlcTsRcCYceHqDe61kmNsrLFU8aUj3Fba1wcOt7VpaOcjBSYlSR+pHLjRNk=
=O3re
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to