Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Hardware Watchdog of the pi #50

Closed
FipsJr opened this issue Dec 14, 2016 · 7 comments
Closed

Enable Hardware Watchdog of the pi #50

FipsJr opened this issue Dec 14, 2016 · 7 comments

Comments

@FipsJr
Copy link

FipsJr commented Dec 14, 2016

I'm not sure if the built in hardware watchdog of the pi is enabled (default = off), e.g. when openHAB isn't responding any more or something else gets instable.
If not already done, you should think about enabling the hw wd.

@FipsJr FipsJr closed this as completed Jan 19, 2017
@FipsJr FipsJr reopened this Jan 19, 2017
@zdzichu
Copy link

zdzichu commented Feb 14, 2017

This is the job for the operating system itself - you can enable RuntimeWatchdogSec= in /etc/systemd/system.conf

OTOH, it would be nice if openHAB implented sd_notify() support, with application level watchdog.

@ThomDietrich
Copy link
Member

ThomDietrich commented Feb 14, 2017

@zdzichu the first part of your answer would be something in the scope of openHABian.

I'd be careful with adding all kinds of things, just because we can. The reason for adding a watchdog are not yet clear to me. I did not yet experience nor hear of an openHAB freeze/crash and if any part of the RPi hardware is unstable, it's probably wise to take care of that issue instead of automatically restarting (unnoticed).

Please enlighten me if I'm wrong. 😉

Regarding sd_notify(): Could you name the possibilities?

@zdzichu
Copy link

zdzichu commented Feb 18, 2017

Hi,

First, I'm sorry. I misread this bugreport, thinking it is about openHAB itself. It is not, this is a bugreport about openhabian. In such case, enabling system-wide watchdog in systemd is a good idea, and setting RuntimeWatchdogSec= is something that should be done by the distribution makers.

Now, answering to your question, Thom. Adding application-level watchdog is done to make sure application always run, and is restarted if hangs. But in case of openHAB this won't help. During few years of using openHAB, I never saw it hang. Is is so stable, there's noting to improve here :)
(I quite often see REST interface hang, requiring restart of openhab itself, but this case won't be caught by app watchdog).

Adding application watchdog is often tiny addition on top of basic systemd-notify implementation. This protocol is mainly for: a) informing systemd that application started and is ready to work; b) providing extended status info for administrator to see.
Now, with a) - when systemd knows exactly when application is ready, it can start any other services depending on openhab running at this moment. Without this, other application must resort to sleep & retry.

Implementation of systemd notify protocol is very simple, see here for example: https://github.com/faljse/SDNotify . But, having said all above, I don't see any obvious advantages of doing this in openHAB. It would be nice, but there is no great improvement to gain.

@ThomDietrich
Copy link
Member

Thanks for the exhaustive explanation! I'll tag @kaikreuzer

If you think an integration would give us certain benefits or new possibilities, you could create a PR! ;)

@ThomDietrich
Copy link
Member

I can actually think of a simple use case. The method SDNotify.sendStatus() could be used to inform systemd about the current state of openHAB. Users in the forum often think their installation is "working" because systemctl status says "active" ...

@skatun
Copy link

skatun commented Nov 29, 2017

My openhabian which is a very early version, hangs like every 2 month or so(I think this is due to the DMX binding or http binding). I have solved it by physically solder a switch to the power supply! This way my guest can easily restart it when needed.

@mstormi
Copy link
Contributor

mstormi commented Mar 26, 2020

already tagged "wontfix" and no news in 2,5yrs so I guess we should close this.

@mstormi mstormi closed this as completed Mar 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants