From 1e37851585ef96db8ed304fbdf5d3c9696560584 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 9 Sep 2017 11:38:13 -0400 Subject: wait.conf: Write ReadWritePaths= as ReadWriteDirectories= for sd < 231 --- Makefile | 6 ++++-- systemd-timesyncd.service.d-wait.conf.in | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 0479e05..d3f42a3 100644 --- a/Makefile +++ b/Makefile @@ -4,10 +4,12 @@ rootlibexecdir = $(rootprefix)/lib/systemd systemunitdir=$(rootprefix)/lib/systemd/system systemd_version = $(shell systemctl --version|sed -n '1{s/\S*\s\s*//;s/\s.*//;p}') +ge = $(shell test '$1' -ge '$2' && echo yes) TIMESYNCD_PATH = $(rootlibexecdir)/systemd-timesyncd RM = /bin/rm -INFINITY = $(shell if test $(systemd_version) -ge 229; then echo infinity; else echo 0; fi) +INFINITY = $(if $(call ge,$(systemd_version),229),infinity,0) +ReadWritePaths = $(if $(call ge,$(systemd_version),231),ReadWritePaths,ReadWriteDirectories) #### @@ -33,7 +35,7 @@ install: $(addprefix $(DESTDIR),$(files.sys.all)) $(outdir)/%: $(srcdir)/%.go go build -o $@ $< -vars = rootlibexecdir TIMESYNCD_PATH RM INFINITY +vars = rootlibexecdir TIMESYNCD_PATH RM INFINITY ReadWritePaths $(outdir)/%: $(srcdir)/%.in sed $(foreach v,$(vars),-e 's|@$v@|$($v)|g') < $< > $@ diff --git a/systemd-timesyncd.service.d-wait.conf.in b/systemd-timesyncd.service.d-wait.conf.in index 9ea5c42..b2c630a 100644 --- a/systemd-timesyncd.service.d-wait.conf.in +++ b/systemd-timesyncd.service.d-wait.conf.in @@ -8,5 +8,5 @@ ExecStart= ExecStart=@rootlibexecdir@/systemd-timesyncd-wrap @TIMESYNCD_PATH@ ExecStopPost=@RM@ -f -- /run/timesyncd/notify.sock ExecStartPre=@RM@ -f -- /run/timesyncd/notify.sock -ReadWritePaths=/run/timesyncd +@ReadWritePaths@=/run/timesyncd NotifyAccess=all -- cgit v1.2.3-54-g00ecf