Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.8.3: Wrong paths in zfs-functions script #9443

Closed
mazouffre opened this issue Oct 10, 2019 · 17 comments
Closed

0.8.3: Wrong paths in zfs-functions script #9443

mazouffre opened this issue Oct 10, 2019 · 17 comments
Labels
Type: Building Indicates an issue related to building binaries

Comments

@mazouffre
Copy link
Contributor

System information

Type Version/Name
Distribution Name CentOS 6
Distribution Version 6.10
Linux Kernel 4.14.x
Architecture x86_64
ZFS Version 0.8.0-308_g94bcf6f
SPL Version 0.8.0-308_g94bcf6f

Describe the problem you're observing

With the lastest version of ZFS On Linux, the ZFS init scripts for CentOS 6 are not working anymore because /usr/local is used as prefix in zfs-functions:

cat /etc/zfs/zfs-functions | grep /local
ZFS="/usr/local/sbin/zfs"
ZED="/usr/local/sbin/zed"
ZPOOL="/usr/local/sbin/zpool"
ZPOOL_CACHE="/usr/local/etc/zfs/zpool.cache

The ZFS packages are generated with make rpm-utils . I don't know if it is related, but make rpm-utils is called after ./configure --enable-linux-builtin as we do an in-tree build.

Reverting this commit fixes the regression: 9323aad.

The log of configure:
config.log

The output of make:
make.zfs.rpm-utils.log

Before the commit, the script is generated by this:

if [ -e /etc/debian_version ]; then \
		NFS_SRV=nfs-kernel-server; \
	  else \
		NFS_SRV=nfs; \
	  fi; \
	  if [ -e /sbin/openrc-run ]; then \
		SHELL=/sbin/openrc-run; \
	  else \
		SHELL=/bin/sh; \
	  fi; \
	  /bin/sed -e 's,@bindir\@,/usr/bin,g' \
		 -e 's,@sbindir\@,/sbin,g' \
		 -e 's,@udevdir\@,/lib/udev,g' \
		 -e 's,@udevruledir\@,/lib/udev/rules.d,g' \
		 -e 's,@sysconfdir\@,/etc,g' \
		 -e 's,@initconfdir\@,/etc/sysconfig,g' \
		 -e 's,@initdir\@,/etc/init.d,g' \
		 -e 's,@runstatedir\@,/var/run,g' \
		 -e "s,@SHELL\@,$SHELL,g" \
		 -e "s,@NFS_SRV\@,$NFS_SRV,g" \
		 zfs-functions.in >'zfs-functions'; \
	  [ 'zfs-functions' = 'zfs-functions' -o 'zfs-functions' = 'zfs' ] || \
		chmod +x 'zfs-functions')

After:

make -C ../../etc/init.d zfs zfs-functions
make -C ../../etc/init.d zfs zfs-functions
...
(if [ -e /etc/debian_version ]; then \
		NFS_SRV=nfs-kernel-server; \
	  else \
		NFS_SRV=nfs; \
	  fi; \
	  if [ -e /sbin/openrc-run ]; then \
		SHELL=/sbin/openrc-run; \
	  else \
		SHELL=/bin/sh; \
	  fi; \
	  /bin/sed -e 's,@bindir\@,/usr/local/bin,g' \
		 -e 's,@sbindir\@,/usr/local/sbin,g' \
		 -e 's,@udevdir\@,/lib/udev,g' \
		 -e 's,@udevruledir\@,/lib/udev/rules.d,g' \
		 -e 's,@sysconfdir\@,/usr/local/etc,g' \
		 -e 's,@initconfdir\@,/etc/sysconfig,g' \
		 -e 's,@initdir\@,/usr/local/etc/init.d,g' \
		 -e 's,@runstatedir\@,/usr/local/var/run,g' \
		 -e "s,@SHELL\@,$SHELL,g" \
		 -e "s,@NFS_SRV\@,$NFS_SRV,g" \
		 zfs-functions.in >'zfs-functions'; \
	  [ 'zfs-functions' = 'zfs-functions' -o 'zfs-functions' = 'zfs' ] || \
		chmod +x 'zfs-functions')
(if [ -e /etc/debian_version ]; then \
		NFS_SRV=nfs-kernel-server; \
	  else \
		NFS_SRV=nfs; \
	  fi; \
	  if [ -e /sbin/openrc-run ]; then \
		SHELL=/sbin/openrc-run; \
	  else \
		SHELL=/bin/sh; \
	  fi; \
	  /bin/sed -e 's,@bindir\@,/usr/local/bin,g' \
		 -e 's,@sbindir\@,/usr/local/sbin,g' \
		 -e 's,@udevdir\@,/lib/udev,g' \
		 -e 's,@udevruledir\@,/lib/udev/rules.d,g' \
		 -e 's,@sysconfdir\@,/usr/local/etc,g' \
		 -e 's,@initconfdir\@,/etc/sysconfig,g' \
		 -e 's,@initdir\@,/usr/local/etc/init.d,g' \
		 -e 's,@runstatedir\@,/usr/local/var/run,g' \
		 -e "s,@SHELL\@,$SHELL,g" \
		 -e "s,@NFS_SRV\@,$NFS_SRV,g" \
		 zfs-functions.in >'zfs-functions'; \
	  [ 'zfs-functions' = 'zfs-functions' -o 'zfs-functions' = 'zfs' ] || \
		chmod +x 'zfs-functions')
...
	cp ../../etc/init.d/zfs-functions \
	    /tmp/zfs-build-toor-1aCjG3VQ/BUILDROOT/zfs-0.8.0-308_g94bcf6f.el6.x86_64/etc/zfs/
@rlaager
Copy link
Member

rlaager commented Dec 14, 2019

The substitutions themselves seem fine. The question is, why is @bindir@ under /usr/local?

In config.log, line 3331, prefix is set to /usr/local. I wonder if that's related. From a quick glance, is ./configure getting called a second time for some sort of code coverage check?

@behlendorf behlendorf added the Type: Building Indicates an issue related to building binaries label Dec 16, 2019
@gyakovlev
Copy link
Contributor

just hit this packaging 0.8.3 for gentoo and haven't figured out yet.
What I see is after make install there still a lot of compilation happens.
still digging.

@fdr
Copy link

fdr commented Jan 31, 2020

So, after updating someone is in for a nasty surprise once they re-boot on CentOS 6. Should something be done about this, even if it's going back to 0.8.2 in the yum repository?

@rlaager
Copy link
Member

rlaager commented Feb 4, 2020

@dmaziuk @fdr @mazouffre I'm not a RedHat guy. Can any of you explain how the RPMs are built? Are you running ./configure yourself? If so, are you passing --prefix=/usr, --prefix=/usr/local, or not passing --prefix at all?

Can you specifically test with something like:

./configure --prefix=/usr
make rpm-utils

@behlendorf Who builds the official RPMs? It sounds like they're broken too in the same way. Are they specifying --prefix=/usr?

@fdr
Copy link

fdr commented Feb 4, 2020

Can any of you explain how the RPMs are built? Are you running ./configure yourself?

Huh? No. Just "yum install" from the zol repo as I have for years. I capture a fresh VM image once in a while and test it before putting anything important on it, and noticed reboots were busted thankfully before anything shipped.

I can try building the RPM tomorrow to see what happens, if it comes easily.

@dmaziuk
Copy link

dmaziuk commented Feb 4, 2020

@dmaziuk @fdr @mazouffre I'm not a RedHat guy. Can any of you explain how the RPMs are built? Are you running ./configure yourself? If so, are you passing --prefix=/usr, --prefix=/usr/local, or not passing --prefix at all?

No, that's the point of #9890: the problem is rpms in zfs-kmod repository built by ZoL team. Anyone who tracks that repo has dead systems, they just know it yet if they haven't rebooted.

The build problem is the bug to be fixed for next release, the "poison pill" rpms should've been removed from the repo right flipping now to limit the damage.

@behlendorf
Copy link
Contributor

We're looking in to the problematic CentOS 6 packages and why they contain the wrong paths.

@dmaziuk
Copy link

dmaziuk commented Feb 4, 2020

I'm sure you are, but not pulling the rpms from the public repo in the meantime is the problem.

@eborisch
Copy link

eborisch commented Feb 5, 2020

The wrong (with '/usr/local') paths are in the /etc/zfs/zfs_functions file in zfs-0.8.3-1.el6.x86_64 from the DKMS ZoL epel/6 repository, so it's not just the zfs-kmod repo. A quick %s/\/usr\/local// in vim fixed it right up, but it is a bit of a shock to the system initially...

@eborisch
Copy link

eborisch commented Feb 5, 2020

Perhaps update the issue name to be CentOS 6 (0.8.3): Wrong paths... for people landing here looking for where their pools went.

@rlaager rlaager changed the title Wrong paths in zfs-functions script CentOS 6 (0.8.3): Wrong paths in zfs-functions script Feb 5, 2020
rlaager added a commit to rlaager/zfs that referenced this issue Feb 6, 2020
These files need to be rebuilt with the appropriate substitutions from
./configure (e.g. prefix).

Fixes openzfs#9443
@rlaager
Copy link
Member

rlaager commented Feb 6, 2020

@behlendorf There are no .spec files in the tree, only .spec.in files. Therefore, you must run ./configure to even have a .spec file in the first place. Likewise, you must run ./configure to have a Makefile so you can make rpm-utils. That invocation of ./configure drives the building of zfs-functions. This ends up inside the SOURCES/zfs-0.8.3.tar.gz and is never rebuilt. Those built files should not be added to the tarball by make dist. That's the underlying bug.

I've submitted PR #9955 to fix this.

rlaager added a commit to rlaager/zfs that referenced this issue Feb 6, 2020
These files need to be rebuilt with the appropriate substitutions from
./configure (e.g. prefix).

Fixes openzfs#9443

Signed-off-by: Richard Laager <rlaager@wiktel.com>
rlaager added a commit to rlaager/zfs that referenced this issue Feb 6, 2020
These files need to be rebuilt with the appropriate substitutions from
./configure (e.g. prefix).

Fixes openzfs#9443

Signed-off-by: Richard Laager <rlaager@wiktel.com>
@rlaager rlaager changed the title CentOS 6 (0.8.3): Wrong paths in zfs-functions script 0.8.3: Wrong paths in zfs-functions script Feb 6, 2020
tonyhutter added a commit to tonyhutter/zfs that referenced this issue Feb 6, 2020
This fixes a bug where the generated zfs-functions was being included along
with original zfs-functions.in in the make dist tarball.  This caused an
unfortunate series of events during build/packaging that resulted in the
RPM-installed /etc/zfs/zfs-functions listing the paths as:

ZFS="/usr/local/sbin/zfs"
ZED="/usr/local/sbin/zed"
ZPOOL="/usr/local/sbin/zpool"

When they should have been:

ZFS="/sbin/zfs"
ZED="/sbin/zed"
ZPOOL="/sbin/zpool"

This affects init.d (non-systemd) distros like CentOS 6.

Fixes: openzfs#9443

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
@tonyhutter
Copy link
Contributor

Sorry this bug has been such a headache for everyone. I've pushed out a new zfs-0.8.3-2.el6.x86.rpm for both kmod and dkms with my fix included (#9959). There's a new 0.8.3-2 source RPM as well. All you should have to do is yum update and it will pull in the single new zfs package. Please post if you have any issues with it.

In the meantime, we'll have to figure out if we want to pull @rlaager's #9955 fix or my #9959 one into master.

@fdr
Copy link

fdr commented Feb 6, 2020

Thanks for expediting that. I'll give it a try soon.

@eborisch
Copy link

eborisch commented Feb 6, 2020

Updated zfs-0.8.3-2.el6 package works for me. Thanks for the quick turn-around.

tonyhutter added a commit to tonyhutter/zfs that referenced this issue Feb 7, 2020
This fixes a bug where the generated zfs-functions was being included
along with original zfs-functions.in in the make dist tarball.  This
caused an unfortunate series of events during build/packaging that
resulted in the RPM-installed /etc/zfs/zfs-functions listing the
paths as:

ZFS="/usr/local/sbin/zfs"
ZED="/usr/local/sbin/zed"
ZPOOL="/usr/local/sbin/zpool"

When they should have been:

ZFS="/sbin/zfs"
ZED="/sbin/zed"
ZPOOL="/sbin/zpool"

This affects init.d (non-systemd) distros like CentOS 6.

Fixes: openzfs#9443

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
rlaager pushed a commit to rlaager/zfs that referenced this issue Feb 8, 2020
This fixes a bug where the generated zfs-functions was being included
along with original zfs-functions.in in the make dist tarball.  This
caused an unfortunate series of events during build/packaging that
resulted in the RPM-installed /etc/zfs/zfs-functions listing the
paths as:

ZFS="/usr/local/sbin/zfs"
ZED="/usr/local/sbin/zed"
ZPOOL="/usr/local/sbin/zpool"

When they should have been:

ZFS="/sbin/zfs"
ZED="/sbin/zed"
ZPOOL="/sbin/zpool"

This affects init.d (non-systemd) distros like CentOS 6.

Fixes: openzfs#9443

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
rlaager pushed a commit to rlaager/zfs that referenced this issue Feb 10, 2020
This fixes a bug where the generated zfs-functions was being included
along with original zfs-functions.in in the make dist tarball.  This
caused an unfortunate series of events during build/packaging that
resulted in the RPM-installed /etc/zfs/zfs-functions listing the
paths as:

ZFS="/usr/local/sbin/zfs"
ZED="/usr/local/sbin/zed"
ZPOOL="/usr/local/sbin/zpool"

When they should have been:

ZFS="/sbin/zfs"
ZED="/sbin/zed"
ZPOOL="/sbin/zpool"

This affects init.d (non-systemd) distros like CentOS 6.

Fixes: openzfs#9443

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Richard Laager <rlaager@wiktel.com>
algitbot pushed a commit to alpinelinux/aports that referenced this issue Feb 11, 2020
Upstream accidentally included pre-configured files in their tarball so make didn't
rebuild them with our parameters.

See tonyhutter/zfs@2cc089a

Ref openzfs/zfs#9443

fixes #11209
@fdr
Copy link

fdr commented Feb 11, 2020

Late to the punch, but yeah, it works.

@dmaziuk
Copy link

dmaziuk commented Feb 11, 2020

mee too: I'm just getting around to updating the rest of our systems, upgrade from 0.8.2 now works w/o problems.

rlaager pushed a commit to rlaager/zfs that referenced this issue Feb 23, 2020
This fixes a bug where the generated zfs-functions was being included
along with original zfs-functions.in in the make dist tarball.  This
caused an unfortunate series of events during build/packaging that
resulted in the RPM-installed /etc/zfs/zfs-functions listing the
paths as:

ZFS="/usr/local/sbin/zfs"
ZED="/usr/local/sbin/zed"
ZPOOL="/usr/local/sbin/zpool"

When they should have been:

ZFS="/sbin/zfs"
ZED="/sbin/zed"
ZPOOL="/sbin/zpool"

This affects init.d (non-systemd) distros like CentOS 6.

Fixes: openzfs#9443

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Richard Laager <rlaager@wiktel.com>
algitbot pushed a commit to alpinelinux/aports that referenced this issue Feb 26, 2020
Upstream accidentally included pre-configured files in their tarball so make didn't
rebuild them with our parameters.

See tonyhutter/zfs@2cc089a

Ref openzfs/zfs#9443

ref #11209

closes #11195
rlaager pushed a commit to rlaager/zfs that referenced this issue Mar 8, 2020
This fixes a bug where the generated zfs-functions was being included
along with original zfs-functions.in in the make dist tarball.  This
caused an unfortunate series of events during build/packaging that
resulted in the RPM-installed /etc/zfs/zfs-functions listing the
paths as:

ZFS="/usr/local/sbin/zfs"
ZED="/usr/local/sbin/zed"
ZPOOL="/usr/local/sbin/zpool"

When they should have been:

ZFS="/sbin/zfs"
ZED="/sbin/zed"
ZPOOL="/sbin/zpool"

This affects init.d (non-systemd) distros like CentOS 6.

Fixes: openzfs#9443

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Richard Laager <rlaager@wiktel.com>
rlaager pushed a commit to rlaager/zfs that referenced this issue Mar 9, 2020
This fixes a bug where the generated zfs-functions was being included
along with original zfs-functions.in in the make dist tarball.  This
caused an unfortunate series of events during build/packaging that
resulted in the RPM-installed /etc/zfs/zfs-functions listing the
paths as:

ZFS="/usr/local/sbin/zfs"
ZED="/usr/local/sbin/zed"
ZPOOL="/usr/local/sbin/zpool"

When they should have been:

ZFS="/sbin/zfs"
ZED="/sbin/zed"
ZPOOL="/sbin/zpool"

This affects init.d (non-systemd) distros like CentOS 6.

Fixes: openzfs#9443

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Richard Laager <rlaager@wiktel.com>
rlaager added a commit to rlaager/zfs that referenced this issue Mar 9, 2020
This fixes a bug where the generated zfs-functions was being included
along with original zfs-functions.in in the make dist tarball.  This
caused an unfortunate series of events during build/packaging that
resulted in the RPM-installed /etc/zfs/zfs-functions listing the
paths as:

ZFS="/usr/local/sbin/zfs"
ZED="/usr/local/sbin/zed"
ZPOOL="/usr/local/sbin/zpool"

When they should have been:

ZFS="/sbin/zfs"
ZED="/sbin/zed"
ZPOOL="/sbin/zpool"

This affects init.d (non-systemd) distros like CentOS 6.

/etc/default/zfs and /etc/zfs/zfs-functions are also used by the
initramfs, so they need to be built even when init.d support is not.
They have been moved to the (new) etc/default and (existing) etc/zfs
source directories, respectively.

Fixes: openzfs#9443

Co-authored-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Richard Laager <rlaager@wiktel.com>
tonyhutter added a commit to tonyhutter/zfs that referenced this issue Apr 22, 2020
This fixes a bug where the generated zfs-functions was being included
along with original zfs-functions.in in the make dist tarball.  This
caused an unfortunate series of events during build/packaging that
resulted in the RPM-installed /etc/zfs/zfs-functions listing the
paths as:

ZFS="/usr/local/sbin/zfs"
ZED="/usr/local/sbin/zed"
ZPOOL="/usr/local/sbin/zpool"

When they should have been:

ZFS="/sbin/zfs"
ZED="/sbin/zed"
ZPOOL="/sbin/zpool"

This affects init.d (non-systemd) distros like CentOS 6.

/etc/default/zfs and /etc/zfs/zfs-functions are also used by the
initramfs, so they need to be built even when init.d support is not.
They have been moved to the (new) etc/default and (existing) etc/zfs
source directories, respectively.

Fixes: openzfs#9443

Co-authored-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Richard Laager <rlaager@wiktel.com>
tonyhutter added a commit to tonyhutter/zfs that referenced this issue Apr 22, 2020
This fixes a bug where the generated zfs-functions was being included
along with original zfs-functions.in in the make dist tarball.  This
caused an unfortunate series of events during build/packaging that
resulted in the RPM-installed /etc/zfs/zfs-functions listing the
paths as:

ZFS="/usr/local/sbin/zfs"
ZED="/usr/local/sbin/zed"
ZPOOL="/usr/local/sbin/zpool"

When they should have been:

ZFS="/sbin/zfs"
ZED="/sbin/zed"
ZPOOL="/sbin/zpool"

This affects init.d (non-systemd) distros like CentOS 6.

/etc/default/zfs and /etc/zfs/zfs-functions are also used by the
initramfs, so they need to be built even when init.d support is not.
They have been moved to the (new) etc/default and (existing) etc/zfs
source directories, respectively.

Fixes: openzfs#9443

Co-authored-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Richard Laager <rlaager@wiktel.com>
tonyhutter added a commit to tonyhutter/zfs that referenced this issue Apr 28, 2020
This fixes a bug where the generated zfs-functions was being included
along with original zfs-functions.in in the make dist tarball.  This
caused an unfortunate series of events during build/packaging that
resulted in the RPM-installed /etc/zfs/zfs-functions listing the
paths as:

ZFS="/usr/local/sbin/zfs"
ZED="/usr/local/sbin/zed"
ZPOOL="/usr/local/sbin/zpool"

When they should have been:

ZFS="/sbin/zfs"
ZED="/sbin/zed"
ZPOOL="/sbin/zpool"

This affects init.d (non-systemd) distros like CentOS 6.

/etc/default/zfs and /etc/zfs/zfs-functions are also used by the
initramfs, so they need to be built even when init.d support is not.
They have been moved to the (new) etc/default and (existing) etc/zfs
source directories, respectively.

Fixes: openzfs#9443

Co-authored-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Richard Laager <rlaager@wiktel.com>
tonyhutter added a commit that referenced this issue May 12, 2020
This fixes a bug where the generated zfs-functions was being included
along with original zfs-functions.in in the make dist tarball.  This
caused an unfortunate series of events during build/packaging that
resulted in the RPM-installed /etc/zfs/zfs-functions listing the
paths as:

ZFS="/usr/local/sbin/zfs"
ZED="/usr/local/sbin/zed"
ZPOOL="/usr/local/sbin/zpool"

When they should have been:

ZFS="/sbin/zfs"
ZED="/sbin/zed"
ZPOOL="/sbin/zpool"

This affects init.d (non-systemd) distros like CentOS 6.

/etc/default/zfs and /etc/zfs/zfs-functions are also used by the
initramfs, so they need to be built even when init.d support is not.
They have been moved to the (new) etc/default and (existing) etc/zfs
source directories, respectively.

Fixes: #9443

Co-authored-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Richard Laager <rlaager@wiktel.com>
jsai20 pushed a commit to jsai20/zfs that referenced this issue Mar 30, 2021
This fixes a bug where the generated zfs-functions was being included
along with original zfs-functions.in in the make dist tarball.  This
caused an unfortunate series of events during build/packaging that
resulted in the RPM-installed /etc/zfs/zfs-functions listing the
paths as:

ZFS="/usr/local/sbin/zfs"
ZED="/usr/local/sbin/zed"
ZPOOL="/usr/local/sbin/zpool"

When they should have been:

ZFS="/sbin/zfs"
ZED="/sbin/zed"
ZPOOL="/sbin/zpool"

This affects init.d (non-systemd) distros like CentOS 6.

/etc/default/zfs and /etc/zfs/zfs-functions are also used by the
initramfs, so they need to be built even when init.d support is not.
They have been moved to the (new) etc/default and (existing) etc/zfs
source directories, respectively.

Fixes: openzfs#9443

Co-authored-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Richard Laager <rlaager@wiktel.com>
@fixapc
Copy link

fixapc commented Jun 24, 2022

Currently have the same issue with this in 2022.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Building Indicates an issue related to building binaries
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants