]> granicus.if.org Git - zfs/commitdiff
Tunable directory for zfs runtime scripts
authorAntonio Russo <antonio.e.russo@gmail.com>
Thu, 7 Jun 2018 16:59:59 +0000 (12:59 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 7 Jun 2018 16:59:59 +0000 (09:59 -0700)
zpool and zed place scripts in subdirectories of libexecdir. Some
distributions locate architecture independent scripts in other locations
(e.g. Debian). To avoid these paths getting out of sync, centralize the
definitions.

Build zfs-test's default.cfg by Makefile.  Use the new directory
logic building tests/zfs-tests/include/default.cfg.in.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Antonio Russo <antonio.e.russo@gmail.com>
Closes #7597

cmd/zed/Makefile.am
cmd/zpool/Makefile.am
config/user-libexec.m4 [new file with mode: 0644]
config/user.m4
configure.ac
man/man8/Makefile.am
man/man8/zed.8.in
man/man8/zfs-mount-generator.8.in
tests/zfs-tests/include/Makefile.am
tests/zfs-tests/include/default.cfg.in

index e9e38d8e56a1de597ad27237a86d9d461e20c777..9c11315f2a58347da1ed33b607093d17a63b7fa8 100644 (file)
@@ -54,14 +54,13 @@ dist_zedconf_DATA = \
        zed.d/zed-functions.sh \
        zed.d/zed.rc
 
-zedexecdir = $(libexecdir)/zfs/zed.d
+zedexecdir = $(zfsexecdir)/zed.d
 
 dist_zedexec_SCRIPTS = \
        zed.d/all-debug.sh \
        zed.d/all-syslog.sh \
        zed.d/data-notify.sh \
        zed.d/generic-notify.sh \
-       zed.d/history_event-zfs-list-cacher.sh \
        zed.d/resilver_finish-notify.sh \
        zed.d/scrub_finish-notify.sh \
        zed.d/statechange-led.sh \
@@ -71,7 +70,9 @@ dist_zedexec_SCRIPTS = \
        zed.d/pool_import-led.sh \
        zed.d/resilver_finish-start-scrub.sh
 
-zed.d/history_event-zfs-list-cacher.sh: %: %.in
+nodist_zedexec_SCRIPTS = zed.d/history_event-zfs-list-cacher.sh
+
+$(nodist_zedexec_SCRIPTS): %: %.in
        -$(SED) -e 's,@bindir\@,$(bindir),g' \
                -e 's,@runstatedir\@,$(runstatedir),g' \
                -e 's,@sbindir\@,$(sbindir),g' \
index 8e98fddd67729b28a4e0f3700965b9cba83121e8..c03da941dbb3de81e693585ceeaf3eb9bf30df20 100644 (file)
@@ -21,7 +21,7 @@ zpool_LDADD = \
 zpool_LDADD += -lm $(LIBBLKID)
 
 zpoolconfdir = $(sysconfdir)/zfs/zpool.d
-zpoolexecdir = $(libexecdir)/zfs/zpool.d
+zpoolexecdir = $(zfsexecdir)/zpool.d
 
 EXTRA_DIST = zpool.d/README
 
diff --git a/config/user-libexec.m4 b/config/user-libexec.m4
new file mode 100644 (file)
index 0000000..31bcea3
--- /dev/null
@@ -0,0 +1,9 @@
+AC_DEFUN([ZFS_AC_CONFIG_USER_ZFSEXEC], [
+       AC_ARG_WITH(zfsexecdir,
+               AC_HELP_STRING([--with-zfsexecdir=DIR],
+               [install scripts [[@<:@libexecdir@:>@/zfs]]]),
+               [zfsexecdir=$withval],
+               [zfsexecdir="${libexecdir}/zfs"])
+
+       AC_SUBST([zfsexecdir])
+])
index f2f366e3c9ff3a734e43291eeb0bed7055e01c6b..8c4655719b6924dad394583fba6914191eed5d0a 100644 (file)
@@ -17,6 +17,7 @@ AC_DEFUN([ZFS_AC_CONFIG_USER], [
        ZFS_AC_CONFIG_USER_RUNSTATEDIR
        ZFS_AC_CONFIG_USER_MAKEDEV_IN_SYSMACROS
        ZFS_AC_CONFIG_USER_MAKEDEV_IN_MKDEV
+       ZFS_AC_CONFIG_USER_ZFSEXEC
 
        ZFS_AC_TEST_FRAMEWORK
 
index b6fca99b45c6886f1a03d0a0752c9f68029fdd9e..486a97571a26a74b98b1b9d23a2f0b45c92bc828 100644 (file)
@@ -183,7 +183,6 @@ AC_CONFIG_FILES([
        tests/zfs-tests/cmd/threadsappend/Makefile
        tests/zfs-tests/cmd/xattrtest/Makefile
        tests/zfs-tests/include/Makefile
-       tests/zfs-tests/include/default.cfg
        tests/zfs-tests/tests/Makefile
        tests/zfs-tests/tests/functional/Makefile
        tests/zfs-tests/tests/functional/acl/Makefile
index 153cd518fa43122fda3c635b4b380a49b4fa17f5..5401ff06f2bb5d96cd4beb29f9c6aff425b2881f 100644 (file)
@@ -19,7 +19,7 @@ EXTRA_DIST = \
        zfs-mount-generator.8.in
 
 $(nodist_man_MANS): %: %.in
-       -$(SED) -e 's,@libexecdir\@,$(libexecdir),g' \
+       -$(SED) -e 's,@zfsexecdir\@,$(zfsexecdir),g' \
                -e 's,@runstatedir\@,$(runstatedir),g' \
                -e 's,@sysconfdir\@,$(sysconfdir),g' \
                $< >'$@'
index 645e91795aaa633f97b31ed7c88b62b839e1cfe7..097a8f4a7e557c26b8089261f89c2a75b06982b3 100644 (file)
@@ -201,7 +201,7 @@ The default directory for enabled ZEDLETs.
 .I @sysconfdir@/zfs/zed.d/zed.rc
 The default rc file for common variables used by ZEDLETs.
 .TP
-.I @libexecdir@/zfs/zed.d
+.I @zfsexecdir@/zed.d
 The default directory for installed ZEDLETs.
 .TP
 .I @runstatedir@/zed.pid
index 319ac8e5712b2563226234049de20c34d776fc67..79720601d62ae5ffa8d7effdef31b6b24cbdf662 100644 (file)
@@ -56,7 +56,7 @@ touch
 Then, enable the tracking ZEDLET:
 .PP
 .RS 4
-ln -s "@libexecdir@/zfs/zed.d/history_event-zfs-list-cacher.sh" "@sysconfdir@/zfs/zed.d/"
+ln -s "@zfsexecdir@/zed.d/history_event-zfs-list-cacher.sh" "@sysconfdir@/zfs/zed.d"
 
 systemctl enable zed.service
 
index 52e1c0a9f5179f7cc4ee386125b3c3b748bd553d..41e105287b48543471ac2ee813e280bd517f7f57 100644 (file)
@@ -2,13 +2,19 @@ pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/include
 dist_pkgdata_DATA = \
        blkdev.shlib \
        commands.cfg \
-       default.cfg \
        libtest.shlib \
        math.shlib \
        properties.shlib \
        zpool_script.shlib
 
-EXTRA_DIST=default.cfg.in
+EXTRA_DIST = default.cfg.in
+
+nodist_pkgdata_DATA = default.cfg
+
+$(nodist_pkgdata_DATA): %: %.in
+       -$(SED) -e 's,@zfsexecdir\@,$(zfsexecdir),g' \
+               -e 's,@sysconfdir\@,$(sysconfdir),g' \
+               $< >'$@'
 
 distclean-local::
        -$(RM) default.cfg
index 90d1d8bd69b3b7e71b2cb63c5a862cc9053e0cf0..e1e2a7e91f9c980469fee492a41e97b5bf728ef7 100644 (file)
 . $STF_SUITE/include/libtest.shlib
 
 # ZFS Directories
-export prefix=@prefix@
-export exec_prefix=@exec_prefix@
 export ZEDLET_ETC_DIR=${ZEDLET_ETC_DIR:-@sysconfdir@/zfs/zed.d}
-export ZEDLET_LIBEXEC_DIR=${ZEDLET_LIBEXEC_DIR:-@libexecdir@/zfs/zed.d}
+export ZEDLET_LIBEXEC_DIR=${ZEDLET_LIBEXEC_DIR:-@zfsexecdir@/zed.d}
 export ZPOOL_SCRIPT_DIR=${ZPOOL_SCRIPT_DIR:-@sysconfdir@/zfs/zpool.d}
 
 # Define run length constants