zfsutils-linux scrub cron job fails

Bug #1600579 reported by Tim Bishop
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
zfs-linux (Ubuntu)
New
Undecided
Unassigned

Bug Description

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

Tim Bishop (tdb)
description: updated
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.