Bug 493411 - Script '/etc/NetworkManager/dispatcher.d/04-iscsi' exited with error status 1.
Script '/etc/NetworkManager/dispatcher.d/04-iscsi' exited with error status 1.
Product: Fedora
Classification: Fedora
Component: iscsi-initiator-utils (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Hans de Goede
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2009-04-01 12:51 EDT by Tomislav Vujec
Modified: 2012-06-26 12:08 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-04-03 03:30:05 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Proposed patch to protect exit status. (649 bytes, patch)
2009-04-01 12:51 EDT, Tomislav Vujec
no flags Details | Diff
Improved patch (404 bytes, patch)
2009-04-02 16:36 EDT, Hans de Goede
no flags Details | Diff

  None (edit)
Description Tomislav Vujec 2009-04-01 12:51:33 EDT
Created attachment 337580 [details]
Proposed patch to protect exit status.

Description of problem:
Exit status in not protected in the 04-iscsi nm-dispatcher script, which results in error being reported on successful execution.

Version-Release number of selected component (if applicable):
Comment 1 Mike Christie 2009-04-01 13:05:33 EDT

Were you the guy that did that code that the patch is modifying?
Comment 2 Hans de Goede 2009-04-01 14:19:36 EDT
(In reply to comment #1)
> Hans,
> Were you the guy that did that code that the patch is modifying?  


Tomislav, what problem are you seeing exactly, and how does the patch fix it?

As I read the patch, you are replacing the exit value of the script with a success value in case of the up action, and in case of the down value you are effectively doing nothing. "foo && :" == "foo"

So I guess that the script is failing for you when the device is brought up, can you try to run the script from a terminal after booting and see what kind of error it gives?

Comment 3 Tomislav Vujec 2009-04-02 08:11:48 EDT
I guess that was a little bit much of the copy-n-paste from 05-netfs on my part. In short, you're right for the down action, it is not needed, but for the up action, you end up with exit status 1 if no default route is available on the device.
Think about it, if grep doesn't find '^default' in ip show output, it will exit with exit code 1, and since there is nothing to be executed afterwards, the whole shell exits with exit code 1. This is a fairly common side-effect of using test one-liners.
The actual problem is that the dispatcher will check that exit code, and report an error without any specific error message in the syslog (see bug title), which can be fairly confusing, but definitely not severe, hence the low priority and severity. On the other hand, it is fairly easy to fix. Hint, hint :-)
What contributes to the problem is the fact that NetworkManager now days supports multiple devices in on state. Since only one can have the default route, this use case is becoming more common. Think laptop on wired connection in the receiving area of the configured wireless AP (my use case on both work and home networks).
Comment 4 Hans de Goede 2009-04-02 16:36:41 EDT
Created attachment 337919 [details]
Improved patch

Tomislav, thanks now I understand what the problem is. However the up part of
your patch also does not do what we want, because we do want to exit with 1 when
the iscsi initscript itself fails.

Can you give the just attached alternative patch a try please, that should also
fix your problem.
Comment 5 Tomislav Vujec 2009-04-02 18:33:21 EDT
Thanks, it works ok now!
Comment 6 Hans de Goede 2009-04-03 03:30:05 EDT which includes this patch is on its way to rawhide, closing.

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