# restart network daemons without reboot

## skorefish

hello,

Is there a way to restart all network related daemons without a reboot. After hibernating the networkcard seems to lose contact to the network. AFter reboot this is solved, but ...   :Rolling Eyes: 

----------

## ian.au

Depends on your init system but generally:

OpenRC where <dev> = ie eth0 / enp3s0 / wlan0 

```
/etc/init.d/net.<dev> restart
```

Systemd it depends which service you are using ie. 

```
systemctl restart NetworkManager
```

Really shouldn't be necessary to do this to come back from hibernation though.

----------

## skorefish

 *Quote:*   

> Really shouldn't be necessary to do this to come back from hibernation though

 

I have no clue what is causing this... what can I do? btw restarting works but still no connection... Is there something else to restart in function of network connectivity ?

----------

## charles17

 *skorefish wrote:*   

> hello,
> 
> Is there a way to restart all network related daemons without a reboot. After hibernating the networkcard seems to lose contact to the network. [...]

 How does it show in ifconfig then?

----------

## skorefish

everything looks normal in ifconfig, but I can't ping anything

----------

## charles17

 *skorefish wrote:*   

> everything looks normal in ifconfig, but I can't ping anything

 What's your output of "route -n"?

----------

## khayyam

skorefish ...

you should give some idea of what kind of device this "networkcard" is, is this wired, wireless, what chipset, usb or pci, what are you using to 'hibernate' (kernel and userland). I suspect that hibernation is triggering powersave on the device, or that the driver has some issue and so needs 'blacklisted' ... without more details all that is simply guessing.

Also, have you looked in dmesg, or /var/log/hibernate.log (if using TuxOnIce and hibernate-script)?

best ... khay

----------

## skorefish

route -n

```
Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

0.0.0.0         192.168.2.1     0.0.0.0         UG    2      0        0 enp0s4

127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo

192.168.2.0     0.0.0.0         255.255.255.0   U     0      0        0 enp0s4

```

ifconfig

```
enp0s4: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

        inet 192.168.2.45  netmask 255.255.255.0  broadcast 192.168.2.255

        ether 00:03:0d:8a:3c:45  txqueuelen 1000  (Ethernet)

        RX packets 90  bytes 11272 (11.0 KiB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 106  bytes 23547 (22.9 KiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

```

cat /var/log/pm-suspend.log -> https://bpaste.net/show/dd616054a1c8

lpci -vv ->  https://bpaste.net/show/28d02f8cd76c

dmesg -> https://bpaste.net/show/f6b2676044e2

this stays the same after 

```
pm-hibernate
```

 *Quote:*   

> driver has some issue and so needs 'blacklisted' 

  How is this done, and what does this mean ?

----------

## khayyam

 *skorefish wrote:*   

> cat /var/log/pm-suspend.log -> https://bpaste.net/show/dd616054a1c8

 

skorefish ... I don't use pm-utils but from a look at the log two errors stick out, 'could not open /proc/modules: No such file or directory', and 's2disk: Could not stat the resume device file. Reason: No such file or directory'. With the former I imagine pm-utils doesn't then have a list of what modules are loaded, and so how it should manage them (ie, blacklist, unloading). The second error suggests it doesn't know where the hibernation image is written, or can't find it for some reason. So, these might be pm-utils qwerks, or your setup isn't configured correctly.

 *skorefish wrote:*   

>  *khayyam wrote:*   driver has some issue and so needs 'blacklisted' 
> 
> How is this done, and what does this mean?

 

All of that is supposed to be hidden from you for the sake of "ease-of-use" ... I don't know how pm-utils does this, I imagine via any of the 'hooks' listed in the above log ... anyhow, I'm not inclined to support freedesktop.org's intergration, you probably need to hire a Redhat Certified Engineer to figure out how it "just works" ;)

best ... khay

----------

## skorefish

 *Quote:*   

>  I don't use pm-utils

 

Khayyam are you using TuxOnIce, would it be worth trying ?

----------

## khayyam

 *skorefish wrote:*   

>  *Quote:*    I don't use pm-utils 
> 
> Khayyam are you using TuxOnIce, would it be worth trying ?

 

skorefish ... I use TuxOnIce in conjunction with sys-power/hibernate-script. Also in the mix is better-initramfs which allows me to suspend to a LVM swap within an encrypted root.

I'm not sure what kind of support pm-utils has for tuxonice, or if its designed for uswsusp exclusively, hibernate-script supports both tuxonice and uswsusp ... but all DE's (KDE, Gnome, XFCE, etc) expect pm-utils.

best ... khay

----------

