Rundeck job to execute php script

684 views
Skip to first unread message

Vadim Sohin

unread,
Mar 27, 2018, 10:54:17 AM3/27/18
to rundeck-discuss
Hello All,
I have a issue running Rundeck job that executes php script on remote node
i added this node and able to see it in the nodes section (added before pub key )
i got error 
java.io.FileNotFoundException: PATH to script (No such file or directory)

Failed dispatching to node X.X.X.X: [jsch-scp]
 
What can be the issue?
tnx
Vadim

Alex Honor

unread,
Mar 27, 2018, 10:58:52 AM3/27/18
to rundeck...@googlegroups.com
Hi Vadim,

Can you post your job definition?

Thanks

--
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/d6dfe6be-74a8-432d-99fa-618dce752854%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Alex Honor

[Rundeck | a...@rundeck.com ]

Vadim Sohin

unread,
Mar 28, 2018, 3:31:58 AM3/28/18
to rundeck-discuss
Hi
meanwhile i created a simple bash script that checks uptime and tried to run-same results
i can run this command on remote node with no issues but when it comes to bash script that resides on remote server i got errors - java.io.FileNotFoundException: /var/lib/rundeck/X.X.X.X/var/www/check_time.sh (No such file or directory)

On Tuesday, March 27, 2018 at 5:58:52 PM UTC+3, Alex Honor wrote:
Hi Vadim,

Can you post your job definition?

Thanks
On Tue, Mar 27, 2018 at 5:29 AM, Vadim Sohin <vadim...@gmail.com> wrote:
Hello All,
I have a issue running Rundeck job that executes php script on remote node
i added this node and able to see it in the nodes section (added before pub key )
i got error 
java.io.FileNotFoundException: PATH to script (No such file or directory)

Failed dispatching to node X.X.X.X: [jsch-scp]
 
What can be the issue?
tnx
Vadim

--
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-discu...@googlegroups.com.
To post to this group, send email to rundeck...@googlegroups.com.



--

Alex Honor

[Rundeck | a....@rundeck.com ]

edu...@rundeck.com

unread,
Apr 11, 2018, 11:40:06 AM4/11/18
to rundeck-discuss
Hi Vadim,

Can you please check, for your job's configuration, which node steps you use to run the remote script and verify the path configured? Please remember the following:


"Command" steps will execute a remote command directly to the node.

"Script" steps will execute an inline script. This script will be copied to a temporary directory on your remote node and then executed

"Script file or URL" steps will either download a script located in an URL or use a 'local' script file located in your rundeck server. This file will then be copied to the remote node using the Node File Copier configured for the project for its execution.

Reference: http://rundeck.org/docs/manual/jobs.html#script-file-step

If your PHP script file is already located in the remote node, you can use one of the following options; you can reference the path to the script directly within a "Command" step, or use "Script", to create an inline script (e.g Bash) that will execute your remote PHP script.

These are examples using "Command" or “Script” steps:


Example of "command" step that will run a simple "hello world" PHP script.


1. When selecting “add a step”, select “command“:




2. Then you can set the full command syntax to run your PHP script:







Example to run the same PHP script, located in the remote node, via a "Script" step (inline script).



1. When selecting “add a step”, select “Script“





2. Then you can configure the script that will execute the PHP script





Furthermore, in case you have your PHP script locally in your Rundeck server (or an URL accessible via rundeck), the script can be copied to your remote node for its execution:


Example to run the same PHP script, located in rundeck server (local), via an "Script file" step, on a remote node.



1. When selecting “add a step”, select “Script File or URL“



2. Then you can enter the path to the php script and add an invocation string, in order to invoke ‘php’ to run the script




As described above, this file will be copied to the remote node via the default Node File Copier you configured for your project, and then executed on your remote node. In case the script is located in an URL, you can reference its path. As an example




When the job is executed, rundeck will download a copy of the script to your rundeck server, and then copied to the remote node for execution.


Please keep in mind that these examples have only taken into consideration a Linux remote node, additional configuration and/or different paths may be needed for different environments.


Hope it helps.


Eduardo Carrasco
Reply all
Reply to author
Forward
0 new messages