0

I am new to Rundeck, so I apologize if I ask a question that probably has an obvious answer I'm overlooking.

I've installed Rundeck on my Windows PC. I've got a couple of Python scripts that I want to execute via Rundeck.

The scripts run fine when I execute them manually.

I created a job in Rundeck, created a single step (script file option) to test the python script.

The job failed after six seconds. When I checked the log, it was because it was executing it line by line rather than letting python run it as an entire script.

How do I fix this?

Casimir Crystal
  • 18,651
  • 14
  • 55
  • 76
Joe
  • 39
  • 1
  • 3

2 Answers2

1

okay, so I changed the step type to a command rather than script file and it worked.

I guess my understanding of what a script file is was off.

Joe
  • 39
  • 1
  • 3
1

You had to put:

#!/usr/bin/python 

or similar, with location to your python binary, as 1st line. To indicate which interpreter to use for whole file.

Dmitry Shmakov
  • 610
  • 6
  • 6
  • `#!/usr/bin/env python` is generally preferred because it allows more flexibility, as described in more detail [in this answer](https://stackoverflow.com/a/2429517/1399438). – StockB Aug 10 '17 at 18:44