[Pkg-zfsonlinux-devel] Bug#1030316: trim script always exits 1 despite not failing

Scott Colby debian at scott.scolby.com
Thu Feb 2 19:23:02 GMT 2023


Package: zfsutils-linux
Version: 2.1.7-1~bpo11+1

When I invoke `sh /usr/lib/zfs-linux/trim`, the script always exits
1 despite operating properly. This is causing me some pain when
trying to automate calling this script with a systemd timer, since
I can't differentiate some other reason of the script exiting 1
from a successful run.

I believe this is caused by the final command of the script being
`zpool list ... | while read -r pool do ...; done`. When the output
of `zpool list` is exhausted, `read` returns an error, and thus the
script exits with that status. I have confirmed this by running the
script with `sh -x` and seeing that the last output line is
`+ read -r pool`.

I'm not sure what the right solution to this would be, but I think
that it should be addressed.

Thank you,
Scott Colby



More information about the Pkg-zfsonlinux-devel mailing list