Bug#816076: wicd-daemon: upgrade reconfigures static ethernet interface, and kills ssh sessions.

2016-05-21 Thread Axel Beckert
Hi,

Vincent Lefevre wrote:
> On 2016-02-27 19:48:48 +1100, Andrew Vaughan wrote:
> > My home server is a headless box, administered from a vnc session tunnelled
> > over ssh.  It has no wifi adaptor, just a single ethernet port that is
> > statically configured via /etc/network/interfaces.
> > 
> > During today's package update my ssh connection died partway through, during
> > setup of wicd-daemon.  Last line was "Installing new version of config file
> > /etc/wicd/encryption/templates/wpa2-peap ..."
> > 
> > Then ssh refused to re-connect.
> > 
> > I finally got re-connected after discovering that wicd-daemon had
> > reconfigured eth0 to a different ip address.
> 
> Probably the same bug as bug 557156 (from 2009!). The problem is that
> wicd-daemon tries to reconfigure the ethernet interface even though
> it is configured not to connect to it automatically (which should be
> and is the default).

I went through all the more or less recent upstream commits and I'm
rather sure that the commit at
https://bazaar.launchpad.net/~wicd-devel/wicd/experimental/revision/851
is the cause for the issue.

So it's a different issue than #557156.

> A workaround is to remove eth0 from the wicd configuration.

That should help, yes. But reading the commit message of the above
mentioned commit, there's another "fix":

  Change default behaviour: now wicd kills connections when is
  shutdown. This behaviour can be overriden with -c/--keep-connection
  (to the daemon).

So the best way to fix this issue probably would be to set this option
by default in /etc/default/wicd and use that variable in
/etc/init.d/wicd. But currently there is no variable for that in
either file, so such a variable (e.g. named "DAEMON_OPTIONS") needs to
be introduced.

Regards, Axel
-- 
 ,''`.  |  Axel Beckert , http://people.debian.org/~abe/
: :' :  |  Debian Developer, ftp.ch.debian.org Admin
`. `'   |  4096R: 2517 B724 C5F6 CA99 5329  6E61 2FF9 CD59 6126 16B5
  `-|  1024D: F067 EA27 26B9 C3FC 1486  202E C09E 1D89 9593 0EDE



Bug#816076: wicd-daemon: upgrade reconfigures static ethernet interface, and kills ssh sessions.

2016-05-11 Thread Vincent Lefevre
Hi,

On 2016-04-20 21:05:47 +1000, Andrew Vaughan wrote:
> On 20 April 2016 at 19:58, Vincent Lefevre  wrote:
> > Probably the same bug as bug 557156 (from 2009!). The problem is that
> > wicd-daemon tries to reconfigure the ethernet interface even though
> > it is configured not to connect to it automatically (which should be
> > and is the default). A workaround is to remove eth0 from the wicd
> > configuration.

Concerning the problem I had, it was apparently a documentation bug.
I've submitted a patch for the wicd-manager-settings.conf(5) man page.

> As far as I am aware, I have never touched the wicd config files.  And a
> package shouldn't ship with a config that will break an otherwise valid
> configuration belonging to a different package on package upgrade.

The problem in your case was that you managed eth0 with both ifupdown
and wicd, which is obviously wrong. I thought that the default
configuration instructed that the wired interface wasn't managed
by default, but this was the documentation bug. If an interface
name is provided, then it will be managed by wicd automatically.

IMHO, the default config file should be written in such a way that
a wired interface is not managed by wicd because it could already
be managed in some other way. Unfortunately the usual choice is to
configure things at much as possible even though this may be broken
(for instance, just after installing postfix, a daemon is started
with a basic config file that rejects received mail, which is really
bad when re-installing a machine).

If the default config file isn't changed, recommending wicd is wrong,
IMHO.

If the wired interface is deconfigured during a wicd upgrade, this is
also wrong, as this can break upgrade via SSH.

> Now for the new stuff.  Today I removed wicd and related packages.
> I'm pretty sure I purged the config files.  To cut a long story short,
> purging wicd and related packages resulted in eth0 having it's IPv4
> address removed.  Eth0 was still up with a IPv6 address.  But the
> machine was no longer reachable over IPv4.  Probably just a
> different variant of the same underlying buggy behaviour.

I think that if the wired interface is managed by wicd, then it makes
sense to deconfigure it when purging wicd (and even just removing it),
because the interface wouldn't be controlled in any way, with no
possibility of clean-up.

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



Bug#816076: wicd-daemon: upgrade reconfigures static ethernet interface, and kills ssh sessions.

2016-04-20 Thread Andrew Vaughan
Hi Vincent.

I was just about to update this bug after purging wicd today.

On 20 April 2016 at 19:58, Vincent Lefevre  wrote:
>
> Probably the same bug as bug 557156 (from 2009!). The problem is that
> wicd-daemon tries to reconfigure the ethernet interface even though
> it is configured not to connect to it automatically (which should be
> and is the default). A workaround is to remove eth0 from the wicd
> configuration.
>

As far as I am aware, I have never touched the wicd config files.  And a
package shouldn't ship with a config that will break an otherwise valid
configuration belonging to a different package on package upgrade.
Certainly not without _big_ warnings, and certainly not for a package
pulled in by recommendations from a relatively common metapackage.
(I included a copy of the relevant config files at the bottom of the
original bug report).

Now for the new stuff.  Today I removed wicd and related packages.
I'm pretty sure I purged the config files.  To cut a long story short,
purging wicd and related packages resulted in eth0 having it's IPv4
address removed.  Eth0 was still up with a IPv6 address.  But the
machine was no longer reachable over IPv4.  Probably just a
different variant of the same underlying buggy behaviour.

Thanks for your work on Debian.

Andrew V.



Bug#816076: wicd-daemon: upgrade reconfigures static ethernet interface, and kills ssh sessions.

2016-04-20 Thread Vincent Lefevre
On 2016-02-27 19:48:48 +1100, Andrew Vaughan wrote:
> My home server is a headless box, administered from a vnc session tunnelled
> over ssh.  It has no wifi adaptor, just a single ethernet port that is
> statically configured via /etc/network/interfaces.
> 
> During today's package update my ssh connection died partway through, during
> setup of wicd-daemon.  Last line was "Installing new version of config file
> /etc/wicd/encryption/templates/wpa2-peap ..."
> 
> Then ssh refused to re-connect.
> 
> I finally got re-connected after discovering that wicd-daemon had
> reconfigured eth0 to a different ip address.

Probably the same bug as bug 557156 (from 2009!). The problem is that
wicd-daemon tries to reconfigure the ethernet interface even though
it is configured not to connect to it automatically (which should be
and is the default). A workaround is to remove eth0 from the wicd
configuration.

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



Bug#816076: wicd-daemon: upgrade reconfigures static ethernet interface, and kills ssh sessions.

2016-03-06 Thread Andrew Vaughan
On 7 March 2016 at 04:16, Axel Beckert  wrote:
> Hi Andrew,
>
> Andrew Vaughan wrote:
>> My home server is a headless box, administered from a vnc session tunnelled
>> over ssh.  It has no wifi adaptor, just a single ethernet port that is
>> statically configured via /etc/network/interfaces.
>
> So why are you using wicd at all? I don't see why you need wicd in
> such a setup.
>

Wicd was automatically installed because lxde recommends wicd |
network-manager-gnome.

Yes, I could just remove wicd, but that would be working around what I
view as buggy behaviour in wicd-daemon.  If relatively common
meta-packages like lxde are going to pull in services like wicd-daemon
via recommends, then those services must behave sanely if the user
never touches their config.

Network-manager-gnome is also installed because gnome-core recommends
it.  I wonder whether we have races between them?

>> This behaviour is wrong on so many levels.
>>
>> 1. A package upgrade should never bring down an existing in-use interface
>> without asking the user/admin first.
>
> I agree here mostly. It's though only a real issue if the interface
> doesn't come up again with the same IP afterwards.
>

Even if it comes up with the same ip address it is a potential data loss bug.
eg a ssh user has unsaved work in some console application, when the
connection is lost.  There is no easy way to reconnect to the console
application. This may result in data loss.

>> Wicd-daemon should not assume that just because it is installed it
>> owns all the network interfaces.
>
> I disagree here. In Debian, it's common that NetworkManager and
> similar tools manage those interfaces from /etc/network/interfaces
> which are not listed (or maybe also those which are on "auto").

Nowhere in the package description does wicd say that it will attempt
to automatically maintain an active internet connection without any
prior user/admin interaction/config.

In principle, I don't have a problem with it trying to automatically
configure interfaces that have no existing config.  But if I were to
run a virtualisation script that adds a virtual interface, then starts
a virtual machine, is wicd going to see the new interface and try to
configure that, and hence race the the startup of the virtual machine?
 If I plugin a usb wireless adaptor is it going to blindly attempt to
connect to any available wifi network, even if no wifi network has
ever been configured on this device?  If the user were to attempt to
use network-manager gnome to change an existing wifi connection, are
the 2 going to fight over which one gets to configure the
wifi-adapter?

But regardless, if it hasn't been explicitly given permission to
change network configs, then it should respect the existing config of
any interfaces that are up before it starts, or that the user or admin
configures using other tools, including whilst it is running.
Certainly installing/reinstalling/upgrading wicd-daemon shouldn't
touch any network configuration that was made with other tools,
without the admin or user having done something to give wicd
permission to manage network config.

On a related note (the following typed manually from memory, so only
approximate)

ifdown eth0

do something for 30 sec (like edit /etc/network/interfaces )

ifup eth0

error: file in use. can't bring up eth0

ifdown eth0

error: eth0 not up

Not sure whether that was network-manager or wicd that brought eth0
up, but it could be an head-scratching time for an admin who had never
noticed that they were installed.   And it should have better
integration with ifup/down, so that both tools are on the same page as
to what the interface status is and preferably what the interface
status is supposed to be.

>
>> I have been through basically the same problems with network-manager in the
>> past.  Issues like this are why so many people are hostile to that package.
>
> Indeed. That's why I'm using wicd, too. It was though worse with
> NetworkManager back then since usually, the network interface stayed
> down afterwards. That got fixed in the meanwhile, though, IIRC.
>

I remember un-installing network-manager a few times, only for
dependencies to try to pull it back in.

Andrew



Bug#816076: wicd-daemon: upgrade reconfigures static ethernet interface, and kills ssh sessions.

2016-03-06 Thread Axel Beckert
Hi Andrew,

Andrew Vaughan wrote:
> My home server is a headless box, administered from a vnc session tunnelled
> over ssh.  It has no wifi adaptor, just a single ethernet port that is
> statically configured via /etc/network/interfaces.

So why are you using wicd at all? I don't see why you need wicd in
such a setup.

> This behaviour is wrong on so many levels.
> 
> 1. A package upgrade should never bring down an existing in-use interface
> without asking the user/admin first.

I agree here mostly. It's though only a real issue if the interface
doesn't come up again with the same IP afterwards.

> 2. I don't think I have ever actually used wicd.

See my question above. You don't need it.

> Wicd-daemon should not assume that just because it is installed it
> owns all the network interfaces.

I disagree here. In Debian, it's common that NetworkManager and
similar tools manage those interfaces from /etc/network/interfaces
which are not listed (or maybe also those which are on "auto").

The issue here seems that wicd seems to no more blacklists them. Will
have to check.

> I have been through basically the same problems with network-manager in the
> past.  Issues like this are why so many people are hostile to that package.

Indeed. That's why I'm using wicd, too. It was though worse with
NetworkManager back then since usually, the network interface stayed
down afterwards. That got fixed in the meanwhile, though, IIRC.

For now I've forwarded this issue to upstream at
https://bugs.launchpad.net/wicd/+bug/1553761

Regards, Axel
-- 
 ,''`.  |  Axel Beckert , http://people.debian.org/~abe/
: :' :  |  Debian Developer, ftp.ch.debian.org Admin
`. `'   |  4096R: 2517 B724 C5F6 CA99 5329  6E61 2FF9 CD59 6126 16B5
  `-|  1024D: F067 EA27 26B9 C3FC 1486  202E C09E 1D89 9593 0EDE



Bug#816076: wicd-daemon: upgrade reconfigures static ethernet interface, and kills ssh sessions.

2016-03-06 Thread Axel Beckert
Hi Gianfranco,

On Sat, Mar 05, 2016 at 03:51:23PM +, Gianfranco Costamagna wrote:
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=816076

Thanks for the heads up. I seem to have missed that bug report
initially.

I noticed that interruption, too, at least once. But IIRC in my case,
network came back with the same IP IIRC since the IP was assigned
staticallt by the DHCP server. I'll forward it to upstream for now.

Kind regards, Axel
-- 
/~\  Plain Text Ribbon Campaign   | Axel Beckert
\ /  Say No to HTML in E-Mail and News| a...@deuxchevaux.org  (Mail)
 X   See http://www.nonhtmlmail.org/campaign.html | a...@noone.org (Mail+Jabber)
/ \  I love long mails: http://email.is-not-s.ms/ | http://abe.noone.org/ (Web)



Bug#816076: wicd-daemon: upgrade reconfigures static ethernet interface, and kills ssh sessions.

2016-02-27 Thread Andrew Vaughan
Package: wicd-daemon
Version: 1.7.4+tb2-1
Severity: serious

Dear Maintainer,

My home server is a headless box, administered from a vnc session tunnelled
over ssh.  It has no wifi adaptor, just a single ethernet port that is
statically configured via /etc/network/interfaces.

During today's package update my ssh connection died partway through, during
setup of wicd-daemon.  Last line was "Installing new version of config file
/etc/wicd/encryption/templates/wpa2-peap ..."

Then ssh refused to re-connect.

I finally got re-connected after discovering that wicd-daemon had
reconfigured eth0 to a different ip address.

(Note that if this had been a remote box, then I might not have been able to
discover the new ip address.  Potentially this might lead require in person
intervention in such cases).

This behaviour is wrong on so many levels.

1. A package upgrade should never bring down an existing in-use interface
without asking the user/admin first.  (There is a reason that ssh takes care to
not kill the existing session during package upgrades.  Consider what would
have happened if that had been a normal ssh session, and aptitude had
stalled part way through asking for user input).

2. I don't think I have ever actually used wicd.  Wicd-daemon should not
assume that just because it is installed it owns all the network interfaces.
It should only be touching interfaces it has configured/or the the user/admin
requests that it configure.

3. Even if it needs to reconfigure all interfaces, and even if we assume that
is owns all the network interfaces, it _must_ respect the admins static
configuration in /etc/network/interfaces , unless the user/admin specifically
requests it to reconfigure that interface.

Personally I think it should respect any and all pre-exisiting interfaces,
unless and until the admin/user asks for them to be changed.  That means
no touching of any interfaces it hasn't configured, including any interfaces
that the user/admin might have configured in non-standard ways, including
interactively.

I have reproduced the above problem using "aptitude reinstall wicd-daemon",
so it is definitely caused by installing the current version of wicd-daemon.

I have been through basically the same problems with network-manager in the
past.  Issues like this are why so many people are hostile to that package.

Thanks for your work on Debian.

Andrew V.






For reference, in case these help.


# 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).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.40
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 192.168.1.1 203.12.160.35 203.12.160.36



# ifconfig
eth0: flags=4163  mtu 1500
inet 192.168.1.55  netmask 255.255.255.0  broadcast 192.168.1.255
inet6 fe80::a2b3:ccff:fee2:5ad3  prefixlen 64  scopeid 0x20
ether a0:b3:cc:e2:5a:d3  txqueuelen 1000  (Ethernet)
RX packets 342875  bytes 75660357 (72.1 MiB)
RX errors 0  dropped 60907  overruns 0  frame 0
TX packets 302442  bytes 162293744 (154.7 MiB)
TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
device interrupt 18

lo: flags=73  mtu 65536
inet 127.0.0.1  netmask 255.0.0.0
inet6 ::1  prefixlen 128  scopeid 0x10
loop  txqueuelen 0  (Local Loopback)
RX packets 31913079  bytes 22201337028 (20.6 GiB)
RX errors 0  dropped 0  overruns 0  frame 0
TX packets 31913079  bytes 22201337028 (20.6 GiB)
TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0



# ls -al /etc/wicd/
total 40
drwxr-xr-x   4 root root  4096 Feb 27 14:45 .
drwxr-xr-x 171 root root 12288 Feb 27 14:45 ..
-rw-r--r--   1 root root   927 Nov  4  2014 dhclient.conf.template
-rw-r--r--   1 root root   931 Dec 22  2014 dhclient.conf.template.default
drwxr-xr-x   3 root root  4096 Nov  4  2014 encryption
-rw---   1 root root   485 Feb 27 14:45 manager-settings.conf
drwxr-xr-x   6 root root  4096 Nov  4  2014 scripts
-rw---   1 root root   320 Feb 27 14:45 wired-settings.conf
-rw---   1 root root 0 Feb 27 14:45 wireless-settings.conf



# cat /etc/wicd/wired-settings.conf
[wired-default]
ip = None
broadcast = None
netmask = None
gateway = None
search_domain = None
dns_domain = None
dns1 = None
dns2 = None
dns3 = None
beforescript = None
afterscript = None
predisconnectscript = None
postdisconnectscript = None
encryption_enabled = None
default = True
dhcphostname = 
lastused = True



# cat /etc/wicd/manager-settings.conf
[Settings]
backend = external