rundeck / rundeck

Enable Self-Service Operations: Give specific users access to your existing tools, services, and scripts
http://rundeck.org
Apache License 2.0
5.51k stars 914 forks source link

Windows local script execution fails due to wrong file extension #546

Closed jeppenejsum closed 11 years ago

jeppenejsum commented 11 years ago

Nothing happens when trying to create a step of type script.

My assumption is it's caused by the .tmp file extension created for the temporary script. When running RunDeck in an interactive session, this opens the script in notepad.

Suggest renaming the tmp file to have .cmd extension.

14:25:50        Step 1  [workflow] Begin step: 1,NodeDispatch
14:25:50            1: Workflow step executing: com.dtolabs.rundeck.execution.ExecutionItemFactory$1@2afcce2c
14:25:50            preparing for sequential execution on 1 nodes
14:25:50            Executing command on node: DMZ-BatchServer, NodeEntryImpl{tags=[], attributes={tags=, osFamily=windows, username=adminjnm, osVersion=6.2, osArch=amd64, description=Rundeck server node, hostname=DMZ-BatchServer, nodename=DMZ-BatchServer, osName=Windows Server 2012}, project='null'}
14:25:50            [workflow] beginExecuteNodeStep(DMZ-BatchServer): NodeDispatch: com.dtolabs.rundeck.execution.ExecutionItemFactory$1@2afcce2c
14:25:50            Current OS is Windows Server 2012
14:25:50            Adding reference: ant.PropertyHelper
14:25:50            Project base dir set to: C:\Program Files\Java\jre6\bin
14:25:50            Setting environment variable: RD_JOB_URL=http://DMZ-BatchServer:80/execution/follow/217
14:25:50            Setting environment variable: RD_NODE_DESCRIPTION=Rundeck server node
14:25:50            Setting environment variable: RD_NODE_OS_ARCH=amd64
14:25:50            Setting environment variable: RD_JOB_NAME=Test
14:25:50            Setting environment variable: RD_JOB_ID=71cfbe6d-f441-4833-8f7c-3aaf06a26b12
14:25:50            Setting environment variable: RD_JOB_EXECID=217
14:25:50            Setting environment variable: RD_NODE_HOSTNAME=DMZ-BatchServer
14:25:50            Setting environment variable: RD_NODE_TAGS=
14:25:50            Setting environment variable: RD_JOB_SERVERURL=http://DMZ-BatchServer:80/
14:25:50            Setting environment variable: RD_NODE_NAME=DMZ-BatchServer
14:25:50            Setting environment variable: RD_JOB_PROJECT=Amazon
14:25:50            Setting environment variable: RD_JOB_USER_NAME=admin
14:25:50            Setting environment variable: RD_JOB_LOGLEVEL=DEBUG
14:25:50            Setting environment variable: RD_NODE_OS_VERSION=6.2
14:25:50            Setting environment variable: RD_NODE_USERNAME=adminjnm
14:25:50            Setting environment variable: RD_NODE_OS_FAMILY=windows
14:25:50            Setting environment variable: RD_JOB_USERNAME=admin
14:25:50            Setting environment variable: RD_NODE_OS_NAME=Windows Server 2012
14:25:50            Executing 'cmd.exe' with arguments:
'/c'

'E:\Deployment\rundeck\var\tmp\dispatch3477581149325031180.tmp'

The ' characters around the executable and arguments are

not part of the command.
14:25:50            Execute:Java13CommandLauncher: Executing 'cmd.exe' with arguments:
'/c'

'E:\Deployment\rundeck\var\tmp\dispatch3477581149325031180.tmp'

The ' characters around the executable and arguments are

not part of the command.
gschueler commented 11 years ago

Strange, temp script files on windows are supposed to get a .bat extension for this exact reason. I will look into it

gschueler commented 11 years ago

I believe #532 is caused by this

gschueler commented 11 years ago

Updated issue title: local script execution fails to use the proper extension