Skip to content

WATCHDOG=trigger does not trigger watchdog actions. #5

@jclarijs

Description

@jclarijs

As per sd_notify (https://www.freedesktop.org/software/systemd/man/sd_notify.html), it should be possible to trigger a service's watchdog action by sending a notification with "WATCHDOG=trigger".

I try to trigger the watchdog action using the following code:

import sdnotify
notifier = sdnotify.SystemdNotifier()

def trigger_watchdog():
    notifier.notify("WATCHDOG=trigger")

This does not result in watchdog actions for the relevant service (i.e. it should restart the service, but doesn't). When I use the following trigger_watchdog function instead, the service is restarted as expected:

def trigger_watchdog():
    import subprocess
    subprocess.check_output(["systemd-notify", "WATCHDOG=trigger"])

I suspect the systemd-notify is parsing the "WATCHDOG=trigger" argument in some way, but haven't been able to find its source code.

Any help would be appreciated! I can upload a test service file + python script in order to reproduce this, if anybody looks into this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions