Bug 966237 - exportfs: Returns zero exit status when it fails to create export
Summary: exportfs: Returns zero exit status when it fails to create export
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: nfs-utils
Version: 20
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Steve Dickson
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-22 20:28 UTC by Tony Asleson
Modified: 2013-12-09 14:53 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-12-09 14:53:51 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tony Asleson 2013-05-22 20:28:21 UTC
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



How reproducible:

Always


Steps to Reproduce:


Example 1.

# exportfs non-existant-host:/mnt ; echo $? ; exportfs -v
exportfs: Failed to resolve non-existant-host
0

Example 2:

# exportfs -u 2001:470:8:d63::/64:/mnt ; echo $? ; exportfs -v
exportfs: Invalid unexporting option: 2001
0

Actual results:
echo $? = 0

Expected results:
echo $? != 0


Additional info:

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.

eg.

# exportfs -o what_root_squash non-existant-host:/mnt ; echo $? ; exportfs -v
exportfs: command line:0: unknown keyword "what_root_squash"

22

Comment 1 Fedora End Of Life 2013-09-16 13:59:44 UTC
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:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora20

Comment 2 Steve Dickson 2013-12-09 14:53:51 UTC
This has been fixed by this upstream commit

commit d4a408776d611cd62235232d65d488d02fca78e4
Author: NeilBrown <neilb>
Date:   Tue Nov 5 14:03:53 2013 -0500

    exportfs: exit with error code if there was any error (take 2).


Note You need to log in before you can comment on or make changes to this bug.