FS#22974 - [netcfg] net-profiles doesn't wait for the user to select a network

Attached to Project: Arch Linux
Opened by Nicola Mori (snack) - Sunday, 20 February 2011, 11:42 GMT
Last edited by Allan McRae (Allan) - Tuesday, 15 March 2011, 23:44 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To James Rayner (iphitus)
Thomas Bächler (brain0)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
When net-profiles is started, it doesn't wait for the user to select the desired profile. Instead, it automatically activates the first one, without any key being pressed. I recently updated my system to KDE 4.6 so I uninstalled hal and fam. This is the only major upgrade I did recently, but I don't think it is the source of the problem since netcfg does not depend on these packages.

Additional info:
* package version(s)
kernel: 2.6.37-6
netcfg: 2.5.4-1

* config and/or log files etc.
Daemons array on rc.conf:
DAEMONS=(syslog-ng network rpcbind nfs-common @netfs @crond @dbus @alsa @cpufreq @laptop-mode net-profiles)

Steps to reproduce:
1) install netcfg and create a couple of profiles in /etc/network.d
2) add net-profiles to the daemons array in rc.conf
3) reboot
4) wait for net-profiles interface to pop up
This task depends upon

Closed by  Allan McRae (Allan)
Tuesday, 15 March 2011, 23:44 GMT
Reason for closing:  Fixed
Additional comments about closing:  dialog 1.1_20110302-1
Comment by James Rayner (iphitus) - Tuesday, 22 February 2011, 05:40 GMT
It's working as intended. IIRC, if you want a menu, set NET_PROFILES=(menu)

What is your NET_PROFILES= line?
Comment by Nicola Mori (snack) - Tuesday, 22 February 2011, 13:30 GMT
I have this entry in my rc.conf:

NETWORKS=menu

It used to work, maybe it changed recently?
Comment by Nikos Platis (nplatis) - Tuesday, 22 February 2011, 21:26 GMT
The following is observed on both my computers: a netbook with a fresh Arch installation and a desktop with a 3 month Arch installation.
I, too, find that the menu of net-profiles does not work at boot. Specifically, it does not seem to respond to keyboard at all. Moreover, if I run

/etc/rc.d/net-profiles restart

then I get the behaviour described in the previous message: the menu does not wait for input and loads the first profile.

If I run

netcfg-menu

the menu works OK.
Comment by James Rayner (iphitus) - Wednesday, 23 February 2011, 06:53 GMT
maybe try NETWORKS=(menu)
Comment by Nikos Platis (nplatis) - Wednesday, 23 February 2011, 07:41 GMT
For me, the behaviour is exactly the same if I use "(menu)" or "menu".
Comment by Leonid Isaev (lisaev) - Wednesday, 23 February 2011, 19:36 GMT
@Nikos: I am not sure, if the keyboard issue is related... does the dialog wait for timeout, while not responding to keyboard? Your second test indicates a problem with dialog (am I right?), because /etc/rc.d/net-profiles has /usr/bin/netcfg-menu "$NETWORKS_MENU_TIMEOUT", with timeout set to 5 sec. And calling netcfg-menu w/o args disables the timeout... Can you confirm this by running something like "netcfg-menu 7" (7 sec timeout)?
Comment by Nikos Platis (nplatis) - Wednesday, 23 February 2011, 23:14 GMT
This is what actually happens:
I have two profiles, DHCP and STATIC. STATIC is activated at startup.

The first time I run "netcfg-menu 10" I get STATIC->down and DHCP->up and the dialog waits for 10 secs without responding to keyboard (if I press the Up arrow I see ^[[A below the dialog etc.).

Now that DHCP is activated, every subsequent time that I run "netcfg-menu 10" the dialog does not wait at all and terminates immediately with a message "DHCP already connected".

If I reactivate STATIC (using "netcft STATIC") then the above behaviour is repeated (first time: wait but no input, subsequent runs: no wait).

I have not mentioned that my netbook uses i686 and my desktop uses x86_64 Arch, so this would not be attributed to the architecture.
Comment by Nicola Mori (snack) - Thursday, 24 February 2011, 08:09 GMT
I can confirm what Nikos reported above. Launching "sudo netcfg-menu 10" the dialog box appears, but it immediately exits to prompt saying "1-ethernet already connected" (1-ethernet is my currently loaded profile), without waiting for the keypress. I think the issue is that the timeout is expressed in ms and not in s. If I try "sudo netcfg-menu 5000" it waits for about 5 seconds...
Comment by Luís Moreira (knap) - Thursday, 24 February 2011, 11:40 GMT
I can confirm the same bug, this is a regression because it was working well before.

I have testing enabled and my rc.conf is attached.
   rc.conf (3.3 KiB)
Comment by Luís Moreira (knap) - Monday, 28 February 2011, 22:55 GMT
After investigating this bug I tracked it down to the dialog program used to display the menu.

After contacts with the dialog developer he figured out it was a small fix needed in the ui_getc.c file.
I expect that a new version of dialog will be released soon and with it this problem will be fixed.
Comment by Nicola Mori (snack) - Tuesday, 15 March 2011, 07:43 GMT
This morning when I started my laptop the netcfg menu worked correctly, waiting for my keyboard input. Also launching netcfg-menu from terminal works as expected. Maybe the recent upgrade of dialog to 1.1_20110302-1 fixed the problem? This is the only package I upgraded in the last 3 days that may have had some impact on netcfg (others are: xorg-util-macros, xorg-xkbcomp, xorg-setxkbmap, xorg-xkbevd, xorg-xkb-utils, amule, gdk-pixbuf2, chromium, gnutls, libraw1394, pacman-mirrorlist; none of them should have some impact on netcfg...)
Comment by Nikos Platis (nplatis) - Tuesday, 15 March 2011, 11:36 GMT
Confirming that on my computers, as well, this seems to be solved.
Comment by Luís Moreira (knap) - Tuesday, 15 March 2011, 19:41 GMT
It is fixed, but surely not because of the willingness of the developers/package maintainers involved.
I did all the work myself without a single response from the persons mentioned above.

It sure could have been fixed sooner, if the dialog (a core package btw) maintainer didn't took 1 whole freaking week to update a few characters in a PKGBUILD.
Comment by Nicola Mori (snack) - Tuesday, 15 March 2011, 21:34 GMT
I don't think it's the right place and time for this kind of discussion. Arch is in need of developers, there's a post on the mainpage about this, and one of the vacant positions is for netcfg developer, indeed. So thank you very much Luìs for your work, I really appreciate your effort, especially considering the above mentioned shortage of developers.
I think the bug report can be closed.

Loading...