How to call another program as root in servlet

In my servlet, I want to call another background programs (writeen in c) to do some tasks and gather the output of them as the output of my servlet. Is there any way to do so like Suexec in apache.
Thanks

sorry I forgot mention that the c program required the caller had root privilege.This is the problem I facing now.
Thanks

Similar Messages

  • How to call another program from LabVIEW?

    Hi!
    Is there anyone that can answer my question? I have found a similar thread where the user needed to call labVIEW from some program but I want to do the opposite.
    I made a program in labVIEW that communicates via COM-ports (serial communication) with the processor I use at the job (Ubicom´s IP2022).
    Now I want to add more funcionality to this program. I want to be able to program re-program IP2022 through this LabVIEW application.
    The programming is done via an Ethernet-dongle. I start a program called IP2kProg, I write the ip-address of the dongle and the program-file (.elf) downloads at this address. But how can I do this from
    LabVIEW, do I need to open IP2kProg or can I send some values to it via LabViEW?
    Ant suggestions?
    Thanks, Amir

    Amir,
    There are couple of options:
    1.  If your IP2kProg program has a command-line interface, you can use LabVIEW's System Exec.vi and send the commands and parameters to it. 
    2.  If the IP2kProg has an API / exported functions, you can call them from LabVIEW using the Call Library Function Node. 
    Hope this gives you some ideas. 
    -Khalid

  • How to call one program from another program

    Hai,
      How to call one program through another program.
    Example.
       I have two programs 1.ZPROG1 2. ZPROG2.
    When i execute ZPROG1 at that time it should call ZPROG2.

    Hi ,
    u can use submit statement to call a program .
    DATA: text       TYPE c LENGTH 10,
          rspar_tab  TYPE TABLE OF rsparams,
          rspar_line LIKE LINE OF rspar_tab,
          range_tab  LIKE RANGE OF text,
          range_line LIKE LINE OF range_tab.
    rspar_line-selname = 'SELCRIT1'.
    rspar_line-kind    = 'S'.
    rspar_line-sign    = 'I'.
    rspar_line-option  = 'EQ'.
    rspar_line-low     = 'ABAP'.
    APPEND rspar_line TO rspar_tab.
    range_line-sign   = 'E'.
    range_line-option = 'EQ'.
    range_line-low    = 'H'.
    APPEND range_line TO range_tab.
    range_line-sign   = 'E'.
    range_line-option = 'EQ'.
    range_line-low    = 'K'.
    APPEND range_line TO range_tab.
    SUBMIT report1 USING SELECTION-SCREEN '1100'
                   WITH SELECTION-TABLE rspar_tab
                   WITH selcrit2 BETWEEN 'H' AND 'K'
                   WITH selcrit2 IN range_tab
                   AND RETURN.
    regards,
    Santosh thorat

  • Calling another program and waiting for output

    Hi,
    I'm writing a program that passes a file created for an application called Net Sim but has to wait for the output. Net Sim lies in another directory from the java files and I don't know how to call the program with the file created as a parameter, such as:
    ns2 network1.tcl
    where 'ns2' is the dos command to run net sim and 'network1.tcl' is a file passed as a parameter to the program.
    I've tried
    try{
    Runtime r = Runtime.getRuntime();
    r.exec(" <directory> ");
    }catch(IOException e){
    System.out.println("Error " +e);
    This doesn't work though and I could use some help, as well as how to save the file created by the program in another directory.
    Finally, I need to know how to make the program wait for the output from net sim which is a file I intend to use. Can I do this with a while loop etc.?
    I thank you in advance for any help,
    Regards,
    Gary.

    Here's an article from JavaWorld describing some of the pitfalls when using Runtime.exec() that might help you:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • How to Call another screen using the ABAP Report which is displaying ALV ou

    Hello All,
    I am developing a ABAP report in which I want to transfer the stock from material to another material.
    My Report will include 3 to screens.
    The first sleection screen will display all the material with their stock value.
    When we execute the report I will get the list of materials along with their current stock. On the top of the output screen I want the Execute button. Also , each line of the output should have checkbox or the ALV provides the functionality of editing one cell like that.....Once the user tick the checkbox or the cell....then I want to move to another screen where user can enter the Quantity and then user will tick ok and then I will call one function module so that the material documnet is posted and transfer of posting form material to material is done successfully.
    Could anyone please help me out how to call another screen from the output screen where user can enter the Quantity amount....
    I dont want to use the Dialog programming.....I want to create the simple ALV Abap report.
    Regards,
    Komal Bhutada.

    Hi Raymond,
    Thanks for the input...I will try this in my code .....
    Can you please help me how to insert the checkbox in the ALV Output....so that I can select one of row and then press execute to process further?..
    Thanks for the information.
    Regards,
    Komal.

  • How to call  java program from ABAP

    Hi Experts,
         My requirement is to call java programs from ABAP. For that i have set up SAP JCO connection by using this link http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/739. [original link is broken] [original link is broken] [original link is broken] Connection gets sucessfully. After this how to call java program from ABAP as per our requirement. Please help me out.
      Also i tried this way also.. but while executing the DOS Command line appear & disappear in few seconds. So couldnt see the JAVA output. Please help me out to call java programs in ABAP..
    DATA:command TYPE string VALUE 'D:Javajdk1.6.0_20 injavac',
    parameter TYPE string VALUE 'D:java MyFirstProgram'.
    CALL METHOD cl_gui_frontend_services=>execute
    EXPORTING
    application = command
    parameter = parameter
    OPERATION = 'OPEN'
    EXCEPTIONS
    cntl_error = 1
    error_no_gui = 2
    bad_parameter = 3
    file_not_found = 4
    path_not_found = 5
    file_extension_unknown = 6
    error_execute_failed = 7
    OTHERS = 8.
    Thanks.

    This depends on the version of your Netweaver Java AS. If you are running 7.0, you will have to use the Jco framework. The Jco framework is deprecated since 7.1 though. If you want to build a RFC server in 7.1 or higher, it is adviced that you set it up through JRA.
    Implement an RFC server in 7.0:
    http://help.sap.com/saphelp_nw04/helpdata/en/6a/82343ecc7f892ee10000000a114084/frameset.htm
    Implement an RFC server in 7.1 or higher:
    http://help.sap.com/saphelp_nwce72/helpdata/en/43/fd063b1f497063e10000000a1553f6/frameset.htm

  • How to call driver program internal table in a form

    how to call driver program internal table in a form? Given below is my code
    TABLES: VBRK,VBAK,ADRC,KNA1,VBRP,VBAP,J_1IMOCOMP.
    DATA: BEGIN OF IT_CUST_ADD OCCURS 0,
    STREET LIKE ADRC-STREET,
    NAME LIKE ADRC-NAME1,
    POST_CODE LIKE ADRC-PSTCD1,
    CITY LIKE ADRC-CITY1,
    CUST_TIN LIKE KNA1-STCD1,
    END OF IT_CUST_ADD.
    DATA: BEGIN OF IT_IN_DA OCCURS 0,
    VBELN LIKE VBRK-VBELN,
    FKDAT LIKE VBRK-FKDAT,
    END OF IT_IN_DA.
    now suppose these are my internal table. what should i write in FORM INTERFACE (associated type)

    Hi Sashi, this will solve ur problem.
    Check the below link.
    REG:PEFORM IN SCRIPT
    kindly reward if found helpful.
    cheers,
    Hema.

  • How to call java program by HTML page

    Hi guys,
    I'm new java programer and want to build an HTML page to access to ORACLE database on NT server by JDBC, Can anyone give me a sample?
    I already know how to access database by JDBC, but I don't know how to call java program by HTML page.
    If you have small sample,pls send to me. [email protected], thanks in advance
    Jian

    This code goes with the tutorial from this web page
    http://java.sun.com/docs/books/tutorial/jdbc/basics/applet.html
    good luck.
    * This is a demonstration JDBC applet.
    * It displays some simple standard output from the Coffee database.
    import java.applet.Applet;
    import java.awt.Graphics;
    import java.util.Vector;
    import java.sql.*;
    public class OutputApplet extends Applet implements Runnable {
    private Thread worker;
    private Vector queryResults;
    private String message = "Initializing";
    public synchronized void start() {
         // Every time "start" is called we create a worker thread to
         // re-evaluate the database query.
         if (worker == null) {     
         message = "Connecting to database";
    worker = new Thread(this);
         worker.start();
    * The "run" method is called from the worker thread. Notice that
    * because this method is doing potentially slow databases accesses
    * we avoid making it a synchronized method.
    public void run() {
         String url = "jdbc:mySubprotocol:myDataSource";
         String query = "select COF_NAME, PRICE from COFFEES";
         try {
         Class.forName("myDriver.ClassName");
         } catch(Exception ex) {
         setError("Can't find Database driver class: " + ex);
         return;
         try {
         Vector results = new Vector();
         Connection con = DriverManager.getConnection(url,
                                  "myLogin", "myPassword");
         Statement stmt = con.createStatement();
         ResultSet rs = stmt.executeQuery(query);
         while (rs.next()) {
              String s = rs.getString("COF_NAME");
              float f = rs.getFloat("PRICE");
              String text = s + " " + f;
              results.addElement(text);
         stmt.close();
         con.close();
         setResults(results);
         } catch(SQLException ex) {
         setError("SQLException: " + ex);
    * The "paint" method is called by AWT when it wants us to
    * display our current state on the screen.
    public synchronized void paint(Graphics g) {
         // If there are no results available, display the current message.
         if (queryResults == null) {
         g.drawString(message, 5, 50);
         return;
         // Display the results.
         g.drawString("Prices of coffee per pound: ", 5, 10);
         int y = 30;
         java.util.Enumeration enum = queryResults.elements();
         while (enum.hasMoreElements()) {
         String text = (String)enum.nextElement();
         g.drawString(text, 5, y);
         y = y + 15;
    * This private method is used to record an error message for
    * later display.
    private synchronized void setError(String mess) {
         queryResults = null;     
         message = mess;     
         worker = null;
         // And ask AWT to repaint this applet.
         repaint();
    * This private method is used to record the results of a query, for
    * later display.
    private synchronized void setResults(Vector results) {
         queryResults = results;
         worker = null;
         // And ask AWT to repaint this applet.
         repaint();

  • Calling another program

    Is it possible to call another program (vlc media player in my case) in a VI???I dont want to use the Active X control for playin videos as it does not have much playback functions...

    Use the System exec.vi to launch any executable from LabVIEW in your case VLC player.  Provide the required inputs path, command line args so that you can obtain the desired functionality.
    With regards,
    JK
    (Certified LabVIEW Developer)
    Give Kudos for Good Answers, and Mark it a solution if your problem is solved.

  • Calling another program from the current program

    Hi all,
    In our requirement we are calling another program from our current program .
    In the current program( from which we are calling ) we are giving file name in the selection screen
    and when we run the current program we are successfully going to other program but our main requirement is to higlight the file name which we had given earlier .
    Note :  The called program doesnt have any selection screen.

    HI
    use EXPORT and IMPORT key words for passing data from one program to another program.
    as the called program is available in the same session you can use above key words which means you are accessing ABAP MEMORY.
    You can also use SET and GET key words which means SAP memory
    take F1 help there are examples tooo and detailes explanation abou the same
    Regards
    Ramchander Rao.K
    Edited by: Ramchander Krishnamraju on Dec 24, 2008 7:05 AM

  • How to call another view controller's method from a view controller?

    Hi,
    Iam new to webdynpro . so pls clarify my doubt.
    How to call another view controller's method from a view controller in the same Web Dynpro Component?
    Thanks,
    Krishna

    Hi,
         The methods in a view are only accessible inside same view. you cannot call it outside the view or
         in any other view although its in same component.
         If you want to have a method in both views, then create the method in component controller and
         from there you can access the method any where in whole component.

  • How to call another directory java program?

    Hi All,
    For Example:
    My program is here in two directories.Let Think that directory names like A and B.
    Let Program names like Aprog(A directory) and Bprog(B directory).
    I want to call Aprog to Bprog method.
    How to call?
    Plz., help me ASAP.
    --Mohan                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    My program is here in two directories.Let
    Think that directory names like A and B.
    It's more complicated than that. A java program consists of multiple .class files. In general you have one or more "trees" of directories of .class files, where the structure of the tree reflects the package structure. So a the class file for "org.dingbat.Thingy" is <basedir>/org/dingbat/Thingy.class where <basedir> is some directory on the class path.
    So referencing one class from another in different directories requires that the source provides the "fully qualified name" of the class (usually on an import) and making sure that, if it's in a different class file tree, both base directories are on the class path.

  • Call another program in first program

    hi,
    i need to perform to call another report in my current report. so how am i going to do so?
    how report work:
    the report are going to run as background job. once the report run, it will send out the report in text file to user. and then i want it to trigger report 2. report 2 work the same, it will send another text file to user.
    and the parameter for both the report is on current date only.
    so how am i going to code in my first report program, to call the second report program, and to execute it?
    thanks
    Edited by: ben leen lee on May 14, 2008 3:57 AM

    Hi, 
    clear: d_JOB_COUNT.
        CALL FUNCTION 'JOB_OPEN'
          EXPORTING
            JOBNAME  = d_JOBNAME
          IMPORTING
            JOBCOUNT = d_JOB_COUNT.
        submit ZFI_AGEWISE_PERFORMANCE
        VIA JOB d_JOBNAME
        NUMBER  d_JOB_COUNT
        with IKUNNR   IN r_id
        with s_vertn  in S_VERTN
        with s_hkont  IN S_HKONT
        with IBUDAT   eq IBUDAT
        with P_BUKRS  eq P_BUKRS
        with s_umskz  in s_umskz
    *with R1 = R1
        WITH R2 = R2
    *with r3 = R3
        WITH P_SESS = P_SESS
        AND RETURN.
        CALL FUNCTION 'JOB_CLOSE'
          EXPORTING
            JOBNAME      = d_JOBNAME
            JOBCOUNT     = d_JOB_COUNT
            STRTIMMED    = 'X'.
    Reward Points

  • How to Create another program instance in iphone from a COPY previous proj

    Say I've created one program by starting Xcode afresh.
    Now I want to create another program using the previous program as a base, I copy and paste the project folder and rename it, unfortunately, when I run the program, it replaces the previous program in my iPhone.
    How do I tell xcode it's a new program ?
    Message was edited by: Bracer-J

    Thank you

  • How to call external programs?

    I have seen people call external programs through LabVIEW and was curious what functions you could use to do this.
    I'm pretty sure its using one of the ActiveX functions  or maybe 'open application reference .vi'.
    Can anyone tell me (or show me) a quick example of how to open an external program (ie excel,  notepad, etc) programatically
    Cory K
    Solved!
    Go to Solution.

    Cory K wrote:
    Where did they get this:
    Kudos for going from "I don't know to start" to "Let's stump Ben" with only the second post to this thread.
    I either copy it from an example or try to browse to it.
    NOTE:
    If you plan to work with MS ActiveX objects, I found it very helpful to do a custom install of Office and make sure the help files for VBA are loaded. These will at the least give you an idea of what the methods are and what parameters go with each.
    Ben
    Message Edited by Ben on 12-31-2008 11:09 AM
    Message Edited by Ben on 12-31-2008 11:13 AM
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction
    Attachments:
    Browse.PNG ‏24 KB

Maybe you are looking for

  • Object reference not set to an instance of an object.at Microsoft.SharePoint.ApplicationPages.VersionsPage.ItemVersion

    I am getting an object reference not found error when trying to view the version history of any list item within my web application, as well as view or edit any list item properties in general.  Below is what the ULS log generates when I try to view

  • Applescript Rules Don't Work in 10.8 Mail.app

    Very simple thing Im trying to do here. Set up a rules to run a simple growl notification script when a new mail with a vertain subject arrives. This script works perfectly file in the editor and runs file outside of the mail.app. Set to to run as a

  • Progressbar and loader problem with IE

    Hello there, well, in my project i have been using the loader and the progressBar components. (actionscript 2). the loader and the progress bar placed on the "main.swf" and its loading an external ".swf's". I am a mac user, so i was testing the movie

  • Please help problem with GUI

    Hi I have two problems firstly when i try to assign a method to a button to a GUI      JButton SetPrice = new JButton ("Set Price");         contentPane.add( SetPrice);          SetPrice.addActionListener(new ActionListener() {                       

  • Can Iris Pro run Photoshop 3D

    I want to upgrade my 2009 iMac to a 2013 version with Iris Pro (no discreet videocard) and as much RAM as I can get in there. Does anybody know if the 3D function in Photoshop CS6/CC run on this configuration? Adobe sets the minimum of 512MB of VRAM,