I'm trying to execute a remote command via SSH on Linux machine.
This command is used to control SAP instance and is called "sapcontrol".
sapcontrol, normally have 5 possible exit state (0, 1, 2, 3, 4):
EXITCODES
0 Last webmethod call successful
1 Last webmethod call failed, invalid parameter
2 StartWait, StopWait, WaitforStarted, WaitforStopped, RestartServiceWait
timed out
3 GetProcessList succeeded, all processes running correctly
4 GetProcessList succeeded, all processes stopped
In this case if I run the command from the remote host, I have exit code 0, but if I run the same command from rundeck console I have the right output, followed by an error message:
Remote command failed with exit status 3
--
23:09:31 | | Failed: NonZeroResultCode: Remote command failed with exit status 3
23:09:31 | localhost | Execution failed: 47 in project MYPROJECTNAME: [Workflow result: , step failures: {1=Dispatch failed on 1 nodes: [myhostname: NonZeroResultCode: Remote command failed with exit status 3 + {dataContext=MultiDataContextImpl(map={ContextView(node:myhostname)=BaseDataContext{{exec={exitCode=3}}}, ContextView(step:1, node:myhostname)=BaseDataContext{{exec={exitCode=3}}}}, base=null)} ]}, Node failures: {myhostname=[NonZeroResultCode: Remote command failed with exit status 3 + {dataContext=MultiDataContextImpl(map={ContextView(node:myhostname)=BaseDataContext{{exec={exitCode=3}}}, ContextView(step:1, node:myhostname)=BaseDataContext{{exec={exitCode=3}}}}, base=null)} ]}, status: failed]
The error "Failed: NonZeroResultCode: Result code was 3" is due to the return code of the OS command I'm running that is != 0.
Any Idea ?
[[ "@result.resultCode@" == 3 ]] && exit 0.
Thankssapcontrol || { [[ $? == 3 ]] && exit 0 }
--
You received this message because you are subscribed to the Google Groups "rundeck-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rundeck-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to rundeck-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rundeck-discuss/00e569d2-ad5f-4f1e-b15c-f2f189053641%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Alex Honor
[Rundeck | a...@rundeck.com ]