• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Calling Unix script from JSP on UNIX server

 
Ranch Hand
Posts: 2925
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a JSP page using which I have to call a UNIX script.
The solution i found for this is I will have my JSP deployed on a UNIX server and it will call the UNIX script from there.


Now suppose this unix script ,I only have to transfer to UNIX server before keeping it at a particular location there and calling it.


The Problem is:

I know how to make my JSP(once deployed on UNIX) call this JSP ----FINE
But how do i transfer this UNIX script to that particular UNIX server-----I NEED SOLUTION TO THIS

thanks

 
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Monica. Shiralkar wrote:
But how do i transfer this UNIX script to that particular UNIX server



Are you having multiple servers?
Why not bundle that script in the WAR to put it on a particualr server or have a properties file to contain the location of the script?
I am not getting the exact problem.
 
Monica Shiralkar
Ranch Hand
Posts: 2925
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes we are having having multiple servers. Now I have to create war and my war will be deployed on any unix server but how to transfer a unix script to that server.


Your idea of: bundle that script in the WAR to put it on a particualr" server sounds as solution

but my doubt is.suppose i have bundled script in the war .Now when i deploy this war.I have to keep this script at a particular location on unix server.how to transfer script from war to this unix server location where it is depoloyed.

thanks.
 
author & internet detective
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any reason you can't just FTP it over?

Also, be careful. The UNIX script can do anything your app server cab do. Confirm that UNIX script is well secured.
 
Monica Shiralkar
Ranch Hand
Posts: 2925
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What we want to accomplish is : We want to give this WAR to our client.our client should deploy the WAR on his unix server and Run the JSP which will call the scipt(but somehow the script needs to be transfered there)..

Is it a feasible design? Please advice .
 
Ranch Hand
Posts: 672
4
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why can't you give your client the script file too and tell them to put it on the UNIX server (where they deploy the war file)?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Monica. Shiralkar wrote:We want to give this WAR to our client.our client should deploy the WAR on his unix server and Run the JSP which will call the scipt(but somehow the script needs to be transfered there).


I see several problem with this approach. Firstly, if you don't know anything about the server where the script will run, then it's unlikely that the script will work on all of them. There's a large variety of Unix/Linux distributions and versions with many differences in paths, capabilities, environment variables, directory layout etc.

Secondly, on a Unix/Linux server a web app is very unlikely to have the rights to install or run shell scripts. On such systems it's common to use different user accounts for servers, especially to limit what they can do to the rest of the system. There may also be a security manager in place that governs what web apps can do on the Java level.

What does the script do that the web app can't do in Java code? It may be cheaper to spend a developer-month on adding those capabilities to the web app than to have to deal with the installation, maintenance and support issues of having to install a shell script over the lifetime of the web app.
 
Monica Shiralkar
Ranch Hand
Posts: 2925
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The unix script is supposed to create a cluster of certain number of nodes for big data. Suppose we take care of the rest is there any way that the script can be bundled in the war and it can be transferred to certain location on unix server?
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Most likely not, due to the issues I mentioned previously.
 
Monica Shiralkar
Ranch Hand
Posts: 2925
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Apart from the issues you mentioned I understand the below :

We can bundle a unix scipt inside a WAR.the deployed app can use this script.BUT there is no way this script can be AUTOMATICALLY transferred to any particular location on the server war is deployed.(Unless manually done)

please correct me if i am wrong.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

the deployed app can use this script.


Are you sure about this? The script can only run if it's installed on the target machine, and that will be difficult due to the issues I mentioned.
 
Monica Shiralkar
Ranch Hand
Posts: 2925
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the unix script we have tested to run standalone.now only thing is once this war is deployed there is there a way to tansfer this war to particular location say on the unix server.?
In general for any WAR is it possible to bundle a unix script and this script will be transfered to cetain location on the unix server.?

thanks
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maybe. Maybe not. It depends on the issues raised in all the previous answers. Is there a way that works in general? No.
reply
    Bookmark Topic Watch Topic
  • New Topic