You are not logged in.

#1 2012-11-03 19:12:07

C5OK5Y
Member
Registered: 2010-07-04
Posts: 48

Netcfg, Systemd and Suspend Problem

I use Wi-Fi to connect to the internet. When I resume from suspend, netcfg doesn't reconnect to the network I was previously connected to. I found out that I should somehow make sure that netcfg all-suspend gets run before suspend and netcfg all-resume is run after resuming for correct reconnecting. So I made a /usr/lib/systemd/system-sleep/netcfg.sh file (I use systemd) with the following contents:

#!/bin/sh
case $1/$2 in
  pre/*)
    netcfg all-suspend
    ;;
  post/*)
    netcfg all-resume
    ;;
esac

But from the logs (+ I don't have internet access after resume) it seems that the netcfg profile gets correctly suspended and resumed, but after resuming, dhcpcd gets killed for some reason:

Nov 03 19:13:04 hostname systemd-sleep[9204]: suspending interface ra0 with profile profilename
Nov 03 19:13:04 hostname dhcpcd[9238]: sending signal 1 to pid 8907
Nov 03 19:13:04 hostname dhcpcd[9238]: waiting for pid 8907 to exit
Nov 03 19:13:04 hostname systemd-sleep[9204]: :: profilename down [done]
Nov 03 19:13:04 hostname systemd-sleep[9204]: Suspending system...
Nov 03 19:13:25 hostname systemd-sleep[9204]: System resumed.
Nov 03 19:13:25 hostname systemd-sleep[9204]: resuming interface ra0 with profile profilename
Nov 03 19:13:29 hostname dhcpcd[9452]: version 5.6.2 starting
Nov 03 19:13:29 hostname dhcpcd[9452]: ra0: sending IPv6 Router Solicitation
Nov 03 19:13:29 hostname dhcpcd[9452]: ra0: broadcasting for a lease
Nov 03 19:13:29 hostname dhcpcd[9452]: ra0: offered 192.168.1.155 from 192.168.1.1
Nov 03 19:13:29 hostname dhcpcd[9452]: ra0: acknowledged 192.168.1.155 from 192.168.1.1
Nov 03 19:13:29 hostname dhcpcd[9452]: ra0: checking for 192.168.1.155
Nov 03 19:13:33 hostname dhcpcd[9452]: ra0: sending IPv6 Router Solicitation
Nov 03 19:13:34 hostname dhcpcd[9452]: ra0: leased 192.168.1.155 for infinity
Nov 03 19:13:37 hostname dhcpcd[9499]: ra0: sending IPv6 Router Solicitation
Nov 03 19:13:41 hostname dhcpcd[9499]: ra0: sending IPv6 Router Solicitation
Nov 03 19:13:41 hostname dhcpcd[9499]: ra0: no IPv6 Routers available
Nov 03 19:13:44 hostname systemd-sleep[9204]: :: profilename up [done]
Nov 03 19:13:44 hostname dhcpcd[9499]: received SIGTERM, stopping
Nov 03 19:13:44 hostname dhcpcd[9499]: ra0: removing interface

How can I make the netcfg profile correctly disconnect and connect automatically so I don't have to do it manually?

Offline

#2 2012-12-02 17:11:27

hamelg
Member
From: France
Registered: 2008-06-19
Posts: 128

Re: Netcfg, Systemd and Suspend Problem

Hello,

I have the same issue, here is the log

Dec 02 17:59:29 zzzzstar kernel: wlan0: RX AssocResp from 00:22:b0:F8:31:6d (capab=0x411 status=0 aid=1)
Dec 02 17:59:29 zzzzstar kernel: wlan0: associated
Dec 02 17:59:29 zzzzstar kernel: IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
Dec 02 17:59:29 zzzzstar dhcpcd[2295]: version 5.6.3 starting
Dec 02 17:59:29 zzzzstar dhcpcd[2295]: wlan0: sending IPv6 Router Solicitation
Dec 02 17:59:29 zzzzstar dhcpcd[2295]: ESC[1;31mwlan0: sendmsg: Cannot assign requested addressESC[0m
Dec 02 17:59:29 zzzzstar dhcpcd[2295]: wlan0: broadcasting for a lease
Dec 02 17:59:32 zzzzstar dhcpcd[2295]: wlan0: offered 10.0.1.13 from 10.0.1.1
Dec 02 17:59:32 zzzzstar dhcpcd[2295]: wlan0: acknowledged 10.0.1.13 from 10.0.1.1
Dec 02 17:59:32 zzzzstar dhcpcd[2295]: wlan0: checking for 10.0.1.13
Dec 02 17:59:33 zzzzstar dhcpcd[2295]: wlan0: sending IPv6 Router Solicitation
Dec 02 17:59:36 zzzzstar dhcpcd[2295]: wlan0: leased 10.0.1.13 for 43200 seconds
Dec 02 17:59:37 zzzzstar dhcpcd[2295]: forked to background, child pid 2326
Dec 02 17:59:37 zzzzstar systemd-sleep[2157]: :: gha up [done]
Dec 02 17:59:37 zzzzstar dhcpcd[2326]: wlan0: sending IPv6 Router Solicitation
Dec 02 17:59:39 zzzzstar dhcpcd[2326]: received SIGTERM, stopping
Dec 02 17:59:39 zzzzstar dhcpcd[2326]: wlan0: removing interface
Dec 02 17:59:39 zzzzstar kernel: wlan0: deauthenticating from 00:22:b0:F8:31:6d by local choice (reason=3)
Dec 02 17:59:39 zzzzstar systemd[1]: Started Suspend.
Dec 02 17:59:39 zzzzstar systemd[1]: Starting Suspend.
Dec 02 17:59:39 zzzzstar systemd[1]: Reached target Suspend.

How can I find out who is sending SIGTERM to dhcpcd ?

Offline

#3 2012-12-02 17:32:42

C5OK5Y
Member
Registered: 2010-07-04
Posts: 48

Re: Netcfg, Systemd and Suspend Problem

@hamelg
I have no idea. The issue has been reported, so we have to wait.

Offline

#4 2012-12-05 17:49:21

hamelg
Member
From: France
Registered: 2008-06-19
Posts: 128

Re: Netcfg, Systemd and Suspend Problem

I use this workaround found here :
https://mailman.archlinux.org/pipermail … 03348.html

unfortunatelty, it works only on suspend, it fails on hibernate.

it seems netfcfg/systemd integration is being reworked

http://www.mail-archive.com/arch-projec … 02825.html

Offline

#5 2012-12-05 18:11:34

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: Netcfg, Systemd and Suspend Problem

Guys, you problem is easily fixed by using net-auto-wireless with only 1 profile.

OT, but personally I'd prefer to have net-auto-wireless as the only way of connecting to WiFi networks within netcfg, as it provides a proper tracking of the access point signal and reconnection capability.


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

#6 2012-12-06 03:20:01

engelus
Member
From: Salta - Argentina
Registered: 2011-06-11
Posts: 46

Re: Netcfg, Systemd and Suspend Problem

Offline

#7 2012-12-08 15:14:03

hamelg
Member
From: France
Registered: 2008-06-19
Posts: 128

Re: Netcfg, Systemd and Suspend Problem

@Leonid.I
I've tried the net-auto-wireless method, it doesn't work. After suspend or hibernate, network stays down. I have this error :

Dec 08 15:57:19 brightstar wpa_actiond[1723]: Interface 'wlan0' disconnected from network 'gha'
Dec 08 15:57:20 brightstar dhcpcd[2168]: sending signal 1 to pid 1762
Dec 08 15:57:20 brightstar dhcpcd[1762]: received SIGHUP, releasing
Dec 08 15:57:20 brightstar dhcpcd[1762]: wlan0: releasing lease of 10.0.1.13
Dec 08 15:57:20 brightstar dhcpcd[2168]: waiting for pid 1762 to exit
Dec 08 15:57:20 brightstar dhcpcd[1762]: wlan0: open_socket: No such device
Dec 08 15:57:20 brightstar dhcpcd[1762]: wlan0: open_udp_socket: Cannot assign requested address
Dec 08 15:57:20 brightstar dhcpcd[1762]: del_address: No such device
Dec 08 15:57:20 brightstar dhcpcd[1762]: wlan0: removing interface

and theses kernels errors :

Dec 08 17:35:03 brightstar kernel: wlan0: deauthenticating from 00:22:b0:68:31:6d by local choice (reason=3)
Dec 08 17:35:03 brightstar kernel: ------------[ cut here ]------------
Dec 08 17:35:03 brightstar kernel: WARNING: at net/mac80211/driver-ops.h:12 ieee80211_send_deauth_disassoc+0x233/0x240 [mac80211]()
Dec 08 17:35:03 brightstar kernel: Hardware name: 23737CG
Dec 08 17:35:03 brightstar kernel: wlan0:  Failed check-sdata-in-driver check, flags: 0x4
Dec 08 17:35:03 brightstar kernel: Modules linked in: ablk_helper cryptd aes_i586 aes_generic fuse arc4 ath5k ath mac80211 cfg80211 pcmcia snd_intel8x0 snd
Dec 08 17:35:03 brightstar kernel: Pid: 11621, comm: systemd-sleep Tainted: G        W    3.6.9-1-ARCH #1
Dec 08 17:35:03 brightstar kernel: Call Trace:
Dec 08 17:35:03 brightstar kernel:  [<c0139fc2>] warn_slowpath_common+0x72/0xa0
Dec 08 17:35:03 brightstar kernel:  [<f9068793>] ? ieee80211_send_deauth_disassoc+0x233/0x240 [mac80211]
Dec 08 17:35:03 brightstar kernel:  [<f9068793>] ? ieee80211_send_deauth_disassoc+0x233/0x240 [mac80211]
Dec 08 17:35:03 brightstar kernel:  [<c013a093>] warn_slowpath_fmt+0x33/0x40
Dec 08 17:35:03 brightstar kernel:  [<f9068793>] ieee80211_send_deauth_disassoc+0x233/0x240 [mac80211]
Dec 08 17:35:03 brightstar kernel:  [<f906a2b5>] ieee80211_set_disassoc+0x4b5/0x580 [mac80211]
Dec 08 17:35:03 brightstar kernel:  [<f906e14f>] ieee80211_mgd_deauth+0x16f/0x180 [mac80211]
Dec 08 17:35:03 brightstar kernel:  [<f9047dd0>] ? ieee80211_disassoc+0x20/0x20 [mac80211]
Dec 08 17:35:03 brightstar kernel:  [<f9047de6>] ieee80211_deauth+0x16/0x20 [mac80211]
Dec 08 17:35:03 brightstar kernel:  [<f8f93b80>] cfg80211_mlme_down+0x70/0xc0 [cfg80211]
Dec 08 17:35:03 brightstar kernel:  [<f8f96a91>] __cfg80211_disconnect+0x1b1/0x1d0 [cfg80211]
Dec 08 17:35:03 brightstar kernel:  [<f8f7d90c>] cfg80211_netdev_notifier_call+0x4ac/0x5c0 [cfg80211]
Dec 08 17:35:03 brightstar kernel:  [<c0456168>] ? inetdev_event+0x28/0x470
Dec 08 17:35:03 brightstar kernel:  [<c016d417>] ? sched_clock_cpu+0xe7/0x190
Dec 08 17:35:03 brightstar kernel:  [<c0412f10>] ? fib_rules_event+0x20/0x170
Dec 08 17:35:04 brightstar kernel:  [<c04b167d>] ? packet_notifier+0x9d/0x190
Dec 08 17:35:04 brightstar kernel:  [<c04dd213>] notifier_call_chain+0x43/0x60
Dec 08 17:35:04 brightstar kernel:  [<c015ff4e>] __raw_notifier_call_chain+0x1e/0x30
Dec 08 17:35:04 brightstar kernel:  [<c015ff7f>] raw_notifier_call_chain+0x1f/0x30
Dec 08 17:35:04 brightstar kernel:  [<c03fb77c>] call_netdevice_notifiers+0x2c/0x60
Dec 08 17:35:04 brightstar kernel:  [<c03fb7e4>] __dev_close_many+0x34/0xb0
Dec 08 17:35:04 brightstar kernel:  [<c017000d>] ? dequeue_entity+0x8d/0x250
Dec 08 17:35:04 brightstar kernel:  [<c03fb90e>] dev_close_many+0x6e/0xc0
Dec 08 17:35:04 brightstar kernel:  [<c03fba09>] rollback_registered_many+0xa9/0x1d0
Dec 08 17:35:04 brightstar kernel:  [<c03fbb45>] unregister_netdevice_many+0x15/0x60
Dec 08 17:35:04 brightstar kernel:  [<f9043e6c>] ieee80211_remove_interfaces+0x9c/0xe0 [mac80211]
Dec 08 17:35:04 brightstar kernel:  [<f903311b>] ieee80211_unregister_hw+0x4b/0x100 [mac80211]
Dec 08 17:35:04 brightstar kernel:  [<f90ee6a6>] ath5k_deinit_ah+0x16/0x60 [ath5k]
Dec 08 17:35:04 brightstar kernel:  [<f90f46b0>] ath5k_pci_remove+0x1c/0x45 [ath5k]
Dec 08 17:35:04 brightstar kernel:  [<c031894f>] pci_device_remove+0x2f/0xe0
Dec 08 17:35:04 brightstar kernel:  [<c03a6af1>] __device_release_driver+0x61/0xc0
Dec 08 17:35:04 brightstar kernel:  [<c03a6b74>] device_release_driver+0x24/0x40
Dec 08 17:35:04 brightstar kernel:  [<c03a6655>] bus_remove_device+0xa5/0xd0
Dec 08 17:35:04 brightstar kernel:  [<c03a4745>] device_del+0xe5/0x160
Dec 08 17:35:04 brightstar kernel:  [<c03a47d0>] device_unregister+0x10/0x20
Dec 08 17:35:04 brightstar kernel:  [<c03138f6>] pci_stop_bus_device+0x76/0x80
Dec 08 17:35:04 brightstar kernel:  [<c0313a9f>] pci_stop_and_remove_behind_bridge+0x2f/0x50
Dec 08 17:35:04 brightstar kernel:  [<f8d73820>] ? socket_insert+0x110/0x110 [pcmcia_core]
Dec 08 17:35:04 brightstar kernel:  [<f8d74737>] cb_free+0x17/0x1c [pcmcia_core]
Dec 08 17:35:04 brightstar kernel:  [<f8d738b7>] socket_late_resume+0x97/0xb0 [pcmcia_core]
Dec 08 17:35:04 brightstar kernel:  [<f8d7302a>] __pcmcia_pm_op+0x2a/0x50 [pcmcia_core]
Dec 08 17:35:04 brightstar kernel:  [<f8d73090>] ? pcmcia_socket_dev_suspend_noirq+0x20/0x20 [pcmcia_core]
Dec 08 17:35:04 brightstar kernel:  [<f8d730a2>] pcmcia_socket_dev_resume+0x12/0x20 [pcmcia_core]
Dec 08 17:35:04 brightstar kernel:  [<c03ad04f>] dpm_run_callback.isra.4+0x2f/0x60
Dec 08 17:35:04 brightstar kernel:  [<c03adb23>] device_resume+0x83/0x120
Dec 08 17:35:04 brightstar kernel:  [<c03adf2b>] dpm_resume+0xcb/0x1d0
Dec 08 17:35:04 brightstar kernel:  [<c03ae1a0>] dpm_resume_end+0x10/0x20
Dec 08 17:35:04 brightstar kernel:  [<c017d071>] suspend_devices_and_enter+0xa1/0x2d0
Dec 08 17:35:04 brightstar kernel:  [<c017d477>] pm_suspend+0x1d7/0x1e0
Dec 08 17:35:04 brightstar kernel:  [<c017c840>] state_store+0x80/0x90
Dec 08 17:35:04 brightstar kernel:  [<c017c7c0>] ? wakeup_count_store+0x80/0x80
Dec 08 17:35:04 brightstar kernel:  [<c02f577b>] kobj_attr_store+0x1b/0x30
Dec 08 17:35:04 brightstar kernel:  [<c0296e5b>] sysfs_write_file+0x9b/0xf0
Dec 08 17:35:04 brightstar kernel:  [<c0296dc0>] ? sysfs_open_file+0x230/0x230
Dec 08 17:35:04 brightstar kernel:  [<c023ab98>] vfs_write+0x88/0x160
Dec 08 17:35:04 brightstar kernel:  [<c0296dc0>] ? sysfs_open_file+0x230/0x230
Dec 08 17:35:04 brightstar kernel:  [<c023ae8d>] sys_write+0x3d/0x80
Dec 08 17:35:04 brightstar kernel:  [<c04e029f>] sysenter_do_call+0x12/0x28
Dec 08 17:35:04 brightstar kernel: ---[ end trace 1a7e7a19d2871209 ]---

To recover my network, I must restart manually the net-auto-wireless.service

@engelus
The script in #1 is identical to yours.

Last edited by hamelg (2012-12-08 16:46:01)

Offline

#8 2012-12-08 17:13:06

hamelg
Member
From: France
Registered: 2008-06-19
Posts: 128

Re: Netcfg, Systemd and Suspend Problem

I have switched to the kernel-lts and it has fixed the issue.
It seems that sleeping without stopping the wifi interface is problematic with the current kernel.

Offline

#9 2012-12-09 08:55:33

C5OK5Y
Member
Registered: 2010-07-04
Posts: 48

Re: Netcfg, Systemd and Suspend Problem

@hamelg
Unfortunately, I can't get it running neither with the lts kernel.

Offline

#10 2012-12-09 14:20:08

hamelg
Member
From: France
Registered: 2008-06-19
Posts: 128

Re: Netcfg, Systemd and Suspend Problem

I'm talking too fast : at each wakeup, net-auto-wireless spawns a new dhcpcd process.
It works 2 cycles suspend/resume, no more ...

Offline

#11 2013-02-13 20:36:14

C5OK5Y
Member
Registered: 2010-07-04
Posts: 48

Re: Netcfg, Systemd and Suspend Problem

I've switched to netctl in hope that this issue is fixed there - it isn't (but netctl is great and I'm glad that it's going to replace netcfg). But I've actually managed to fix the issue of netctl (and probably netcfg) not reconnecting to the network after suspend. This file (based on this) stores the running profiles and stops them before system suspend and starts the profiles after wakeup:

[Unit]
Description=netctl sleep hook
Before=sleep.target
StopWhenUnneeded=yes

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/netctl store ; /usr/bin/netctl stop-all
ExecStop=/usr/bin/netctl restore

[Install]
WantedBy=sleep.target

This file is to be saved as /etc/systemd/system/netctl-sleep.service and enabled with systemctl enable netctl-sleep. It should work with netcfg, if you replace the stuff in ExecStart with /usr/bin/netcfg all-suspend and replace the stuff in ExecStop with /usr/bin/netcfg all-resume.

Last edited by C5OK5Y (2013-02-13 20:41:44)

Offline

Board footer

Powered by FluxBB