I would argue the message is only informational, or at most a warning,
> not an error, so the non-zero rule should not apply.
If the message is not an error, then: a) it must clearly state that it
is a warning, and b) it must have a way to be silenced, preferably by a
command line option, and c) setting POSIXLY_CORRECT in the environment
must silence the warning by default. Otherwise, it is an error, and
non-zero status is correct.
>
> My main concern is with scripts. This case is 100% normal and expected
> on every system that runs named chrooted, and potentially any other
> process that is run chrooted as well. Thus any script that calls du and
> wants to be robust will not be able to easily distinguish this
> completely normal and expected case from a true error case.
Then the CORRECT approach is to set different non-zero status levels;
use status 1 for this being the only message issued, and status 2 or
greater for any other, more serious error. Scripts that care can then
check $?, and scripts that don't care about the distinction, but which
DO want to handle it as an error, can merely check for non-zero status.
Just because it might be normal in some chroot environments doesn't
mean it is not an error in other environments.