Service stop after ethernet goes down

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
User avatar
marcotini
Posts: 28
Joined: Thursday 16 February 2017 17:51
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Service stop after ethernet goes down

Post by marcotini »

In the first place, I use a Raspberry Pi connected via ethernet.

Sometimes the router is rebooting (or maybe I reboot manually), so the cable ethernet is disconnected. And when this happens the Domoticz service goes into exited.
How can I overcome to this problem? Here the log:

Code: Select all

Jun 11 09:12:08 homebridge dhcpcd[999]: eth0: carrier lost
Jun 11 09:12:08 homebridge kernel: [1890028.716856] smsc95xx 1-1.1:1.0 eth0: link down
Jun 11 09:12:08 homebridge avahi-daemon[472]: Withdrawing address record for 192.168.1.3 on eth0.
Jun 11 09:12:08 homebridge avahi-daemon[472]: Leaving mDNS multicast group on interface eth0.IPv4 with address 192.168.1.3.
Jun 11 09:12:08 homebridge avahi-daemon[472]: Interface eth0.IPv4 no longer relevant for mDNS.
Jun 11 09:12:08 homebridge dhcpcd[999]: eth0: deleting route to 192.168.1.0/24
Jun 11 09:12:08 homebridge dhcpcd[999]: eth0: deleting default route via 192.168.1.1
But there is no log of Domoticz.

When I replug the ethernet cable:

Code: Select all

Jun 11 09:13:07 homebridge kernel: [1890088.405328] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
Jun 11 09:13:07 homebridge dhcpcd[999]: eth0: carrier acquired
How can I see why Domoticz stop?

PS: and when the service goes to exited, I need to stop and then start (because It's not stopped really but somethings doesn't work).
SweetPants

Re: Service stop after ethernet goes down

Post by SweetPants »

Because the ethernet goes down, IP goes down, hence the WEB server has no IP address anymore and domoticz exits. Try to implement a auto-restart of domoticz service. There are numerous examples on the forum. I use monit on Linux, works well.
oliviers
Posts: 73
Joined: Wednesday 16 September 2015 22:10
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Paris area, France
Contact:

Re: Service stop after ethernet goes down

Post by oliviers »

Hello,
I reboot my router quite often (these boxes supplied by ISP are so unstable and buggy !), but I never noticed that Domiticz exited ...
I must say that I assigned a fixed IP to my Raspberry PI.... Maybe that makes the difference ??

Oliviers
Paris area
Raspberry Pi 4 - RFXComm 433 - IrTrans - Zwave
User avatar
marcotini
Posts: 28
Joined: Thursday 16 February 2017 17:51
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Service stop after ethernet goes down

Post by marcotini »

SweetPants wrote:Try to implement a auto-restart of domoticz service. There are numerous examples on the forum. I use monit on Linux, works well.
I already use a script for put it back, but if there is any sensor that send a signal to Domoticz in this few second (or minutes, depend on router) that signal is lost.
oliviers wrote:I must say that I assigned a fixed IP to my Raspberry PI.... Maybe that makes the difference ??
The IP is already static. But I don't understand why this happen. In localhost should be working anyways, right?

Edit: here that happen again just when the interface goes down. I execute ifdown eth0 and look what's happen:

Code: Select all

● domoticz.service - LSB: Home Automation System
   Loaded: loaded (/etc/init.d/domoticz.sh)
   Active: active (exited) since ven 2017-06-16 10:26:19 CEST; 7min ago
  Process: 28354 ExecStop=/etc/init.d/domoticz.sh stop (code=exited, status=0/SUCCESS)
  Process: 28411 ExecStart=/etc/init.d/domoticz.sh start (code=exited, status=0/SUCCESS)

giu 16 10:26:19 raspberrypi domoticz.sh[28411]: 2017-06-16 10:26:19.968  Domoticz V3.7976 (c)2012-2017 GizMoCuz
giu 16 10:26:19 raspberrypi domoticz.sh[28411]: 2017-06-16 10:26:19.968  Build Hash: eefd87d, Date: 2017-06-16 05:02:38
giu 16 10:26:19 raspberrypi domoticz[28416]: Domoticz is starting up....
giu 16 10:26:19 raspberrypi domoticz[28417]: Domoticz running...
giu 16 10:26:19 raspberrypi domoticz.sh[28411]: 2017-06-16 10:26:19.969  Startup Path: /home/pi/domoticz/
giu 16 10:26:19 raspberrypi domoticz.sh[28411]: domoticz: Domoticz is starting up....
giu 16 10:26:19 raspberrypi systemd[1]: Started LSB: Home Automation System.
giu 16 10:26:19 raspberrypi sudo[28391]: pam_unix(sudo:session): session closed for user root
giu 16 10:26:20 raspberrypi systemd[1]: Started LSB: Home Automation System.
Edit two: with the log I see this error:

Code: Select all

Jun 16 11:04:27 raspberrypi domoticz: Domoticz received fatal signal 6 !...
Jun 16 11:04:27 raspberrypi domoticz:   /home/pi/domoticz/domoticz() [0x1cca74]
Jun 16 11:04:27 raspberrypi domoticz:   /home/pi/domoticz/domoticz(_Z14signal_handleri+0x58) [0x1ccb2c]
Jun 16 11:04:27 raspberrypi domoticz:   /lib/arm-linux-gnueabihf/libc.so.6(__default_sa_restorer_v2+0) [0x76a6a180]
Jun 16 11:04:27 raspberrypi domoticz:   /lib/arm-linux-gnueabihf/libc.so.6(gsignal+0x38) [0x76a68f70]
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest