[Swan-dev] a question on whack exit codes (libreswan-up-down.sh)

Paul Wouters paul at nohats.ca
Wed May 9 17:45:54 UTC 2018


On Wed, 9 May 2018, Andrew Cagney wrote:

>> Can you elaborate? I do think it fixed something, but you might run into
>> other messages using a wrong RC_* code ?
>
> In this test:
>
> http://testing.libreswan.org/results/v3.22-1343-g648051a-master/ikev2-unknown-payload-03-auth-sk/OUTPUT/west.console.diff
>
> The 'ipsec auto --up <connection>' didn't establish - something
> screwed up so it is retrying in the background.
>
> Previously, the exit code would have been non zero, but now it is
> zero.  However, ...

Right, but in this case we really don't know if the outcome is going
to be an error or not. So better to not return an error code
prematurely.

>> The RC code for that can be RC_LOG or RC_RETRANSMISSION. Both should
>> cause the return code for whack to be 0.
>
> you're saying that for this case the exit code should be zero from whack?

I think so. I mean other then the above reasoning of saying we don't
know the final outcome yet, there is also the argument that this end
did not have anything go wrong. Its intended purpose is "try to bring
up the tunnel until you succeed" and that chore is running successfully.

Shell exit codes really are binary. zero or non-zero. We do give people
the change to read the first 3 digit FTP style error code if they want
to know more then simple shell exit codes.

Paul


More information about the Swan-dev mailing list