Menu

#83 zz-zfs hardcodes paths: /usr/sbin/zpool and /usr/sbin/zfs

v7.5.1
closed
nobody
None
5
2020-07-22
2020-05-28
No

The zz-zfs script hardcodes the paths for zpool and zfs:

my $pathto_zpool = $ENV{'pathto_zpool'} || '/usr/sbin/zpool';
my $pathto_zfs = $ENV{'pathto_zfs'} || '/usr/sbin/zfs';

These paths do not work with distributions installing the zfsutils in /sbin, like Debian and Ubuntu do. Would it be possible to modify the script so $PATH is taken into consideration?

In a shell script I would normally do this with e.g. command -v zpool, returns the full path of the command if found in $PATH or returns 127 if not found. Perl may have a different way to achieve this common task, otherwise sh -c 'command -v zpool' will do.

Thanks!

Discussion

  • Bjorn

    Bjorn - 2020-07-22
    • status: open --> closed
     

Log in to post a comment.