mirror of
https://github.com/systemd/systemd.git
synced 2024-12-23 00:53:36 +08:00
cde93897cd
Adds a new call sd_event_set_watchdog() that can be used to hook up the event loop with the watchdog supervision logic of systemd. If enabled and $WATCHDOG_USEC is set the event loop will ping the invoking systemd daemon right after coming back from epoll_wait() but not more often than $WATCHDOG_USEC/4. The epoll_wait() will sleep no longer than $WATCHDOG_USEC/4*3, to make sure the service manager is called in time. This means that setting WatchdogSec= in a .service file and calling sd_event_set_watchdog() in your daemon is enough to hook it up with the watchdog logic.
18 lines
659 B
SYSTEMD
18 lines
659 B
SYSTEMD
# This file is part of systemd.
|
|
#
|
|
# systemd is free software; you can redistribute it and/or modify it
|
|
# under the terms of the GNU Lesser General Public License as published by
|
|
# the Free Software Foundation; either version 2.1 of the License, or
|
|
# (at your option) any later version.
|
|
|
|
[Unit]
|
|
Description=Hostname Service
|
|
Documentation=man:systemd-hostnamed.service(8) man:hostname(5) man:machine-info(5)
|
|
Documentation=http://www.freedesktop.org/wiki/Software/systemd/hostnamed
|
|
|
|
[Service]
|
|
ExecStart=@rootlibexecdir@/systemd-hostnamed
|
|
BusName=org.freedesktop.hostname1
|
|
CapabilityBoundingSet=CAP_SYS_ADMIN CAP_DAC_OVERRIDE CAP_SYS_PTRACE
|
|
WatchdogSec=1min
|