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

Execute remote shell script in file #67

Open
acsadam0404 opened this issue Aug 26, 2015 · 4 comments
Open

Execute remote shell script in file #67

acsadam0404 opened this issue Aug 26, 2015 · 4 comments

Comments

@acsadam0404
Copy link

I have tried to execute a shell script file. I have all permissions on it and its a simple bash script. None of the above seems to work:

exec '/myfile.sh'
exec 'bash /myfile.sh'
exec 'sh /myfile.sh'
@aadamovich
Copy link
Member

@acsadam0404 can you show the exception/error that you are getting?

@acsadam0404
Copy link
Author

I didn't got any exceptions, it just didn't execute. The script was creating a temp file with touch into /tmp so I would see if it was executed. The main usage would be to execute tomcat's shutdown.sh and startup.sh scripts.

@aadamovich
Copy link
Member

  • Can you share the script or provide a minimalistic script to reproduce the behavior?
  • Were the permissions missing from the script?
  • What was the target system you were testing against?

@rodrigosalinas
Copy link

I have the same issue. I'm executing my script over a Debian server. I'm trying to execute the following command:
exec '/opt/tomcat/bin/shutdown.sh'
I previously executed exec "echo my-root-password | su -" and I know it was successful because of the output message. If I just execute the command to execute the sh file I get a Permission Denied exception. If execute it inside a prefix("sudo") nothing happens. It just gets stuck.

Thank you for any help.

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

No branches or pull requests

3 participants