You are not logged in.

#1 2012-12-28 15:48:38

kodiak
Member
Registered: 2012-04-26
Posts: 59

[solved] netcfg fails only on reconnect

Hi there,

I am running system.d and I am able to start netcfg once. Netcfg reconnect fails, as well as attempting to connect a second time when e.g. network was not available on first attempt. Normally I start netcfg on boot, and if it fails I am not able to try a connection manually. Basically it means I have only one try to connect to a wireless network before reboot.
I first thought it might be related to https://bbs.archlinux.org/viewtopic.php?id=151662 but I could not help myself.

Here is the output when netcfg is disabled in systemd.

ᐅ sudo netcfg mynetwork 
[sudo] password for kodiak: 
:: mynetwork up                                                          [DONE]

 sudo netcfg down mynetwork 
:: mynetwork down                                                        [DONE]

ᐅ sudo netcfg mynetwork     
:: mynetwork up                                                          [BUSY]
ctrl_iface exists and seems to be in use - cannot override it
Delete '/var/run/wpa_supplicant/wlan0' manually if it is not used anymore
Failed to initialize control interface 'DIR=/var/run/wpa_supplicant GROUP=users'.
You may have another wpa_supplicant process already running or the file was
left by an unclean termination of wpa_supplicant in which case you will need
to manually remove this file before starting wpa_supplicant again.

 > wpa_supplicant did not start, possible configuration error
                                                                         [FAIL]

ᐅ sudo rm /var/run/wpa_supplicant/wlan0
ᐅ sudo netcfg mynetwork                
:: mynetwork up                                                          [BUSY] 
 > WPA Authentication/Association Failed

Configuration:

ᐅ cat /etc/network.d/mynetwork 
CONNECTION='wireless'
DESCRIPTION='A wpa_supplicant configuration based wireless connection'
INTERFACE='wlan0'
SECURITY='wpa-config'
WPA_CONF='/etc/wpa_supplicant.conf'
IP='dhcp' 
# Uncomment this if your ssid is hidden
#HIDDEN=yes

ᐅ cat /etc/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=users
network={
	ssid="WLAN1"
	psk="PASSWD"
}
network={
	ssid="WLAN2"
	psk=PASSWD
}
network={
	ssid="WLAN3"
	psk="PASSWD"
}

ᐅ yaourt -Ss netcfg
core/netcfg 3.0-1 (base) [installed]

ᐅ lsmod
Module                  Size  Used by
fuse                   60479  2 
btusb                  10369  0 
gspca_sn9c20x          25911  0 
gspca_main             18645  1 gspca_sn9c20x
videodev               79257  2 gspca_sn9c20x,gspca_main
bluetooth             168947  2 btusb
crc16                   1092  1 bluetooth
iTCO_wdt                4316  0 
iTCO_vendor_support     1546  1 iTCO_wdt
media                   8546  1 videodev
radeon                788285  2 
arc4                    1604  2 
thinkpad_acpi          54674  0 
ttm                    46988  1 radeon
iwl3945                47929  0 
drm_kms_helper         28942  1 radeon
iwlegacy               41403  1 iwl3945
drm                   180117  4 ttm,drm_kms_helper,radeon
mac80211              367308  2 iwl3945,iwlegacy
cfg80211              153457  3 iwl3945,iwlegacy,mac80211
snd_hda_codec_analog    62229  1 
lpc_ich                 9214  0 
nvram                   4795  1 thinkpad_acpi
i2c_algo_bit            4584  1 radeon
tpm_tis                 7155  0 
coretemp                4959  0 
joydev                  7696  0 
kvm_intel             117536  0 
snd_hda_intel          22257  2 
acpi_cpufreq            5142  1 
mperf                   1024  1 acpi_cpufreq
rfkill                 12569  4 cfg80211,thinkpad_acpi,bluetooth
pcmcia                 31186  0 
tpm                    11958  1 tpm_tis
tg3                   126080  0 
snd_hda_codec          83678  2 snd_hda_intel,snd_hda_codec_analog
snd_hwdep               4843  1 snd_hda_codec
snd_pcm                61958  2 snd_hda_codec,snd_hda_intel
snd_page_alloc          5902  2 snd_pcm,snd_hda_intel
snd_timer              14903  1 snd_pcm
intel_agp               8593  0 
tpm_bios                4262  1 tpm
psmouse                71891  0 
intel_gtt              12212  1 intel_agp
agpgart                21936  4 drm,ttm,intel_agp,intel_gtt
i2c_i801                8464  0 
snd                    45098  11 snd_hwdep,snd_timer,snd_pcm,snd_hda_codec,snd_hda_intel,thinkpad_acpi,snd_hda_codec_analog
battery                 5214  0 
kvm                   324233  1 kvm_intel
soundcore               4379  1 snd
ac                      1893  0 
video                   9885  0 
serio_raw               3714  0 
processor              24040  3 acpi_cpufreq
thermal                 6660  0 
button                  3711  0 
libphy                 17294  1 tg3
yenta_socket           18841  0 
pcmcia_rsrc             8809  1 yenta_socket
i2c_core               16944  6 drm,i2c_i801,drm_kms_helper,i2c_algo_bit,radeon,videodev
evdev                   7663  14 
pcmcia_core            10242  3 pcmcia,pcmcia_rsrc,yenta_socket
pcspkr                  1456  0 
microcode               8922  0 
vboxdrv               222106  0 
btrfs                 705337  1 
crc32c                  1277  1 
libcrc32c                715  1 btrfs
zlib_deflate           18101  1 btrfs
sr_mod                 13149  0 
sd_mod                 27312  2 
cdrom                  30345  1 sr_mod
ata_generic             2435  0 
pata_acpi               2400  0 
uhci_hcd               19841  0 
ata_piix               19705  1 
libata                146129  3 pata_acpi,ata_generic,ata_piix
scsi_mod              113073  3 libata,sd_mod,sr_mod
sdhci_pci               8878  0 
sdhci                  20459  1 sdhci_pci
tifm_7xx1               3575  0 
mmc_core               73455  2 sdhci,sdhci_pci
firewire_ohci          27535  0 
tifm_core               3890  1 tifm_7xx1
firewire_core          45541  1 firewire_ohci
crc_itu_t               1096  1 firewire_core
ehci_hcd               36685  0 
usbcore               126796  5 gspca_sn9c20x,btusb,uhci_hcd,ehci_hcd,gspca_main
usb_common               623  1 usbcore

ᐅ cat /usr/lib/systemd/system/netcfg.service
[Unit]
Description=Netcfg multi-profile daemon
Before=network.target
Wants=network.target
After=sys-devices-pci0000:00-0000:00:1c.1-0000:03:00.0-net-wlan0.device
BindTo=sys-devices-pci0000:00-0000:00:1c.1-0000:03:00.0-net-wlan0.device 

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/netcfg-daemon start
ExecStop=/usr/bin/netcfg-daemon stop
KillMode=none

[Install]
WantedBy=multi-user.target

ᐅ 0.status net-auto-wireless
net-auto-wireless.service - Provides automatic netcfg wireless connection
	  Loaded: loaded (/usr/lib/systemd/system/net-auto-wireless.service; disabled)
	  Active: inactive (dead)
	  CGroup: name=systemd:/system/net-auto-wireless.service

ᐅ 0.status net-auto-wired
net-auto-wired.service - Provides automatic netcfg wired connection
	  Loaded: loaded (/usr/lib/systemd/system/net-auto-wired.service; disabled)
	  Active: inactive (dead)
	  CGroup: name=systemd:/system/net-auto-wired.service

I noticed that behaviour after I switched over to systemd, with initscripts it did run fine.

Last edited by kodiak (2013-01-05 16:29:39)

Offline

#2 2013-01-05 16:36:40

kodiak
Member
Registered: 2012-04-26
Posts: 59

Re: [solved] netcfg fails only on reconnect

Ok, finaly I got it working - first time with systemd. Things I changed:

1. in wpa_supplicant.conf I updated from '/var/run' to '/run' and added 'fast_reauth=1' and 'ap_scan=1'

2. in my networkprofile I added 'TIMEOUT=10' and 'DHCP_TIMEOUT=20'

3. finally I enabled dhcpcd: I think this one actually did it. It was never was in the array of rc.conf though

Offline

Board footer

Powered by FluxBB