Send corosync-notifyd startup notification to systemd

Signed-off-by: Ferenc Wágner <wferi@debian.org>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
This commit is contained in:
Ferenc Wágner 2017-10-30 22:12:14 +01:00 committed by Jan Friesse
parent 63601197ed
commit 188f9bdb1e
3 changed files with 11 additions and 2 deletions

View File

@ -7,7 +7,7 @@ After=corosync.service
[Service]
EnvironmentFile=-@INITCONFIGDIR@/corosync-notifyd
ExecStart=@SBINDIR@/corosync-notifyd -f $OPTIONS
Type=simple
Type=notify
Restart=on-failure
[Install]

View File

@ -67,8 +67,9 @@ corosync_quorumtool_LDADD = $(LIBQB_LIBS) \
$(top_builddir)/lib/libquorum.la \
$(top_builddir)/lib/libvotequorum.la
corosync_notifyd_CFLAGS = $(DBUS_CFLAGS)
corosync_notifyd_CFLAGS = $(DBUS_CFLAGS) $(libsystemd_CFLAGS)
corosync_notifyd_LDADD = $(LIBQB_LIBS) $(DBUS_LIBS) $(SNMP_LIBS) \
$(libsystemd_LIBS) \
$(top_builddir)/lib/libcmap.la \
$(top_builddir)/lib/libcfg.la \
$(top_builddir)/lib/libquorum.la

View File

@ -60,6 +60,10 @@
#include <corosync/quorum.h>
#include <corosync/cmap.h>
#ifdef HAVE_LIBSYSTEMD
#include <systemd/sd-daemon.h>
#endif
/*
* generic declarations
*/
@ -1318,6 +1322,10 @@ main(int argc, char *argv[])
sig_exit_handler,
NULL);
#ifdef HAVE_LIBSYSTEMD
sd_notify (0, "READY=1");
#endif
qb_loop_run(main_loop);
#ifdef HAVE_DBUS