summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-09-08 21:29:42 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2017-09-08 21:29:42 -0400
commit860f47bfc21e2634d5a87af6b8e171d07f8aba62 (patch)
treec34137475831f9555aa4548b6d0faf2a43fba1b5
parent0607a0add0b3ac72169be53d072db48c31a018d7 (diff)
Makefile: set TimeoutStartSec=0 for sd versions < 229
-rw-r--r--Makefile5
-rw-r--r--systemd-timesyncd-wait.service.in2
2 files changed, 5 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 01b739e..0479e05 100644
--- a/Makefile
+++ b/Makefile
@@ -3,8 +3,11 @@ rootprefix = $(prefix)
rootlibexecdir = $(rootprefix)/lib/systemd
systemunitdir=$(rootprefix)/lib/systemd/system
+systemd_version = $(shell systemctl --version|sed -n '1{s/\S*\s\s*//;s/\s.*//;p}')
+
TIMESYNCD_PATH = $(rootlibexecdir)/systemd-timesyncd
RM = /bin/rm
+INFINITY = $(shell if test $(systemd_version) -ge 229; then echo infinity; else echo 0; fi)
####
@@ -30,7 +33,7 @@ install: $(addprefix $(DESTDIR),$(files.sys.all))
$(outdir)/%: $(srcdir)/%.go
go build -o $@ $<
-vars = rootlibexecdir TIMESYNCD_PATH RM
+vars = rootlibexecdir TIMESYNCD_PATH RM INFINITY
$(outdir)/%: $(srcdir)/%.in
sed $(foreach v,$(vars),-e 's|@$v@|$($v)|g') < $< > $@
diff --git a/systemd-timesyncd-wait.service.in b/systemd-timesyncd-wait.service.in
index e356dae..dd485e3 100644
--- a/systemd-timesyncd-wait.service.in
+++ b/systemd-timesyncd-wait.service.in
@@ -8,4 +8,4 @@ Wants=time-sync.target systemd-timesyncd-wait.socket
[Service]
Type=oneshot
ExecStart=@rootlibexecdir@/systemd-timesyncd-wait
-TimeoutStartSec=infinity
+TimeoutStartSec=@INFINITY@