How to change the conditions when rundeck reports job status "successful"?

207 views
Skip to first unread message

grep...@gmail.com

unread,
Jun 10, 2013, 11:52:38 AM6/10/13
to rundeck...@googlegroups.com
I have a job that tries to write to a network share from a windows machine.
When I get a response like this in the shell:
System error 67 has occurred.
The network name cannot be found.
Access is denied.


I still get a "successful" status in the job. While this might be technically correct since the command ran and completed how do I tell rundeck that if it sees "System error" in the output that it's in fact a failed job?

Thanks.

Alex Honor

unread,
Jun 11, 2013, 8:56:40 PM6/11/13
to rundeck...@googlegroups.com
Can you check the exit code value of the command that tries to write to the network share? Check its value and exit it with it if it is not as expected.

Grep Juice

unread,
Jun 13, 2013, 12:32:45 PM6/13/13
to rundeck...@googlegroups.com
The exit code is 0, so it seems the only way to detect a failure is to
grep the output for "error." Is it possible to check for some
arbitrary string in stdout and stderr and tell rundeck that this
indicates a failed job?

I'm having a similar issue with commands wrapped in schtasks like this
(I do this for an app that has to interact with a currently logged in
user):
schtasks /create /tn task /tr C:\\Windows\\system32\\notepad.exe /sc
once /st 00:00:00 & schtasks /run /tn task & schtasks /delete /tn task
/f

Even if notepad.exe fails to run I get a 0 exit code because the
schtasks command succeeded...
> --
> You received this message because you are subscribed to a topic in the Google Groups "rundeck-discuss" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/rundeck-discuss/TZ8kuOhBO80/unsubscribe?hl=en-US.
> To unsubscribe from this group and all its topics, send an email to rundeck-discu...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
> --
> You received this message because you are subscribed to a topic in the Google Groups "rundeck-discuss" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/rundeck-discuss/TZ8kuOhBO80/unsubscribe?hl=en-US.
> To unsubscribe from this group and all its topics, send an email to rundeck-discu...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "rundeck-discuss" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/rundeck-discuss/TZ8kuOhBO80/unsubscribe?hl=en-US.
> To unsubscribe from this group and all its topics, send an email to
> rundeck-discu...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
Reply all
Reply to author
Forward
0 new messages