wood burning stoves 2.0*
The moose likes Java in General and the fly likes script runs from command line, but from webmin it creates errors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "script runs from command line, but from webmin it creates errors" Watch "script runs from command line, but from webmin it creates errors" New topic
Author

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

michael white
Greenhorn

Joined: Oct 20, 2009
Posts: 17
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

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Oct 20, 2009
Posts: 17
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

Joined: Oct 20, 2009
Posts: 17
anyone?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Oct 20, 2009
Posts: 17
thanks

so should I just cut and paste those lines into the top of the script?
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18896
    
  40

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


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: script runs from command line, but from webmin it creates errors