Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 723450 - sys-fs/zfs-0.8.4: zfs-functions does not source /etc/conf.d/zfs
Summary: sys-fs/zfs-0.8.4: zfs-functions does not source /etc/conf.d/zfs
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-17 00:27 UTC by superjaded
Modified: 2020-05-17 17:11 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,348.47 KB, text/x-log)
2020-05-17 13:25 UTC, superjaded
Details

Note You need to log in before you can comment on or make changes to this bug.
Description superjaded 2020-05-17 00:27:34 UTC
Upgraded to the new version of zfs a little while ago. My zpool is shared via the sharenfs option, but since upgrading to the new version /etc/init.d/zfs-share no longer seems to work.

I can manually share / unshare the zpool with zfs share / unshare, so it doesn't look like this is an issue with the actual sharing mechanism. It's something specific to the init script.

Took a closer look at /etc/zfs/zfs-functions and noticed that it doesn't seem to be sourcing /etc/conf.d/zfs at all. At line 102, I see where it *should* be sourcing /etc/conf.d/zfs, but it seems to be trying to source /zfs instead of /etc/conf.d/zfs:

# Source zfs configuration, overriding the defaults
if [ -f /zfs ]; then
        . /zfs
fi

I changed those lines from /zfs to /etc/conf.d/zfs and then started zfs-share, and then it started started working again.
Comment 1 superjaded 2020-05-17 13:23:13 UTC
To add some additional details, I took a look at the source this morning and noticed that this issue seems to be with the macros ZFS is trying to use to populate these config folder locations.

It looks like it was detecting everything about my system correctly during the ./configure:

checking linux distribution... gentoo
checking default package type... tgz
checking default init directory... /etc/init.d
checking default init script type... openrc
checking default init config directory... /etc/conf.d


But when it gets to the point of actually replacing @initconfdir@ with my actual config directory during the "compile," it's using an empty string rather than the correct config directory:

make[3]: Entering directory '/var/tmp/portage/sys-fs/zfs-0.8.4/work/zfs-0.8.4/etc/zfs'
...
  /bin/sed \
         -e 's,@sbindir\@,/sbin,g' \
         -e 's,@sysconfdir\@,/etc,g' \
         -e 's,@initconfdir\@,,g' \
         zfs-functions.in >'zfs-functions'

Interestingly, there are other folders in which this replacement is done properly, such as on the init scripts, so it seems to be an issue specific to etc/zfs/zfs-functions.
Comment 2 superjaded 2020-05-17 13:25:08 UTC
Created attachment 639834 [details]
build.log

build.log which shows my config path is being detected correctly as /etc/conf.d in the configure stage but the @initconfdir@ is not being replaced correctly by /etc/conf.d in the "compile" stage for /etc/zfs/zfs-functions.
Comment 3 Jonas Stein gentoo-dev 2020-05-17 17:11:51 UTC
Thank you for the report. We need to have all information at hand before ticket assignment. That is why I ask you to 
* paste the emerge info 
as described on https://wiki.gentoo.org/wiki/Attach_the_logs_to_the_bug_ticket
Please reopen this ticket (Status:UNCONFIRMED) afterwards.