Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guarantee UNIX characters when uploading scripts #348

Closed
pellyadolfo opened this issue Apr 3, 2013 · 4 comments
Closed

Guarantee UNIX characters when uploading scripts #348

pellyadolfo opened this issue Apr 3, 2013 · 4 comments

Comments

@pellyadolfo
Copy link

The issue has been discussed here (https://groups.google.com/forum/?fromgroups=#!topicsearchin/rundeck-discuss/bug/rundeck-discuss/OW1KGBtznn4).

When Job XML definitions are created on Windows systems, scripts can contain windows characters that will result in an error when executed on a UNIX system.

04:43:08 bash: /tmp/1364956979089-CentOS-r56-dispatch-script.sh: /bin/sh^M: bad interpreter: No such file or directory

It should not be difficult to replace windows end lines by UNIX endlines somewhere in the process to guarantee that UNIX get not win chars.

Potential places where this verification could be done:

  • when Uploading a Job XML definition to create/upddate a job (Java)
  • when saving an script in the GUI (Java)
  • in the process that sends the script to server side (Java)
  • in the process of executing an script invoking dos2unix
@pellyadolfo
Copy link
Author

As update, in the same Windows system, running a rundeck server, connecting to a CentOS node. 4 cases:

  • 'Script file or URL' steps FAILS if they contain windows delimiters in the script file
  • 'Script file or URL' steps WORKS if they contain only Unix delimiters in the script file
  • 'Script' steps FAILS if job XML definition contains windows delimiters (*)
  • 'Script' steps also FAILS if job XML definition contains only Unix delimiters (*)

(*) It looks that windows delimiters are introduced when extracting the script CDATA from the job XML definition (or something like that (?)).

@PipC
Copy link

PipC commented Oct 25, 2013

I hit the same problem, so any work around I can convert using dos2unix like command before submit to Unix server?

@PipC
Copy link

PipC commented Oct 29, 2013

Any update on this issue? can it have an option to perform dos2unix or unix2dos before uploading the file to target host?

@gschueler
Copy link
Member

This enhancement/bugfix is not on our short term roadmap. We may re-open this issue in the future. In the meantime, any community contribution for this feature is welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants