From c0ead256da4f810a8c9a25946005b42d81f2c4e9 Mon Sep 17 00:00:00 2001 From: Wouter Verhelst Date: Thu, 23 Jun 2016 15:50:56 +0200 Subject: [PATCH] Fix generation of systemd unit file @sbindir@ wants us to do shell expansion, too. Use the same trick we use for manpages to accomplish that here -- in fact, symlink in the shell script snippet. --- configure.ac | 2 +- systemd/Makefile.am | 7 +++++++ systemd/{nbd@.service.in => nbd@.service.tmpl} | 0 systemd/sh.tmpl | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) rename systemd/{nbd@.service.in => nbd@.service.tmpl} (100%) create mode 120000 systemd/sh.tmpl diff --git a/configure.ac b/configure.ac index 1e1921a9..7201fd87 100644 --- a/configure.ac +++ b/configure.ac @@ -233,7 +233,7 @@ AC_CONFIG_FILES([Makefile man/nbd-trdump.1.sh man/nbdtab.5.sh systemd/Makefile - systemd/nbd@.service + systemd/nbd@.service.sh ]) AC_OUTPUT diff --git a/systemd/Makefile.am b/systemd/Makefile.am index b27968a9..5fcc7a1e 100644 --- a/systemd/Makefile.am +++ b/systemd/Makefile.am @@ -2,3 +2,10 @@ #systemdunitdir = $(DESTDIR)/$(SYSTEMDLOC) #systemdunit_DATA = nbd@.service #endif + +nbd@.service: nbd@.service.sh + sh nbd@.service.sh > nbd@.service + +nbd@.service.sh.in: nbd@.service.tmpl sh.tmpl + cat sh.tmpl nbd@.service.tmpl > nbd@.service.sh.in + echo EOF >> nbd@.service.sh.in diff --git a/systemd/nbd@.service.in b/systemd/nbd@.service.tmpl similarity index 100% rename from systemd/nbd@.service.in rename to systemd/nbd@.service.tmpl diff --git a/systemd/sh.tmpl b/systemd/sh.tmpl new file mode 120000 index 00000000..4fffc07b --- /dev/null +++ b/systemd/sh.tmpl @@ -0,0 +1 @@ +../man/sh.tmpl \ No newline at end of file