multipath: systemd unit file
authorBenjamin Marzinski <bmarzins@redhat.com>
Thu, 1 Sep 2011 17:08:29 +0000 (12:08 -0500)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Thu, 1 Sep 2011 19:42:50 +0000 (21:42 +0200)
Here is a systemd unit file for managing multipathd.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Makefile.inc
multipathd/Makefile
multipathd/multipathd.service [new file with mode: 0644]

index dbcbc3b..420aa0d 100644 (file)
@@ -31,6 +31,7 @@ man5dir     = $(prefix)/usr/share/man/man5
 rcdir      = $(prefix)/etc/init.d
 syslibdir   = $(prefix)/$(LIB)
 libdir     = $(prefix)/$(LIB)/multipath
+unitdir     = $(prefix)/lib/systemd/system
 
 GZIP        = /bin/gzip -9 -c
 INSTALL_PROGRAM = install
index 03b0aa2..b361bef 100644 (file)
@@ -35,6 +35,8 @@ install:
        $(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir)
        $(INSTALL_PROGRAM) -m 755 $(EXEC) $(DESTDIR)$(bindir)
        $(INSTALL_PROGRAM) -d $(DESTDIR)$(rcdir)
+       $(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)
 
@@ -42,6 +44,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
diff --git a/multipathd/multipathd.service b/multipathd/multipathd.service
new file mode 100644 (file)
index 0000000..38189c5
--- /dev/null
@@ -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=/sbin/multipathd reconfigure
+#ExecStop=/path/to/scrip delete-me if not necessary
+
+[Install]
+WantedBy=multi-user.target