Red Hat Bugzilla – Bug 966237
exportfs: Returns zero exit status when it fails to create export
Last modified: 2013-12-09 09:53:51 EST
Description of problem:
When using exportfs to create an export the command will fail, but the exit code will indicate success (0).
Version-Release number of selected component (if applicable):
All versions tried exibit same behavior
Steps to Reproduce:
# exportfs non-existant-host:/mnt ; echo $? ; exportfs -v
exportfs: Failed to resolve non-existant-host
# exportfs -u 2001:470:8:d63::/64:/mnt ; echo $? ; exportfs -v
exportfs: Invalid unexporting option: 2001
echo $? = 0
echo $? != 0
This would be very helpful for users that are scripting NFS export management with exportfs so that a consistent and reliable way can be used for determining command execution results.
The command is working as expected for other error senarios.
# exportfs -o what_root_squash non-existant-host:/mnt ; echo $? ; exportfs -v
exportfs: command line:0: unknown keyword "what_root_squash"
This bug appears to have been reported against 'rawhide' during the Fedora 20 development cycle.
Changing version to '20'.
More information and reason for this action is here:
This has been fixed by this upstream commit
Author: NeilBrown <firstname.lastname@example.org>
Date: Tue Nov 5 14:03:53 2013 -0500
exportfs: exit with error code if there was any error (take 2).