diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | build/subst.inc | 10 | ||||
-rw-r--r-- | system/Makefile.am | 13 | ||||
-rw-r--r-- | system/netdata.service.in (renamed from system/netdata.service) | 4 |
4 files changed, 25 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore index a12232743f..e6f03c7ad5 100644 --- a/.gitignore +++ b/.gitignore @@ -48,6 +48,7 @@ src/.project src/.settings/ src/TODO.txt src/rrddim_file.c +system/netdata.service valgrind.log valgrind2.log web/chart-info/ diff --git a/build/subst.inc b/build/subst.inc new file mode 100644 index 0000000000..18743abb72 --- /dev/null +++ b/build/subst.inc @@ -0,0 +1,10 @@ +.in: + if sed \ + -e 's#[@]localstatedir_POST@#$(localstatedir)#g' \ + -e 's#[@]sbindir_POST@#$(sbindir)#g' \ + $< > $@.tmp; then \ + mv "$@.tmp" "$@"; \ + else \ + rm -f "$@.tmp"; \ + false; \ + fi diff --git a/system/Makefile.am b/system/Makefile.am index d52fbddeb7..88da5341a1 100644 --- a/system/Makefile.am +++ b/system/Makefile.am @@ -2,8 +2,19 @@ # Copyright (C) 2015 Alon Bar-Lev <alon.barlev@gmail.com> # MAINTAINERCLEANFILES= $(srcdir)/Makefile.in +CLEANFILES = \ + netdata.service \ + $(NULL) + +include $(top_srcdir)/build/subst.inc + +SUFFIXES = .in + +nodist_noinst_DATA = \ + netdata.service \ + $(NULL) dist_noinst_DATA = \ netdata-openrc \ - netdata.service \ + netdata.service.in \ $(NULL) diff --git a/system/netdata.service b/system/netdata.service.in index 20a775b525..094670ffc3 100644 --- a/system/netdata.service +++ b/system/netdata.service.in @@ -7,8 +7,8 @@ Type=forking WorkingDirectory=/tmp User=root Group=root -PIDFile=/var/run/netdata.pid -ExecStart=/usr/sbin/netdata +PIDFile=@localstatedir_POST@/run/netdata.pid +ExecStart=@sbindir_POST@/netdata ExecStop=/bin/kill -SIGTERM $MAINPID TimeoutStopSec=30 |