Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

script runs from command line, but from webmin it creates errors

 
michael white
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Folks

I have a script that runs 3 other scripts. I did not write them, I just run them, the first looks like



when I log into bash I can run the script with the command
/ChengFAC/Sync/bin/syncAll.sh

But I need this command to be able to be run from the webmin interface.

I had this running fine on another server and it all worked from bash and from webmin.

When I run it from webmin I get the error

this is on a manged hosting account and when I contacted support they said


Can anyone shed any light on what this means? I dont know where to add the "PATH environment variable."

the syncAll.sh script runs another script called /AwardsTrainingsListSync.sh it looks like this

I realize this is a random question and Im not sure where to post it,

My questions are
1. Does the information given to me by my tech support sound correct?
2. If so where do I change the "PATH environment variable"

Thanks in advance!
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, and it depends.

The command is being run with the wrong version of Java. I don't know what a "webmin" is, but you'd need to figure out where it gets its PATH value from. If it's from your login account you could just change your login script.
 
michael white
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the answer...

And what should I change in the log in script? my .profile file looks like this

Can I add this path to the scripts to set the path inside each script? I guess webmin is running the script without logging into ssh. It logs in via ftp.

Webmin is an open source server management tool, it provides a GUI so you can do much of your server administration via the GUI as opposed to command line.

In this case its really helpful because we have an online tool that syncs with a database, some of our sales staff need to run the sync on demand so instead of logging into SSH which would be quite overwhelming for a "non techie"
they just log into webmin under a specific account that only has access to one module and they run the script with a few clicks.
 
michael white
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
anyone?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't really "log in via FTP"; FTP is for transferring files between systems.

In any case, sure, you could add those lines to any script you wanted, if they solve the problem.
 
michael white
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks

so should I just cut and paste those lines into the top of the script?
 
Henry Wong
author
Marshal
Pie
Posts: 21123
78
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
michael white wrote:thanks

so should I just cut and paste those lines into the top of the script?


IMO, I think the first thing to do (after backing up the scripts), is to grep the script for the path. And if there is a reference related to java, try changing that first.

If the scripts sets the path, then adding to the top of the script will probably not work.

Henry
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic