device-mapper-multipath/0102-RHBZ-690828-systemd-unit-file.patch

59 lines
2.0 KiB
Diff
Raw Normal View History

---
Makefile.inc | 1 +
multipathd/Makefile | 2 ++
multipathd/multipathd.service | 14 ++++++++++++++
3 files changed, 17 insertions(+)
Index: multipath-tools/Makefile.inc
===================================================================
--- multipath-tools.orig/Makefile.inc
+++ multipath-tools/Makefile.inc
@@ -31,6 +31,7 @@ man5dir = $(prefix)/usr/share/man/ma
rcdir = $(prefix)/etc/rc.d/init.d
syslibdir = $(prefix)/$(LIB)
libdir = $(prefix)/$(LIB)/multipath
+unitdir = $(prefix)/lib/systemd/system
GZIP = /bin/gzip -9 -c
INSTALL_PROGRAM = install
Index: multipath-tools/multipathd/Makefile
===================================================================
--- multipath-tools.orig/multipathd/Makefile
+++ multipath-tools/multipathd/Makefile
@@ -36,6 +36,8 @@ install:
$(INSTALL_PROGRAM) -m 755 $(EXEC) $(DESTDIR)$(bindir)
$(INSTALL_PROGRAM) -d $(DESTDIR)$(rcdir)
$(INSTALL_PROGRAM) -m 755 multipathd.init.redhat $(DESTDIR)$(rcdir)/$(EXEC)
+ $(INSTALL_PROGRAM) -d $(DESTDIR)$(unitdir)
+ $(INSTALL_PROGRAM) -m 644 $(EXEC).service $(DESTDIR)$(unitdir)
$(INSTALL_PROGRAM) -d $(DESTDIR)$(mandir)
$(INSTALL_PROGRAM) -m 644 $(EXEC).8.gz $(DESTDIR)$(mandir)
@@ -43,6 +45,7 @@ uninstall:
rm -f $(DESTDIR)$(bindir)/$(EXEC)
rm -f $(DESTDIR)$(rcdir)/$(EXEC)
rm -f $(DESTDIR)$(mandir)/$(EXEC).8.gz
+ rm -f $(DESTDIR)$(unitdir)/$(EXEC).service
clean:
rm -f core *.o $(EXEC) *.gz
Index: multipath-tools/multipathd/multipathd.service
===================================================================
--- /dev/null
+++ multipath-tools/multipathd/multipathd.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Device-Mapper Multipath Device Controller
+Before=iscsi.service iscsid.service
+After=syslog.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/multipathd.pid
+ExecStart=/sbin/multipathd
+ExecReload=/bin/kill -HUP $MAINPID
+#ExecStop=/path/to/scrip delete-me if not necessary
+
+[Install]
+WantedBy=multi-user.target