# can't get network connection back after resume/suspend

## Carlino

Hello,

This issue I'm having is not really new, and I already had post something a while ago; but since it's still on, and I hadn't got any solution then, I come again.

Well, everything is in the subject title : after suspending, I can' t get back the network connection. I use Networkmanager.

Here's the journalctl right after : 

```

mars 30 17:10:03 bigpopa kernel: via-rhine 0000:05:00.0 eth0: Transmit timed out, status 0000, PHY status 786d, resetting...

mars 30 17:10:00 bigpopa dhcpcd[6731]: eth0: soliciting a DHCP lease

mars 30 17:10:00 bigpopa NetworkManager[3958]: <info> (eth0): DHCPv4 state changed nbi -> preinit

mars 30 17:10:00 bigpopa dhcpcd[6731]: eth0: ipv6nd_sendrsprobe: sendmsg: Cannot assign requested address

mars 30 17:10:00 bigpopa dhcpcd[6731]: eth0: soliciting an IPv6 router

mars 30 17:10:00 bigpopa dhcpcd[6731]: eth0: IAID 95:84:61:f3

mars 30 17:10:00 bigpopa dhcpcd[6731]: DUID 00:01:00:01:1a:7e:b5:e8:00:11:95:84:61:f3

mars 30 17:10:00 bigpopa dhcpcd[6731]: version 6.2.0 starting

mars 30 17:10:00 bigpopa NetworkManager[3958]: <info> Activation (eth0) Stage 3 of 5 (IP Configure Start) complete.

mars 30 17:10:00 bigpopa NetworkManager[3958]: <info> Activation (eth0) Beginning IP6 addrconf.

mars 30 17:10:00 bigpopa NetworkManager[3958]: <info> dhcpcd started with pid 6731

mars 30 17:10:00 bigpopa NetworkManager[3958]: <info> Activation (eth0) Beginning DHCPv4 transaction (timeout in 45 seconds)

mars 30 17:10:00 bigpopa NetworkManager[3958]: <info> (eth0): device state change: config -> ip-config (reason 'none') [50 70 0]

mars 30 17:10:00 bigpopa NetworkManager[3958]: <info> Activation (eth0) Stage 3 of 5 (IP Configure Start) started...

mars 30 17:10:00 bigpopa NetworkManager[3958]: <info> Activation (eth0) Stage 2 of 5 (Device Configure) complete.

mars 30 17:10:00 bigpopa NetworkManager[3958]: <info> Activation (eth0) Stage 3 of 5 (IP Configure Start) scheduled.

mars 30 17:10:00 bigpopa NetworkManager[3958]: <info> Activation (eth0) Stage 2 of 5 (Device Configure) successful.

mars 30 17:10:00 bigpopa NetworkManager[3958]: <info> (eth0): device state change: prepare -> config (reason 'none') [40 50 0]

mars 30 17:10:00 bigpopa NetworkManager[3958]: <info> Activation (eth0) Stage 2 of 5 (Device Configure) starting...

mars 30 17:10:00 bigpopa NetworkManager[3958]: <info> Activation (eth0) Stage 1 of 5 (Device Prepare) complete.

mars 30 17:10:00 bigpopa NetworkManager[3958]: <info> Activation (eth0) Stage 2 of 5 (Device Configure) scheduled...

mars 30 17:10:00 bigpopa NetworkManager[3958]: <info> Activation (eth0) Stage 1 of 5 (Device Prepare) started...

mars 30 17:10:00 bigpopa NetworkManager[3958]: <info> Activation (eth0) Stage 1 of 5 (Device Prepare) scheduled...

mars 30 17:10:00 bigpopa NetworkManager[3958]: <info> NetworkManager state is now CONNECTING

mars 30 17:10:00 bigpopa NetworkManager[3958]: <info> (eth0): device state change: disconnected -> prepare (reason 'none') [30 40 0]

mars 30 17:10:00 bigpopa NetworkManager[3958]: <info> Activation (eth0) starting connection 'Ethernet automatique'

mars 30 17:10:00 bigpopa NetworkManager[3958]: <info> Auto-activating connection 'Ethernet automatique'.

mars 30 17:09:57 bigpopa NetworkManager[3958]: <info> (eth0): deactivating device (reason 'none') [0]

mars 30 17:09:57 bigpopa NetworkManager[3958]: <info> (eth0): device state change: failed -> disconnected (reason 'none') [120 30 0]

mars 30 17:09:57 bigpopa NetworkManager[3958]: <info> Activation (eth0) Stage 4 of 5 (IPv4 Configure Timeout) complete.

mars 30 17:09:57 bigpopa NetworkManager[3958]: <warn> Activation (eth0) failed for connection 'Ethernet automatique'

mars 30 17:09:57 bigpopa NetworkManager[3958]: <info> NetworkManager state is now DISCONNECTED

mars 30 17:09:57 bigpopa NetworkManager[3958]: <info> (eth0): device state change: ip-config -> failed (reason 'ip-config-unavailable') [70 120 5]

mars 30 17:09:57 bigpopa NetworkManager[3958]: <info> Activation (eth0) Stage 4 of 5 (IPv4 Configure Timeout) started...

mars 30 17:09:57 bigpopa NetworkManager[3958]: <info> Activation (eth0) Stage 4 of 5 (IPv4 Configure Timeout) scheduled...

mars 30 17:09:57 bigpopa NetworkManager[3958]: <info> (eth0): DHCPv4 client pid 6718 exited with status 1

mars 30 17:09:57 bigpopa dhcpcd[6718]: exited

mars 30 17:09:57 bigpopa dhcpcd[6718]: timed out
```

This lsmod, before suspending, the part where it tells about network

```

02:00.0 Ethernet controller: Qualcomm Atheros AR8121/AR8113/AR8114 Gigabit or Fast Ethernet (rev b0)

   Subsystem: ASUSTeK Computer Inc. Device 8226

   Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-

   Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-

   Latency: 0, Cache Line Size: 32 bytes

   Interrupt: pin A routed to IRQ 11

   Region 0: Memory at fe9c0000 (64-bit, non-prefetchable) [size=256K]

   Region 2: I/O ports at cc00 [size=128]

   Capabilities: [40] Power Management version 2

      Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot+,D3cold+)

      Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-

   Capabilities: [48] MSI: Enable- Count=1/1 Maskable- 64bit+

      Address: 0000000000000000  Data: 0000

   Capabilities: [58] Express (v1) Endpoint, MSI 00

      DevCap:   MaxPayload 4096 bytes, PhantFunc 0, Latency L0s <4us, L1 unlimited

         ExtTag- AttnBtn+ AttnInd+ PwrInd+ RBE- FLReset-

      DevCtl:   Report errors: Correctable- Non-Fatal- Fatal- Unsupported-

         RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-

         MaxPayload 128 bytes, MaxReadReq 512 bytes

      DevSta:   CorrErr- UncorrErr+ FatalErr- UnsuppReq+ AuxPwr+ TransPend-

      LnkCap:   Port #0, Speed 2.5GT/s, Width x1, ASPM L0s, Latency L0 unlimited, L1 unlimited

         ClockPM- Surprise- LLActRep- BwNot-

      LnkCtl:   ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk-

         ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-

      LnkSta:   Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-

   Capabilities: [100 v1] Advanced Error Reporting

      UESta:   DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq+ ACSViol-

      UEMsk:   DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-

      UESvrt:   DLP+ SDES- TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-

      CESta:   RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr-

      CEMsk:   RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr-

      AERCap:   First Error Pointer: 14, GenCap+ CGenEn- ChkCap+ ChkEn-

   Capabilities: [180 v1] Device Serial Number ff-82-a7-32-00-23-54-ff

03:00.0 IDE interface: Marvell Technology Group Ltd. 88SE6121 SATA II / PATA Controller (rev b2) (prog-if 8f [Master SecP SecO PriP PriO])

   Subsystem: ASUSTeK Computer Inc. Device 82e0

   Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-

   Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-

   Latency: 0, Cache Line Size: 32 bytes

   Interrupt: pin A routed to IRQ 16

   Region 0: I/O ports at dc00 [size=8]

   Region 1: I/O ports at d880 [size=4]

   Region 2: I/O ports at d800 [size=8]

   Region 3: I/O ports at d480 [size=4]

   Region 4: I/O ports at d400 [size=16]

   Region 5: Memory at feaffc00 (32-bit, non-prefetchable) [size=1K]

   Capabilities: [48] Power Management version 2

      Flags: PMEClk- DSI- D1+ D2- AuxCurrent=0mA PME(D0+,D1+,D2-,D3hot+,D3cold-)

      Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=1 PME-

   Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit-

      Address: 00000000  Data: 0000

   Capabilities: [e0] Express (v1) Legacy Endpoint, MSI 00

      DevCap:   MaxPayload 128 bytes, PhantFunc 0, Latency L0s unlimited, L1 unlimited

         ExtTag- AttnBtn- AttnInd- PwrInd- RBE- FLReset-

      DevCtl:   Report errors: Correctable- Non-Fatal- Fatal- Unsupported-

         RlxdOrd- ExtTag- PhantFunc- AuxPwr+ NoSnoop-

         MaxPayload 128 bytes, MaxReadReq 512 bytes

      DevSta:   CorrErr- UncorrErr- FatalErr- UnsuppReq+ AuxPwr- TransPend-

      LnkCap:   Port #0, Speed 2.5GT/s, Width x1, ASPM L0s, Latency L0 <256ns, L1 unlimited

         ClockPM- Surprise- LLActRep- BwNot-

      LnkCtl:   ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk-

         ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-

      LnkSta:   Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-

   Capabilities: [100 v1] Advanced Error Reporting

      UESta:   DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-

      UEMsk:   DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-

      UESvrt:   DLP+ SDES- TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-

      CESta:   RxErr+ BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr-

      CEMsk:   RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+

      AERCap:   First Error Pointer: 1f, GenCap- CGenEn- ChkCap- ChkEn-

   Kernel driver in use: pata_marvell

   Kernel modules: ahci, pata_marvell, pata_acpi

05:00.0 Ethernet controller: VIA Technologies, Inc. VT6105/VT6106S [Rhine-III] (rev 86)

   Subsystem: D-Link System Inc DFE-530TX rev C

   Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-

   Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-

   Latency: 64 (750ns min, 2000ns max), Cache Line Size: 32 bytes

   Interrupt: pin A routed to IRQ 16

   Region 0: I/O ports at e800 [size=256]

   Region 1: Memory at febffc00 (32-bit, non-prefetchable) [size=256]

   Expansion ROM at febe0000 [disabled] [size=64K]

   Capabilities: [40] Power Management version 2

      Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold+)

      Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-

   Kernel driver in use: via-rhine

   Kernel modules: via_rhine
```

I seems that dhcpcd is getting jammed.... Any ideas ?

----------

## Zarhan

I don't use Networkmanager (I use ifplugd), but I have this same problem. Only solution seems to be killall -s 9 dhcpcd.

----------

## UberLord

 *Zarhan wrote:*   

> I don't use Networkmanager (I use ifplugd), but I have this same problem. Only solution seems to be killall -s 9 dhcpcd.

 

I don't have any Linux on a laptop.

Is there a way I can susped and resume a modern desktop so I can replicate and fix this?

Note the OP is from last year and dhcpcd has changed a lot since then.

What version of dhcpcd are you using?

Also, why are you using ifplugd? dhcpcd can monitor network link just fine by itself and swapping to it might fix the problem.

----------

## Zarhan

 *UberLord wrote:*   

>  *Zarhan wrote:*   I don't use Networkmanager (I use ifplugd), but I have this same problem. Only solution seems to be killall -s 9 dhcpcd. 
> 
> I don't have any Linux on a laptop.
> 
> Is there a way I can susped and resume a modern desktop so I can replicate and fix this?
> ...

 

I'm running dhcpcd 6.9.0.

And reason I'm using ifplugd is that no one has told me to stop using it  :Smile:  I installed it way back when I first installed gentoo, and then it was covered as part of official docs..

Anyway, a modern desktop should still suspend if you just use echo mem > /sys/power/state. At least my desktop machine does...

Also, replied to this old post, since I seem to have been encountering this problem for a while now, but this morning I got annoyed enough to actually search if anyone else has the same problem. It seems sporadic, not happening on every resume - typically I experience it at least a few times a week.

Also, if I do e.g. /etc/init.d/net.lan restart, The interface restart (or stop) typically cannot kill the dhcpcd process (it doesn't react to start-stop-daemon's signals).

----------

## UberLord

Can you try the dhcpcd-9999 ebuild please?

----------

## Zarhan

Sure, I can try that.

Anyway, this morning it happened again and it seems that it is indeed a conflict between dhcpcd and ifplugd, so I can probably fix this by removing ifplugd if it's not needed.

Looks like when suspending in KDE, it actually shuts down a bunch of devices, including the network interface, before finally suspending the entire computer. Ifplugd detects that. Only problem is that iflpugd only has time to *execute* the "interface down" script *after* resume. 

So, first dhcpcd acquires IP address. Then ifplugd brings the link down (however, do note that dhcpcd doesn't seem to be killable). Anyway, then ifplugd immediately detects that link is up and tries to enable the network interface - but it fails to start since dhcpcd is already up.

This is probably fixable if a) I remove ifplugd or b) dhcpcd starts respecting TERM signal.

```

Jun 28 09:50:15 localhost /usr/sbin/gpm[5912]: *** info [mice.c(1990)]: 

Jun 28 09:50:15 localhost /usr/sbin/gpm[5912]: imps2: Auto-detected intellimouse PS/2

Jun 28 09:50:15 localhost dhcpcd[17908]: lan: deleting address fe80::bf5:f0b3:3b87:d9ca

Jun 28 09:50:15 localhost dhcpcd[17908]: lan: deleting default route via 192.168.139.1

Jun 28 09:50:16 localhost laptop-mode[26621]: Laptop mode 

Jun 28 09:50:16 localhost laptop-mode[26623]: enabled, not active

Jun 28 09:50:16 localhost ifplugd(lan)[17704]: Link beat lost.

Jun 28 09:50:16 localhost laptop-mode[27648]: Laptop mode 

Jun 28 09:50:16 localhost laptop-mode[27649]: enabled, not active

Jun 28 09:50:17 localhost ifplugd(lan)[17704]: Executing '/etc/ifplugd/ifplugd.action lan down'.

Jun 28 09:50:17 localhost dhcpcd[17908]: lan: carrier acquired

Jun 28 09:50:17 localhost dhcpcd[17908]: lan: adding address fe80::bf5:f0b3:3b87:d9ca

Jun 28 09:50:17 localhost dhcpcd[17908]: lan: IAID f1:0b:ba:a7

Jun 28 09:50:17 localhost dhcpcd[17908]: received SIGHUP, rebinding

Jun 28 09:50:17 localhost dhcpcd[17908]: lan: IAID f1:0b:ba:a7

Jun 28 09:50:17 localhost acpid[5617]: client connected from 5957[0:0]

Jun 28 09:50:17 localhost acpid[5617]: 1 client rule loaded

Jun 28 09:50:17 localhost dhcpcd[17908]: lan: rebinding lease of 192.168.139.5

Jun 28 09:50:17 localhost dhcpcd[17908]: lan: soliciting an IPv6 router

Jun 28 09:50:17 localhost dhcpcd[17908]: lan: leased 192.168.139.5 for 86400 seconds

Jun 28 09:50:17 localhost dhcpcd[17908]: lan: adding route to 192.168.139.0/28

Jun 28 09:50:17 localhost dhcpcd[17908]: lan: adding default route via 192.168.139.1

Jun 28 09:50:17 localhost dhcpcd[17908]: lan: removing route to 192.168.139.0/28

Jun 28 09:50:18 localhost cron[28802]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons)

Jun 28 09:50:18 localhost run-crons[28813]: (root) CMD (/etc/cron.daily/makewhatis)

Jun 28 09:50:18 localhost run-crons[28870]: (root) CMD (/etc/cron.daily/mlocate)

Jun 28 09:50:20 localhost run-crons[28884]: (root) CMD (/etc/cron.daily/prelink)

Jun 28 09:50:22 localhost /etc/init.d/net.lan[28748]: start-stop-daemon: 1 process refused to stop

Jun 28 09:50:22 localhost ifplugd(lan)[17704]: client:  *   start-stop-daemon: 1 process refused to stop

Jun 28 09:50:22 localhost dhcpcd[17908]: lan: removing IP address 192.168.139.5/28

Jun 28 09:50:22 localhost dhcpcd[17908]: lan: deleting default route via 192.168.139.1

Jun 28 09:50:22 localhost ifplugd(lan)[17704]: Program executed successfully.

Jun 28 09:50:22 localhost ifplugd(lan)[17704]: Link beat detected.

Jun 28 09:50:23 localhost ifplugd(lan)[17704]: Executing '/etc/ifplugd/ifplugd.action lan up'.

Jun 28 09:50:23 localhost dhcpcd[29157]: dhcpcd already running on pid 17908 (/run/dhcpcd-lan.pid)

Jun 28 09:50:23 localhost ifplugd(lan)[17704]: client: dhcpcd already running on pid 17908 (/run/dhcpcd-lan.pid)

Jun 28 09:50:23 localhost /etc/init.d/net.lan[29008]: ERROR: net.lan failed to start

Jun 28 09:50:23 localhost ifplugd(lan)[17704]: client:  * ERROR: net.lan failed to start

Jun 28 09:50:23 localhost ifplugd(lan)[17704]: Program executed successfully.

```

----------

## UberLord

 *Zarhan wrote:*   

> This is probably fixable if a) I remove ifplugd or b) dhcpcd starts respecting TERM signal.

 

dhcpcd does respect the TERM signal  :Smile: 

However, like all good daemons, it ignores the TERM signal until it's ready to receive it.

The problem is that dhcpcd probably had a memory violation error or a tight infinite loop.

I can probably resolve the latter by adding a sigpending(3) check before the timeout checks, but the former is a due to bugs which crop up an just need it be fixed, which is also the likiest cause of your un-killable issue which is hopefully already resolved in the 9999 version.

----------

## Zarhan

Installed 9999 now.

Just a simple test and it's still refusing to stop.

I type in /etc/init.d/net.lan stop, I get

```
# /etc/init.d/net.lan stop

 * Bringing down interface lan

 *   Stopping dhcpcd on lan ...

 *   start-stop-daemon: 1 process refused to stop                         [ !! ]

 *   Stopping ifplugd on lan ...                                          [ ok ]

```

In /var/log/messages, I see this.

```
Jun 28 11:30:11 localhost dhcpcd[23167]: received SIGHUP, rebinding

Jun 28 11:30:11 localhost dhcpcd[23167]: lan: IAID f1:0b:ba:a7

Jun 28 11:30:11 localhost dhcpcd[23167]: lan: rebinding lease of 192.168.139.5

Jun 28 11:30:11 localhost dhcpcd[23167]: lan: adding route to 192.168.139.0/28

Jun 28 11:30:11 localhost dhcpcd[23167]: lan: soliciting an IPv6 router

Jun 28 11:30:16 localhost /etc/init.d/net.lan[24058]: start-stop-daemon: 1 process refused to stop

Jun 28 11:30:16 localhost ifplugd(lan)[27100]: Exiting.

Jun 28 11:30:16 localhost dhcpcd[23167]: lan: removing IP address 192.168.139.5/28

Jun 28 11:30:16 localhost dhcpcd[23167]: lan: deleting route to 192.168.139.0/28

Jun 28 11:30:16 localhost dhcpcd[23167]: lan: deleting default route via 192.168.139.1

Jun 28 11:30:16 localhost dhcpcd[23167]: lan: carrier lost

Jun 28 11:30:16 localhost dhcpcd[23167]: lan: deleting address fe80::bf5:f0b3:3b87:d9ca

```

----------

## Zarhan

Oh, and my dhcpcd options are "-p" and "-t 0".

The former because sometimes I just wish to acquire an IP address and keep using it even if DHCP server in the network dies (this happens typically in some test networks). "-t 0" is so that I don't need to watch dhcpcd processing in the foreground to get a lease, and I *do* want it to try forever.

----------

## UberLord

 *Zarhan wrote:*   

> 
> 
> ```
> Jun 28 11:30:11 localhost dhcpcd[23167]: received SIGHUP, rebinding
> 
> ...

 

Looks like net.lan is sending SIGHUP rather than SIGTERM to stop.

Try upgrading netifrc.

Oh, and my dhcpcd options are "-p" and "-t 0".

 *Zarhan wrote:*   

> The former because sometimes I just wish to acquire an IP address and keep using it even if DHCP server in the network dies (this happens typically in some test networks). "-t 0" is so that I don't need to watch dhcpcd processing in the foreground to get a lease, and I *do* want it to try forever.

 

Use "-b" instead of "-t 0"  :Smile: 

----------

## Zarhan

Upgrading the netifrc to the latest (0.3.1) seems to have fixed that one. In this case the signal sent is ALRM, not SIGHUP, and it seems to work (at least the /etc/init.d/net.lan stop test).

I'll see how this goes through suspend/resume cycles.

----------

## Zarhan

Haven't had this problem since last week now. Looks like the upgrade to later netifrc helped. I wonder why it isn't marked as stable...

----------

## UberLord

File a ticket asking it to be marked stable then.

----------

