Public bug reported: The cron job for zfsutils-linux fails to run. The problem is that $PATH (on xenial, at least) is set to /bin:/usr/bin. The zpool binary is in /sbin and the /usr/lib/zfs-linux/scrub script (below) doesn't give the full path or modify $PATH. Further, the 2>&1 ensures that the useful error is sent to awk and not stderr where it'd be more easily noticed.
The fix is to just s,zpool,/sbin/zpool, in the script. And probably remove the stderr redirection, since I'm not sure if it's actually useful here. This is the script as it currently is, for reference: #!/bin/sh -eu # Scrub all healthy pools. zpool list -H -o health,name 2>&1 | \ awk 'BEGIN {FS="\t"} {if ($1 ~ /^ONLINE/) print $2}' | \ while read pool do zpool scrub "$pool" done ** Affects: zfs-linux (Ubuntu) Importance: Undecided Status: New ** Description changed: The cron job for zfsutils-linux fails to run. The problem is that $PATH (on xenial, at least) is set to /bin:/usr/bin. The zpool binary is in /sbin and the script (below) doesn't give the full path or modify $PATH. Further, the 2>&1 ensures that the useful error is sent to awk and not stderr where it'd be more easily noticed. The fix is to just s,zpool,/sbin/zpool, in the script. And probably remove the stderr redirection, since I'm not sure if it's actually useful here. + This is the script as it currently is, for reference: + #!/bin/sh -eu # Scrub all healthy pools. zpool list -H -o health,name 2>&1 | \ - awk 'BEGIN {FS="\t"} {if ($1 ~ /^ONLINE/) print $2}' | \ + awk 'BEGIN {FS="\t"} {if ($1 ~ /^ONLINE/) print $2}' | \ while read pool do - zpool scrub "$pool" + zpool scrub "$pool" done ** Description changed: The cron job for zfsutils-linux fails to run. The problem is that $PATH (on xenial, at least) is set to /bin:/usr/bin. The zpool binary is in - /sbin and the script (below) doesn't give the full path or modify $PATH. - Further, the 2>&1 ensures that the useful error is sent to awk and not - stderr where it'd be more easily noticed. + /sbin and the /usr/lib/zfs-linux/scrub script (below) doesn't give the + full path or modify $PATH. Further, the 2>&1 ensures that the useful + error is sent to awk and not stderr where it'd be more easily noticed. The fix is to just s,zpool,/sbin/zpool, in the script. And probably remove the stderr redirection, since I'm not sure if it's actually useful here. This is the script as it currently is, for reference: #!/bin/sh -eu # Scrub all healthy pools. zpool list -H -o health,name 2>&1 | \ awk 'BEGIN {FS="\t"} {if ($1 ~ /^ONLINE/) print $2}' | \ while read pool do zpool scrub "$pool" done -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1600579 Title: zfsutils-linux scrub cron job fails To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/zfs-linux/+bug/1600579/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs