diff mbox

[RFC,3/4] ndctl: nvdimmd: notify/monitor the feathers of over threshold event

Message ID 0DEDF3B159719A448A49EF0E7B11E3222756C910@g01jpexmbkw01 (mailing list archive)
State New, archived
Headers show

Commit Message

QI Fuli Sept. 1, 2017, 1:47 a.m. UTC
Nvdimmd.service is the unit file of systemd for nvdimmd service.

Sign-off-by: QI Fuli <qi.fuli@jp.fujitsu.com>

---
nvdimmd/Makefile        | 4 ++++
nvdimmd/nvdimmd.service | 7 +++++++
2 files changed, 11 insertions(+)

--
QI Fuli <qi.fuli@jp.fujitsu.com>
diff mbox

Patch

diff --git a/nvdimmd/Makefile b/nvdimmd/Makefile
index 3908e5d..df7eb46 100644
--- a/nvdimmd/Makefile
+++ b/nvdimmd/Makefile
@@ -1,5 +1,6 @@ 
 CC		= gcc
 LIBS		= -ludev -luuid -lkmod
+DEST		= /usr/bin
 OBJS		= ../ndctl/lib/.libs/libndctl.o ../daxctl/lib/.libs/libdaxctl.o ../util/.libs/sysfs.o ../util/.libs/log.o ../ndctl/lib/.libs/libndctl-smart.o
 IDIR		= -I../ -I../ndctl
 PROGRAM	= nvdimmd
@@ -11,5 +12,8 @@  libnvdimmd.o:	libnvdimmd.c
 			$(CC) -o libnvdimmd.o $(IDIR) -c libnvdimmd.c
 nvdimmd.o:	nvdimmd.c
 			$(CC) -o nvdimmd.o $(IDIR) -c nvdimmd.c
+install:	nvdimmd nvdimmd.service
+			install -s nvdimmd $(DEST)
+			cp nvdimmd.service /usr/lib/systemd/system/
 clean:
 			rm -rf *.o $(PROGRAM)
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}