summaryrefslogtreecommitdiffstats
path: root/extras/systemd
diff options
context:
space:
mode:
Diffstat (limited to 'extras/systemd')
-rw-r--r--extras/systemd/Makefile.am9
-rw-r--r--extras/systemd/glustereventsd.service.in12
2 files changed, 18 insertions, 3 deletions
diff --git a/extras/systemd/Makefile.am b/extras/systemd/Makefile.am
index 3fc656b8262..82fa1aac690 100644
--- a/extras/systemd/Makefile.am
+++ b/extras/systemd/Makefile.am
@@ -1,5 +1,5 @@
-
-CLEANFILES =
+CLEANFILES = glustereventsd.service
+EXTRA_DIST = glustereventsd.service.in
SYSTEMD_DIR = @systemddir@
@@ -8,4 +8,7 @@ install-exec-local:
$(mkdir_p) $(DESTDIR)$(SYSTEMD_DIR); \
$(INSTALL_PROGRAM) glusterd.service $(DESTDIR)$(SYSTEMD_DIR)/; \
fi
-
+ @if [ @EVENTS_ENABLED@ = 1 ] && [ -d $(SYSTEMD_DIR) ]; then \
+ $(mkdir_p) $(DESTDIR)$(SYSTEMD_DIR); \
+ $(INSTALL_PROGRAM) glustereventsd.service $(DESTDIR)$(SYSTEMD_DIR)/; \
+ fi
diff --git a/extras/systemd/glustereventsd.service.in b/extras/systemd/glustereventsd.service.in
new file mode 100644
index 00000000000..2be3f25ac18
--- /dev/null
+++ b/extras/systemd/glustereventsd.service.in
@@ -0,0 +1,12 @@
+[Unit]
+Description=Gluster Events Notifier
+After=syslog.target network.target
+
+[Service]
+Type=simple
+ExecStart=@SBIN_DIR@/glustereventsd
+ExecReload=/bin/kill -SIGUSR2 $MAINPID
+KillMode=control-group
+
+[Install]
+WantedBy=multi-user.target