Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
jblOffline
8 Post subject: ifupdown 0.7.41/.42: postinst and loopback error  PostPosted: 07.05.2013, 06:59



Joined: 2011-04-14
Posts: 11

Status: Offline
Hi,
while I made a d-u in init 3, the following message was seen:

      Code:
... /etc/init/network-interface-security.conf
... Fehlerwert 2

apt-get -f install
      Code:
ifupdown (0.7.41) wird eingerichtet ...
/var/lib/dpkg/info/ifupdown.postinst: 102: /var/lib/dpkg/info/ifupdown.postinst: Syntax error: "else" unexpected
dpkg: Fehler beim Bearbeiten von ifupdown (--configure):
 Unterprozess installiertes post-installation-Skript gab den Fehlerwert 2 zurück
Fehler traten auf beim Bearbeiten von:
 ifupdown
E: Sub-process /usr/bin/dpkg returned an error code (1)

ceni
      Code:
/etc/network/interfaces:5: interface lo declared allow-auto twice
/sbin/ifup: couldn't read interfaces file "/etc/network/interfaces"
W: up eth0 failed due to error at /usr/bin/Ceni line 1482

How can I get network working without an access to the Internet?

Thanks for hints. jbl


//edit by DonKult: Changed title to include error message – and edit the editto change it once again slightly.
 
 View user's profile Send private message  
Reply with quote Back to top
k1tt3hOffline
Post subject: RE: d-u error ifupdown 0.7.41  PostPosted: 07.05.2013, 07:38



Joined: 2012-11-18
Posts: 21
Location: lap, window sill, or top of refrigerator
Status: Offline
I just encountered this as well. I am able to connect with
      Code:
 ifup --no-loopback eth0
. I went so far as to open the ifupdown.postinst and comment out a few more lines in order to complete the install through apt-get.
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
DonKultOffline
Post subject: RE: d-u error ifupdown 0.7.41  PostPosted: 07.05.2013, 08:14
Team Member


Joined: 2010-09-02
Posts: 481

Status: Offline
Instead of disabling the postinst you can also fix it:
As the error message suggests an empty if-block is not valid, so all we have to do is doing something in it - like calling "true", which does nothing very successfully. Wink

So open the file, find line 101 and add a new line (= a new line number 102) with the content "true" (without quotes).

For the vi-folks (and all others who like magic):
      Code:
vi /var/lib/dpkg/info/ifupdown.postinst
101gg
o
true
<ESC>
:wq<ENTER>

(the <ESC> being the ESC-key, <ENTER> respectively, all other keys as usual, no need to press enter anywhere else (after opening the file), newlines just for clarity.)

Debian bugreport: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=707054

@jbl: I think your (additional) problem is reported as: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=707052


As the maintainer says, wait for the fix which should appear soon. As far as it sounds version 0.7.43 will fix it.
(Beware: 0.7.42 is currently in incoming, so while the next mirror sync might have a new version, it might not be the [completely] fixed one …)

//edit: found the second bugreport, so removed debugging question.

_________________
MfG. DonKult
"I never make stupid mistakes. Only very, very clever ones." ~ The Doctor
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
k1tt3hOffline
Post subject: RE: d-u error ifupdown 0.7.41  PostPosted: 07.05.2013, 09:03



Joined: 2012-11-18
Posts: 21
Location: lap, window sill, or top of refrigerator
Status: Offline
Donkult, I went ahead and followed your advice. I am encountering both bugs. I was happy to see this when visiting your second link.
      Quote:
I think I have fixed the bug, please test 0.7.43 as soon as it appears
in the archive and report if it hasn't broken your configuration,
which I hope it hasn't. In fact, these were just some stupid things I
have overlooked before the upload. Note to myself: never do any
uploads in the middle of the night Smile

--
WBR, Andrew


Would building from source (0.7.42) with the patch provided by Dmitry Shachnev;
      Code:
 # Generic stuff done on all configurations
 if [ "$1" = "configure" ] ; then
-  if [ -f /etc/network/interfaces ] ; then
-    # We don't need loopback interface definition anymore as
-    # ifupdown handles loopback interface on its own from now
-  else  # ! -f /etc/network/interfaces
+  # We don't need loopback interface definition anymore as
+  # ifupdown handles loopback interface on its own from now
+  if [ ! -f /etc/network/interfaces ] ; then
     if [ -z "$2" ]; then
       echo "Creating /etc/network/interfaces."
       echo "# interfaces(5) file used by ifup(8) and ifdown(8)" > /etc/network/interfaces



be something worth attempting or ill advised?
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
DonKultOffline
Post subject: RE: d-u error ifupdown 0.7.41  PostPosted: 07.05.2013, 11:11
Team Member


Joined: 2010-09-02
Posts: 481

Status: Offline
No, the patch is for the postinst-bug, not for the loopback.
(and it does mostly the same as my vi-transcript as it removes the offending empty if-block – thats more correct (from a style point-of-view), but harder to describe and achieves the same result)


The loopback problem seems to be the second bug and here waiting for a fix is best. You could try commenting out the loopback lines I mentioned above, this might help (haven't tested myself yet though).

_________________
MfG. DonKult
"I never make stupid mistakes. Only very, very clever ones." ~ The Doctor
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
k1tt3hOffline
29 Post subject:   PostPosted: 07.05.2013, 11:18



Joined: 2012-11-18
Posts: 21
Location: lap, window sill, or top of refrigerator
Status: Offline
Yes, I grabbed the .deb package and applied the patch to the postinst file, (using nano Razz ) then reinstalled ifupdown with no issue. The issue arises when I reboot and I receive the duplicte auto error. I will give your idea a test here in a few minutes.

As I mentioned above,
      Code:
ifup --no-loopback eth0
is simple for me to do and I do not have anything that is required to connect to my network at login.


Last edited by k1tt3h on 07.05.2013, 12:14; edited 1 time in total
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
DonKultOffline
Post subject:   PostPosted: 07.05.2013, 11:42
Team Member


Joined: 2010-09-02
Posts: 481

Status: Offline
So, just checked 0.7.42 includes the patch from Dmitry, so fixes the postinst error.

The second problem of not bringing the network up (at boot or whenever you try it manually) can be fixed by commenting out the lines responsible for the loopback interface in /etc/network/interfaces. They look like this:
      Code:
auto lo
iface lo inet loopback

Place a # in front of each of these two lines and reboot. You should be fine again.


A fix to ignore the loopback device will be included in 0.7.43.

I guess you can keep the loopback commented out (or even dare to remove it) in the future, but adding them back will probably not hurt either …

_________________
MfG. DonKult
"I never make stupid mistakes. Only very, very clever ones." ~ The Doctor
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
k1tt3hOffline
32 Post subject:   PostPosted: 07.05.2013, 12:14



Joined: 2012-11-18
Posts: 21
Location: lap, window sill, or top of refrigerator
Status: Offline
      DonKult wrote:
fixed by commenting out the lines responsible for the loopback interface in /etc/network/interfaces. They look like this:
      Code:
auto lo
iface lo inet loopback

Place a # in front of each of these two lines and reboot. You should be fine again.


This does indeed prevent the duplicate auto error.

Thank you, DonKult. Good stuff. Very Happy
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
etorixOffline
Post subject:   PostPosted: 07.05.2013, 12:39
Team Member


Joined: 2010-08-26
Posts: 137

Status: Offline
best not upgrade ifupdown

till this issue is sorted
 
 View user's profile Send private message  
Reply with quote Back to top
etorixOffline
Post subject:   PostPosted: 07.05.2013, 16:14
Team Member


Joined: 2010-08-26
Posts: 137

Status: Offline
actually, commenting 'lo' seems to do the trick now
 
 View user's profile Send private message  
Reply with quote Back to top
bfreeOffline
Post subject:   PostPosted: 07.05.2013, 16:25
Team Member


Joined: 2010-08-26
Posts: 247

Status: Offline
0.7.43 has reached at least some mirrors and appears on a quick check to have fixed the problems. If you are doing a d-u please make sure the new ifupdown version is 0.7.43 or newer or wait for your mirror to catch up.

Not marking this fixed yet as mirrors may not all have caught up and some more confirmations this problem is over would be good.
 
 View user's profile Send private message  
Reply with quote Back to top
samspadeOffline
Post subject:   PostPosted: 07.05.2013, 17:15



Joined: 2010-09-17
Posts: 12

Status: Offline
bfree is a wise man cause he checked before upgrading.

because i did the upgrade blind this also bite me.

but since i googled (instead of consulting this fine and fast forum) i found this gem in the bug report bfree quoted Andrew from which reads:

"This change breaks existing configurations. You cannot do that."

just gotta love these finds Smile.

now something with more relevance:

after the shock i also just commented auto lo out and could bring the devices back up.

regards to all my fellow aptosid users,

sam
 
 View user's profile Send private message  
Reply with quote Back to top
k1tt3hOffline
32 Post subject:   PostPosted: 07.05.2013, 22:38



Joined: 2012-11-18
Posts: 21
Location: lap, window sill, or top of refrigerator
Status: Offline
I just did a d-u and 0.7.43 was included. I reverted /etc/network/interfaces
      Code:
auto lo
iface lo inet loopback

rebooted and tis all normal and functioning as it is supposed to.

Very fast fix by all involved. Aptosid is fun. Smile

Good stuff.
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 12 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by Zafenio