summaryrefslogtreecommitdiffstats
path: root/etc/init.d
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2011-08-09 16:49:18 -0700
committerBrian Behlendorf <[email protected]>2011-08-19 16:26:14 -0700
commitaa2b4896c93bbb2652ddc5e10e66175e54ff56c8 (patch)
treee0868dd6517d1f17fe8ecb09096706c54760a31a /etc/init.d
parentf0102d6e75d51b8d92624ba054a3fa54c807fb7f (diff)
Fix autoconf variable substitution in init scripts.
Change the variable substitution in the init script templates according to the method described in the Autoconf manual; Chapter 4.7.2: Installation Directory Variables. Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'etc/init.d')
-rw-r--r--etc/init.d/.gitignore7
-rw-r--r--etc/init.d/Makefile.am25
-rw-r--r--etc/init.d/Makefile.in137
-rw-r--r--etc/init.d/zfs.arch.in2
-rw-r--r--etc/init.d/zfs.fedora.in2
-rw-r--r--etc/init.d/zfs.gentoo.in2
-rw-r--r--etc/init.d/zfs.lsb.in2
-rw-r--r--etc/init.d/zfs.lunar.in2
-rw-r--r--etc/init.d/zfs.redhat.in2
9 files changed, 128 insertions, 53 deletions
diff --git a/etc/init.d/.gitignore b/etc/init.d/.gitignore
index 601a25a46..73304bc2c 100644
--- a/etc/init.d/.gitignore
+++ b/etc/init.d/.gitignore
@@ -1,6 +1 @@
-zfs.arch
-zfs.fedora
-zfs.gentoo
-zfs.lsb
-zfs.lunar
-zfs.redhat
+zfs
diff --git a/etc/init.d/Makefile.am b/etc/init.d/Makefile.am
index 00bb2681a..94a21680b 100644
--- a/etc/init.d/Makefile.am
+++ b/etc/init.d/Makefile.am
@@ -1,5 +1,22 @@
-EXTRA_DIST = zfs.fedora zfs.gentoo zfs.lsb zfs.lunar zfs.redhat zfs.arch
+initdir = $(DEFAULT_INIT_DIR)
+init_SCRIPTS = zfs
-install-data-local:
- @instdest=$(DESTDIR)$(DEFAULT_INIT_DIR)/zfs; \
- $(INSTALL) -TD zfs.$(DEFAULT_INIT_SCRIPT) $$instdest
+EXTRA_DIST = \
+ $(top_srcdir)/etc/init.d/zfs.fedora.in \
+ $(top_srcdir)/etc/init.d/zfs.gentoo.in \
+ $(top_srcdir)/etc/init.d/zfs.lsb.in \
+ $(top_srcdir)/etc/init.d/zfs.lunar.in \
+ $(top_srcdir)/etc/init.d/zfs.redhat.in \
+ $(top_srcdir)/etc/init.d/zfs.arch.in
+
+$(init_SCRIPTS):
+ -$(SED) -e 's,@bindir\@,$(bindir),g' \
+ -e 's,@sbindir\@,$(sbindir),g' \
+ -e 's,@udevdir\@,$(udevdir),g' \
+ -e 's,@udevruledir\@,$(udevruledir),g' \
+ -e 's,@sysconfdir\@,$(sysconfdir),g' \
+ -e 's,@initdir\@,$(initdir),g' \
+ 'zfs.$(DEFAULT_INIT_SCRIPT).in' >'$@'
+
+distclean-local::
+ -$(RM) $(init_SCRIPTS)
diff --git a/etc/init.d/Makefile.in b/etc/init.d/Makefile.in
index 6ca2e27f7..32c73dc9e 100644
--- a/etc/init.d/Makefile.in
+++ b/etc/init.d/Makefile.in
@@ -14,6 +14,7 @@
# PARTICULAR PURPOSE.
@SET_MAKE@
+
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@@ -35,10 +36,7 @@ build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = etc/init.d
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
- $(srcdir)/zfs.arch.in $(srcdir)/zfs.fedora.in \
- $(srcdir)/zfs.gentoo.in $(srcdir)/zfs.lsb.in \
- $(srcdir)/zfs.lunar.in $(srcdir)/zfs.redhat.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = \
$(top_srcdir)/config/always-no-unused-but-set-variable.m4 \
@@ -88,9 +86,31 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/zfs_config.h
-CONFIG_CLEAN_FILES = zfs.arch zfs.gentoo zfs.lunar zfs.fedora zfs.lsb \
- zfs.redhat
+CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__installdirs = "$(DESTDIR)$(initdir)"
+SCRIPTS = $(init_SCRIPTS)
AM_V_GEN = $(am__v_GEN_$(V))
am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
am__v_GEN_0 = @echo " GEN " $@;
@@ -270,7 +290,16 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
udevdir = @udevdir@
udevruledir = @udevruledir@
-EXTRA_DIST = zfs.fedora zfs.gentoo zfs.lsb zfs.lunar zfs.redhat zfs.arch
+initdir = $(DEFAULT_INIT_DIR)
+init_SCRIPTS = zfs
+EXTRA_DIST = \
+ $(top_srcdir)/etc/init.d/zfs.fedora.in \
+ $(top_srcdir)/etc/init.d/zfs.gentoo.in \
+ $(top_srcdir)/etc/init.d/zfs.lsb.in \
+ $(top_srcdir)/etc/init.d/zfs.lunar.in \
+ $(top_srcdir)/etc/init.d/zfs.redhat.in \
+ $(top_srcdir)/etc/init.d/zfs.arch.in
+
all: all-am
.SUFFIXES:
@@ -304,18 +333,40 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
-zfs.arch: $(top_builddir)/config.status $(srcdir)/zfs.arch.in
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-zfs.gentoo: $(top_builddir)/config.status $(srcdir)/zfs.gentoo.in
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-zfs.lunar: $(top_builddir)/config.status $(srcdir)/zfs.lunar.in
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-zfs.fedora: $(top_builddir)/config.status $(srcdir)/zfs.fedora.in
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-zfs.lsb: $(top_builddir)/config.status $(srcdir)/zfs.lsb.in
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-zfs.redhat: $(top_builddir)/config.status $(srcdir)/zfs.redhat.in
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+install-initSCRIPTS: $(init_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(initdir)" || $(MKDIR_P) "$(DESTDIR)$(initdir)"
+ @list='$(init_SCRIPTS)'; test -n "$(initdir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n' \
+ -e 'h;s|.*|.|' \
+ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+ if (++n[d] == $(am__install_max)) { \
+ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+ else { print "f", d "/" $$4, $$1 } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(initdir)$$dir'"; \
+ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(initdir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-initSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(init_SCRIPTS)'; test -n "$(initdir)" || exit 0; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 's,.*/,,;$(transform)'`; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(initdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(initdir)" && rm -f $$files
mostlyclean-libtool:
-rm -f *.lo
@@ -361,8 +412,11 @@ distdir: $(DISTFILES)
done
check-am: all-am
check: check-am
-all-am: Makefile
+all-am: Makefile $(SCRIPTS)
installdirs:
+ for dir in "$(DESTDIR)$(initdir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
@@ -394,7 +448,7 @@ clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
-distclean-am: clean-am distclean-generic
+distclean-am: clean-am distclean-generic distclean-local
dvi: dvi-am
@@ -408,7 +462,7 @@ info: info-am
info-am:
-install-data-am: install-data-local
+install-data-am: install-initSCRIPTS
install-dvi: install-dvi-am
@@ -452,26 +506,35 @@ ps: ps-am
ps-am:
-uninstall-am:
+uninstall-am: uninstall-initSCRIPTS
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
- distclean distclean-generic distclean-libtool distdir dvi \
- dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-data-local install-dvi \
+ distclean distclean-generic distclean-libtool distclean-local \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
- install-html-am install-info install-info-am install-man \
- install-pdf install-pdf-am install-ps install-ps-am \
- install-strip installcheck installcheck-am installdirs \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- uninstall uninstall-am
-
-
-install-data-local:
- @instdest=$(DESTDIR)$(DEFAULT_INIT_DIR)/zfs; \
- $(INSTALL) -TD zfs.$(DEFAULT_INIT_SCRIPT) $$instdest
+ install-html-am install-info install-info-am \
+ install-initSCRIPTS install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
+ uninstall-initSCRIPTS
+
+
+$(init_SCRIPTS):
+ -$(SED) -e 's,@bindir\@,$(bindir),g' \
+ -e 's,@sbindir\@,$(sbindir),g' \
+ -e 's,@udevdir\@,$(udevdir),g' \
+ -e 's,@udevruledir\@,$(udevruledir),g' \
+ -e 's,@sysconfdir\@,$(sysconfdir),g' \
+ -e 's,@initdir\@,$(initdir),g' \
+ 'zfs.$(DEFAULT_INIT_SCRIPT).in' >'$@'
+
+distclean-local::
+ -$(RM) $(init_SCRIPTS)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/etc/init.d/zfs.arch.in b/etc/init.d/zfs.arch.in
index de2ea8a2d..9fa7cb4bc 100644
--- a/etc/init.d/zfs.arch.in
+++ b/etc/init.d/zfs.arch.in
@@ -5,7 +5,7 @@
ZFS="@sbindir@/zfs"
ZPOOL="@sbindir@/zpool"
-ZPOOL_CACHE="@sysconfdir@/zfs/zpool.cache"
+ZPOOL_CACHE="@initdir@/zpool.cache"
case "$1" in
start)
diff --git a/etc/init.d/zfs.fedora.in b/etc/init.d/zfs.fedora.in
index 04f2077ce..1583a109e 100644
--- a/etc/init.d/zfs.fedora.in
+++ b/etc/init.d/zfs.fedora.in
@@ -32,7 +32,7 @@ export PATH=/usr/local/sbin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
RETVAL=0
ZFS="@sbindir@/zfs"
ZPOOL="@sbindir@/zpool"
-ZPOOL_CACHE="@sysconfdir@/zfs/zpool.cache"
+ZPOOL_CACHE="@initdir@/zpool.cache"
servicename=zfs
LOCKFILE=/var/lock/subsys/$servicename
diff --git a/etc/init.d/zfs.gentoo.in b/etc/init.d/zfs.gentoo.in
index 767aba8f9..31a539cc8 100644
--- a/etc/init.d/zfs.gentoo.in
+++ b/etc/init.d/zfs.gentoo.in
@@ -13,7 +13,7 @@ depend()
ZFS="@sbindir@/zfs"
ZPOOL="@sbindir@/zpool"
-ZPOOL_CACHE="@sysconfdir@/zfs/zpool.cache"
+ZPOOL_CACHE="@initdir@/zpool.cache"
ZFS_MODULE=zfs
checksystem() {
diff --git a/etc/init.d/zfs.lsb.in b/etc/init.d/zfs.lsb.in
index c781f05f4..675effe0d 100644
--- a/etc/init.d/zfs.lsb.in
+++ b/etc/init.d/zfs.lsb.in
@@ -33,7 +33,7 @@ RETVAL=0
LOCKFILE=/var/lock/zfs
ZFS="@sbindir@/zfs"
ZPOOL="@sbindir@/zpool"
-ZPOOL_CACHE="@sysconfdir@/zfs/zpool.cache"
+ZPOOL_CACHE="@initdir@/zpool.cache"
[ -x $ZPOOL ] || exit 1
[ -x $ZFS ] || exit 2
diff --git a/etc/init.d/zfs.lunar.in b/etc/init.d/zfs.lunar.in
index 97384dc83..22df3d2b5 100644
--- a/etc/init.d/zfs.lunar.in
+++ b/etc/init.d/zfs.lunar.in
@@ -12,7 +12,7 @@
ZFS="@sbindir@/zfs"
ZPOOL="@sbindir@/zpool"
-ZPOOL_CACHE="@sysconfdir@/zfs/zpool.cache"
+ZPOOL_CACHE="@initdir@/zpool.cache"
case $1 in
start) echo "$1ing ZFS filesystems"
diff --git a/etc/init.d/zfs.redhat.in b/etc/init.d/zfs.redhat.in
index ae797c11a..2b48e95e9 100644
--- a/etc/init.d/zfs.redhat.in
+++ b/etc/init.d/zfs.redhat.in
@@ -32,7 +32,7 @@ export PATH=/usr/local/sbin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
RETVAL=0
ZFS="@sbindir@/zfs"
ZPOOL="@sbindir@/zpool"
-ZPOOL_CACHE="@sysconfdir@/zfs/zpool.cache"
+ZPOOL_CACHE="@initdir@/zpool.cache"
servicename=zfs
LOCKFILE=/var/lock/subsys/$servicename