build: generate proper systemd service file
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Alon Bar-Lev committed
Apr 2, 2016 at 19:58 UTC
1e40bc2dca82c794b1ef9473fa0d027f94014cb7
4 files changed
+25
-3
.gitignore
+1
@@ -48,6 +48,7 @@ src/.project
48
src/.settings/
49
src/TODO.txt
50
src/rrddim_file.c
51
+system/netdata.service
52
valgrind.log
53
valgrind2.log
54
web/chart-info/
build/subst.inc
new
+10
@@ -0,0 +1,10 @@
1
+.in:
2
+ if sed \
3
+ -e 's#[@]localstatedir_POST@#$(localstatedir)#g' \
4
+ -e 's#[@]sbindir_POST@#$(sbindir)#g' \
5
+ $< > $@.tmp; then \
6
+ mv "$@.tmp" "$@"; \
7
+ else \
8
+ rm -f "$@.tmp"; \
9
+ false; \
10
+ fi
system/Makefile.am
+12
-1
@@ -2,8 +2,19 @@
2
# Copyright (C) 2015 Alon Bar-Lev <alon.barlev@gmail.com>
3
#
4
MAINTAINERCLEANFILES= $(srcdir)/Makefile.in
5
+CLEANFILES = \
6
+ netdata.service \
7
+ $(NULL)
8
+
9
+include $(top_srcdir)/build/subst.inc
10
+
11
+SUFFIXES = .in
12
+
13
+nodist_noinst_DATA = \
14
+ netdata.service \
15
+ $(NULL)
16
17
dist_noinst_DATA = \
18
netdata-openrc \
8
- netdata.service \
19
+ netdata.service.in \
20
$(NULL)
system/netdata.service.in
renamed
+2
-2
@@ -7,8 +7,8 @@ Type=forking
7
WorkingDirectory=/tmp
8
User=root
9
Group=root
10
-PIDFile=/var/run/netdata.pid
11
-ExecStart=/usr/sbin/netdata
10
+PIDFile=@localstatedir_POST@/run/netdata.pid
11
+ExecStart=@sbindir_POST@/netdata
12
ExecStop=/bin/kill -SIGTERM $MAINPID
13
TimeoutStopSec=30
14