summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* watchdog: Log watchdog updates for debugWilliam A. Kennington III2018-01-291-0/+3
| | | | | Change-Id: Ida0a2f58e128d037fdbb5d94259f1637be67d8ae Signed-off-by: William A. Kennington III <wak@google.com>
* argument: Reset optind before using getoptWilliam A. Kennington III2018-01-251-0/+7
| | | | | | | | | The getopt family of functions are globally stateful, we need to make sure that we reset the global state before using it otherwise we can't create arguments more than once. Change-Id: Ic673eb3592217329b95fde033a1f2773b6b980bf Signed-off-by: William A. Kennington III <wak@google.com>
* Spelling fixesGunnar Mills2017-10-252-2/+2
| | | | | Change-Id: I3a85e921f87401701f3ebb22e972e0d3f9cf19c1 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Don't set Interval by setting TimeRemainingPatrick Venture2017-09-122-6/+12
| | | | | | | | | | | | | This change allows one to set the TimeRemaining as a one-time shot, and also allows more straightforward control. -Changing the Interval doesn't reset the watchdog or update the TimeRemaining. -Changing the TimeRemaining doesn't set the Interval for future cycles. Change-Id: I03a3cdb9cc9e5c4bc034dc86d2b4324a5a4b7243 Signed-off-by: Patrick Venture <venture@google.com>
* Add option for daemon to continue running after timeoutPatrick Venture2017-08-234-3/+38
| | | | | | | | | Added new command line option that lets someone disable the watchdog timer on timer expiration instead of the default action of it exiting. Change-Id: I1c3414d4378872860ac083836cda4809fa26237a Signed-off-by: Patrick Venture <venture@google.com>
* Remove logging Watchdog reset requestVishwanatha Subbanna2017-06-151-3/+0
| | | | | | | | Since watchdog reset comes in very often, it floods the journal and hence it does not add any value. Change-Id: If36374511f7993126244e7c06da4bfa2dfcd0991 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Update Interval when timeRemaining is updatedVishwanatha Subbanna2017-06-082-0/+6
| | | | | | | | | | | | | | | | | | | | | | | A typical watchdog implementation would give these 2 features: - Setting the interval - Resetting the timer which also means poke This watchdog implementation does not provide a poke function and the same can be achieved by clients making these dbus calls in that order. 1) Get the Last set Interval 2) Set TimeRemaining field to result from #1 To achieve #1, this commit adds the support. This would make sure that the new timer would expire after last updated user interval from that time. Fixes openbmc/openbmc#767 Change-Id: I7393eb32992d7a08518ef463fd0a442df0772392 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Add .gitignore fileVishwanatha Subbanna2017-06-081-0/+52
| | | | | Change-Id: Ibbfcdea72f7cd9dc061fc1f77526121e3c1f34fa Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Commit error and exit the application on error scenariosVishwanatha Subbanna2017-06-084-31/+56
| | | | | | | | Typically sd_event* calls can not go wrong and if they do, better would be to terminate the application so we get a coredump. Change-Id: I899177c369332cabf6d9bc22daaa142b50d758d0 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Add Gtest to test watchdogVishwanatha Subbanna2017-06-069-6/+362
| | | | | Change-Id: Ia0268b6b18999b6dd6cfd26bcadcff25734306f0 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Call systemd target on timer expirationVishwanatha Subbanna2017-06-053-7/+28
| | | | | | | | | | User can pass an optional command line argument stating which systemd target needs to be called on timer expiration. The timeout handler will make sure that the systemd target is started prior to exiting. Change-Id: I37213ab28ad4166a47920dcb3dc79769c7f2af1a Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Invoke optional callback function on timer expirationVishwanatha Subbanna2017-06-024-9/+31
| | | | | | | | | | | | When the timer expires, it calls into it's own timeout handler which matches with sd_event callback handler. However, it is beneficial if the users of timer register their own callback routine so that they can execute some operations on timeout. Change-Id: Ia88cb4e3c17f6dd8d4528fa193ec7927f083a92b Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Implement Watchdog interfaceVishwanatha Subbanna2017-06-025-10/+220
| | | | | | | This commit gives concrete implementation of the interface. Change-Id: I3951c5811c8e6cff87c87842a1e3c538463bfde7 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Add timer class supportVishwanatha Subbanna2017-06-025-2/+291
| | | | | | | | Watchdog implementation uses sd_event_timer at the backend and this commit has that timer backend support. Change-Id: Ib6dbd5d6bb617c20d7361e0852a916aa506d5aad Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Add code to accept command line argumentsVishwanatha Subbanna2017-06-026-0/+255
| | | | | | | | | Accepts command line arguments for dbus object path, dbus service name and an optional systemd unit file to be called into when the timer expires. Change-Id: I3fbe59b36d73ed9f28de2596d77e6d2e99371622 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Initial commitPatrick Williams2016-12-141-0/+201
OpenPOWER on IntegriCloud