diff mbox

[RFC,v2,6/7] ndctl: nvdimmd: add the unit file of systemd for nvdimmd service

Message ID 20171114074704.3446-7-qi.fuli@jp.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

QI Fuli Nov. 14, 2017, 7:47 a.m. UTC
This patch adds and autotools to install the unit file of systemd for
nvdimmd service.

Signed-off-by: QI Fuli <qi.fuli@jp.fujitsu.com>
---
 nvdimmd/Makefile.am     | 7 +++++++
 nvdimmd/nvdimmd.service | 7 +++++++
 2 files changed, 14 insertions(+)
 create mode 100644 nvdimmd/nvdimmd.service
diff mbox

Patch

diff --git a/nvdimmd/Makefile.am b/nvdimmd/Makefile.am
index 6716547..bca0bc8 100644
--- a/nvdimmd/Makefile.am
+++ b/nvdimmd/Makefile.am
@@ -18,6 +18,12 @@  nvdimmd_LDADD = ../ndctl/lib/libndctl.la \
 		$(UUID_LIBS) \
 		$(UDEV_LIBS)
 
+unitfiles = nvdimmd.service
+
+unitdir = /usr/lib/systemd/system/
+
+unit_DATA = $(unitfiles)
+
 conffiles = nvdimmd.conf
 
 confdir = /etc/nvdimmd/
@@ -25,4 +31,5 @@  confdir = /etc/nvdimmd/
 conf_DATA = $(conffiles)
 
 EXTRA_DIST =\
+	$(unitfiles) \
 	$(conffiles)
diff --git a/nvdimmd/nvdimmd.service b/nvdimmd/nvdimmd.service
new file mode 100644
index 0000000..0b96aaa
--- /dev/null
+++ b/nvdimmd/nvdimmd.service
@@ -0,0 +1,7 @@ 
+[Unit]
+Description=Nvdimm Daemon
+
+[Service]
+Type=forking
+ExecStart=/usr/bin/nvdimmd
+ExecStop=/usr/bin/kill ${MAINPID}