watchdog

Who is refreshing hardware watchdog in Linux?

南笙酒味 提交于 2019-11-29 06:19:19
问题 I have a processor AT91SAM9G20 running a 2.6 kernel. Watchdog is enabled at bootstrap level and configured for 16 seconds. Watchdog mode register can be configured only once. When code hangs either in bootstrap, bootloader or kernel, the board reboots. But once kernel comes up even though watchdog is not refreshed in any of the applications, the board is not being reset after 16 seconds, but 15 minutes. Who is refreshing the watchdog? In our case, the watchdog should be influenced by

How to implement a watchdog timer in Python?

大城市里の小女人 提交于 2019-11-28 06:06:05
I would like to implement a simple watchdog timer in Python with two use cases: Watchdog ensures that a function doesn't execute longer than x seconds Watchdog ensures that certain regularly executed function does indeed execute at least every y seconds How do I do that? Sergiy Byelozyorov Just publishing my own solution to this: from threading import Timer class Watchdog: def __init__(self, timeout, userHandler=None): # timeout in seconds self.timeout = timeout self.handler = userHandler if userHandler is not None else self.defaultHandler self.timer = Timer(self.timeout, self.handler) self

python watchdog monitoring file for changes

独自空忆成欢 提交于 2019-11-28 03:04:25
Folks, I have a need to watch a log file for changes. After looking through stackoverflow questions, I see people recommending 'watchdog'. So i'm trying to test, and am not sure where to add the code for when files change: #!/usr/bin/python import time from watchdog.observers import Observer from watchdog.events import LoggingEventHandler if __name__ == "__main__": event_handler = LoggingEventHandler() observer = Observer() observer.schedule(event_handler, path='.', recursive=False) observer.start() try: while True: time.sleep(1) else: print "got it" except KeyboardInterrupt: observer.stop()

Can I create a software watchdog timer thread in C++ using Boost Signals2 and Threads?

北城余情 提交于 2019-11-27 23:06:07
I am running function Foo from somebody else's library in a single-threaded application currently. Most of the time, I make a call to Foo and it's really quick, some times, I make a call to Foo and it takes forever. I am not a patient man, if Foo is going to take forever, I want to stop execution of Foo and not call it with those arguments. What is the best way to call Foo in a controlled manner (my current environment is POSIX/C++) such that I can stop execution after a certain number of seconds. I feel like the right thing to do here is to create a second thread to call Foo, while in my main

how to use linux software watchdog

旧街凉风 提交于 2019-11-27 19:49:49
Hi can anybody tell me how to handle the software watchdog in linux .I have a program "SampleApplication" which runs continuously and I need to restart it if its hangs or closes unexpectedly. I was googling about this and found linux has watchdog at /dev/watchdog but dont know how to use it.Could someone help me with example. My question is where to I specify my application name and delay interval to restart . As I am new to linux please brief me with sample if possible. Thanks Most of the Unix/Linux init programs will manage daemons for you and restart them. Look into placing your service in

Run cron job only if it isn't already running

Deadly 提交于 2019-11-27 16:37:58
So I'm trying to set up a cron job as a sort of watchdog for a daemon that I've created. If the daemon errors out and fails, I want the cron job to periodically restart it... I'm not sure how possible this is, but I read through a couple of cron tutorials and couldn't find anything that would do what I'm looking for... My daemon gets started from a shell script, so I'm really just looking for a way to run a cron job ONLY if the previous run of that job isn't still running. I found this post , which did provide a solution for what I'm trying to do using lock files, not I'm not sure if there is

What's the best way to watchdog a desktop application?

自作多情 提交于 2019-11-27 12:05:50
I need some way to monitor a desktop application and restart it if it dies. Initially I assumed the best way would be to monitor/restart the process from a Windows service, until I found out that since Vista Windows services should not interact with the desktop I've seen several questions dealing with this issue, but every answer I've seen involved some kind of hack that is discouraged by Microsoft and will likely stop working in future OS updates. So, a Windows service is probably not an option anymore. I could probably just create a different desktop/console application to do this, but that

How to implement a watchdog timer in Python?

江枫思渺然 提交于 2019-11-27 01:11:39
问题 I would like to implement a simple watchdog timer in Python with two use cases: Watchdog ensures that a function doesn't execute longer than x seconds Watchdog ensures that certain regularly executed function does indeed execute at least every y seconds How do I do that? 回答1: Just publishing my own solution to this: from threading import Timer class Watchdog: def __init__(self, timeout, userHandler=None): # timeout in seconds self.timeout = timeout self.handler = userHandler if userHandler is

Can I create a software watchdog timer thread in C++ using Boost Signals2 and Threads?

余生颓废 提交于 2019-11-26 23:15:55
问题 I am running function Foo from somebody else's library in a single-threaded application currently. Most of the time, I make a call to Foo and it's really quick, some times, I make a call to Foo and it takes forever. I am not a patient man, if Foo is going to take forever, I want to stop execution of Foo and not call it with those arguments. What is the best way to call Foo in a controlled manner (my current environment is POSIX/C++) such that I can stop execution after a certain number of

What's the best way to watchdog a desktop application?

自古美人都是妖i 提交于 2019-11-26 15:54:50
问题 I need some way to monitor a desktop application and restart it if it dies. Initially I assumed the best way would be to monitor/restart the process from a Windows service, until I found out that since Vista Windows services should not interact with the desktop I've seen several questions dealing with this issue, but every answer I've seen involved some kind of hack that is discouraged by Microsoft and will likely stop working in future OS updates. So, a Windows service is probably not an