System calls in c program

Is there any way to change user in a shell (SU command) and then change this users password (PASSWD) and then back again (EXIT) from inside of a C-program.
The passwd-part is solved. The problem is that one can only change password for the current user...
/Andreas

This is an external RFC server program, not a remote enabled ABAP RFC function module as the others seem to be assuming, right?
Is it possible that your DEV and QAS systems only have one application server, but the PROD has many and dedicated one(s) for processing low priority background jobs?
It might be that the target server of your TCP connection is not this BTC instance, and your RFC server is returning the data "locally" - so, into nirvana...
Just guessing, but might be worth checking.
Cheers,
Julius

Similar Messages

  • How to access system calls from java program?

    i am having a doubt regarding accessing system calls from a Java program like accessing unix system calls from a c program.

    Runtime.getRuntime().exec("line command here");
    example:
    Runtime.getRuntime().exec("ls -la");

  • How to intercept system calls in JVM?

    Hi, everyone. I am looking for a way to intercept system calls in JVM, a way do something like ptrace does in Linux. Because I wanna log all function calls a specified application made, and I may modify the arguments and the return value.
    And then i search the internet but nothing found except this article:
    [  http://java.sun.com/developer/technicalArticles/Programming/jvmti/#Authors|  http://java.sun.com/developer/technicalArticles/Programming/jvmti/#Authors]
    It's seems that JVMTI is a perfect tools to manipulate Java VM and i can achieve my goal with it. I download the sample code you written and modify a bit to adopt my environment (I use Linux and Sun JDK 6). It works well.
    And then I add a function to get stacktrace like the case in your article. I also read the sample code in JVMIT Refenerce, but it doesn't work.
    So, I am puzzled. I wanna know is there any way to intercept system calls in JVM? If JVMTI can do it, is there any tutorial or sample code to review? And, is that possible to use this way in J2ME?
    Thanks a lot :)
    Best Regard.

    jschell wrote:
    Nelly_Zeltser wrote:
    I do not know if there are any tools similar to solaris truss is available to trace system and library calls in j2me world.Well, I want to trace the jvm system calls to OS (UNIX), not java.Are you using j2me?No, to say more I'm not "using" java at all. My program (written on C) just monitors all system calls from another program that I define as the parameter.
    It may not be java. It may be any program:for example my simple .o file made by myself.
    Can we continue this topic at [http://forums.sun.com/thread.jspa?messageID=10746765&#10746765|http://forums.sun.com/thread.jspa?messageID=10746765&#10746765]
    I've written my shared library and defined LD_PRELOAD. But it doesn't help, cuz JVM, afaik, uses LD_PRELOAD for its own purposes, so
    I can't use my shared library.That of course is not what the poster of this thread wanted to do.

  • Internal system call used by "ps" command

    Hi All,
    Can any one let me the internal system call used by "ps" command to retrieve the process information. I want to use the same system call in my program to get list of information about processes currently running in the system. I do not want to use the "ps" command in my code.

    Justin_Samuel wrote:
    Hi All,
    Can any one let me the internal system call used by "ps" command to retrieve the process information. I want to use the same system call in my program to get list of information about processes currently running in the system. I do not want to use the "ps" command in my code.You can access the /proc filesystem for getting information about
    processes, even more than is available via ps.
    Have a look at:
    man -s 4 proc

  • System call failed. Error 2 (The system cannot find the file specified. ) in execution of system call 'CreateProcessAsUser' with parameter ( , NULL,  Program Files/sapinst_instdir/BS2011/ERP606/AS-ABAP/SYB/HA/DB, &StartupInfo, &ProcessInfo),

    Dear All,
    I am getting a below error while doing ehp6 installation on sybase (high availbility )
    can any one help me on this..?
    An error occurred while processing option SAP Business Suite 7i 2011 > Enhancement Package 6 for SAP ERP 6.0 > SAP Application Server ABAP > SAP ASE > High-Availability System > Database Instance( Last error reported by the step: System call failed. Error 2 (The system cannot find the file specified. ) in execution of system call 'CreateProcessAsUser' with parameter ( , NULL,  Program Files/sapinst_instdir/BS2011/ERP606/AS-ABAP/SYB/HA/DB, &StartupInfo, &ProcessInfo), line (646) in file (d:\depot\bas\720_rel\bc_720-2_rel\gen\optu\ntamd64\ins\sapinst\impl\src\syslib\synxcchapp.cpp), stack trace: d:\depot\bas\720_rel\bc_720-2_rel\gen\optu\ntamd64\ins\sapinst\impl\src\ejs\ejscontroller.cpp: 181: EJSControllerImpl::executeScript() d:\depot\bas\720_rel\bc_720-2_rel\gen\optu\ntamd64\ins\sapinst\impl\src\ejs\jsextension.hpp: 1059: CallFunctionBase::call() d:\depot\bas\720_rel\bc_720-2_rel\gen\optu\ntamd64\ins\sapinst\impl\src\osmod\iaxxbprocess.cpp: 423: CIaOsProcess::start_impl() d:\depot\bas\720_rel\bc_720-2_rel\gen\optu\ntamd64\ins\sapinst\impl\src\syslib\synxcchapp.cpp: 238: CSyChildApplicationImpl::start(false) d:\depot\bas\720_rel\bc_720-2_rel\gen\optu\ntamd64\ins\sapinst\impl\src\syslib\synxcchapp.cpp: 262: CSyChildApplicationImpl::doStart() .). You can no
    Regards,
    Letz..

    Hello Mauricio.
    Thanks
    Two Thinks:
    1.- This error appears precisely in the process of creating SAP users including you mention sidadm:
          A.- Execute sapinst
          B.- Installation option is chosen
                SAP NetWeaver CE Production Edition
                        Installation Options
                            High-Availability System
                                  Central Service  Instance (SCS)
           c.- System ID, Next and appear message error
    2.- However, the user manually create sidadm, I gave the permissions you indicate, and the error message is the same
    Thanks

  • C programming System calls

    Ok I am starting to program in C and I would like to make useful apps
    but I don't know how to call other programs within linux from C
    I'm looking for guides that help on linux "C" programming.
    I've tried some guides I googled but I tried their examples and don't get anything
    they appear obsolete (1996 or 1999)
    Guide I found
    Any sugestions?
    Thanks

    toofishes wrote:Note that calling other programs is not a common occurrence for C programs...nor is that a "system call". A system call is calling a kernel-provided function such as stat or access, not calling another user-space program on the system.
    U call other programs with a system call, u can open a file and do operations on it with system calls too.
    What he want is a GUI like gtk or a framework

  • Calling an ABAP Program from source system in a process chain

    Hi,
    I need to call an ABAP program (Extract program RMBWV308) from R/3 within a Process Chain in BW 3.5
    Your urgent advice please

    Hi,
    check the following link:
    Start an ABAP program in R/3 from a process chain in BW
    regards,
    raju

  • How to call a dialog program with return value in another dialog program

    Dear All,
    How can I call a dialog program with return value from another dialog program?
    Regards,
    Alok.

    Hi Alok,
    You can you SET/GET parameters to do this.
    This is some information about this.
    To fill the input fields of a called transaction with data from the calling program, you can use the SPA/GPA technique. SPA/GPA parameters are values that the system stores in the global, user-specific SAP memory. SAP memory allows you to pass values between programs. A user can access the values stored in the SAP memory during one terminal session for all parallel sessions. Each SPA/GPA parameter is identified by a 20-character code. You can maintain them in the Repository Browser in the ABAP Workbench. The values in SPA/GPA parameters are user-specific.
    ABAP programs can access the parameters using the SET PARAMETER and GET PARAMETERstatements.
    To fill one, use:
    SET PARAMETER ID pid FIELD f.
    This statement saves the contents of field f under the ID pid in the SAP memory. The ID pid can be up to 20 characters long. If there was already a value stored under pid, this statement overwrites it. If you double-click pid in the ABAP Editor, parameters that do not exist can be created as a Repository object.
    To read an SPA/GPA parameter, use:
    GET PARAMETER ID pid FIELD f.
    This statement places the value stored under the pid ID into the variable f. If the system does not find any value for pid in the SAP memory, sy-subrc is set to 4. Otherwise, it sets the value to 0.
    Thanks,
    SriRatna

  • Correct Forum? CGI and Server behaviour on Solaris at system()-call

    Hi to you all,
    Do not know if i am in the correct forum, but maybe it is a Webserver problem.
    I have Sun ONE Webserver 6.1 running on Solaris.
    Craete some CGI`s in C.
    Now I have a problem with one CGI, which have to call a Shellscript via system() call.
    The Client just calls the CGI with some parameters, which will write the informations in a file with some additional informations from a database, after that, the script should be startet and do some printjobs in the background.
    The CGI and the Shell-script is working fine. My Problem is, that the system() call always waits, until the ShellScript has finished, so the Webserver send the "data successful written" site after a couple of minutes, it should send it immeditatly to the client, so the session is closed.
    I have tried to put the shellscript in background with "&", also with nohup and a second shell script which justs starts the first script, also with all combinations of nohup and "&" for background process.
    also i tried with "pclose(popen(SCRIPT,"W");" to call the script, it is always the same, the session will close only, when the script has been finished.
    In an other Forum I found an entry, that , however, IPlanet webserver always will do this in this way. The session will be closed, when all called processes has benn fisnished.
    Any Ideas to solve my problem?

    The web server reads from the CGI program's stdout. It knows the HTTP response is complete when the CGI program closes its stdout.
    When you call system(), the child process inherits the CGI program's stdout and keeps it open until it finishes. If you want the child process to run asynchronously from the HTTP response, you should give the child process a new stdout with > /dev/null. (You'll still need to place the child process in the background with &.) Alternatively, you can fork(), close(1), then exec().

  • How to change system time through java program

    Hi
    I want to know, how to change system time through java program.
    give me a idia with example.
    Thanks

    There isn't any core Java API for this. Use JNI or call an external process with Runtime.exec().
    ~

  • When I call an external program from Labview, how can I embed the interface into the front panel?

    I'm running Labiew 6i for Linux. I'm using a system exec.vi to call an external program to do image manipulation (since there is no IMAQ for linux). How can I embed the user interface of the external program into the front panel of Labview?

    As far as I know, the only way to embed other GUIs in LabView is an ActiveX in a container.
    As long as you are using Linux, try to place (moving them on the desktop ) the two windows linked (like those 3 of WinAmp).

  • Exchange 2007 SP3 Install on 2008R2 Fails with "The data passed to a system call is too small"

    I'm installing Exchange 2007 SP3 onto Server 2008 R2. I have run this install in compatibility mode and in normal install mode with the same results. Error code 3221684346: The data area passed to a system call is too small. I am installing directly from
    the SP3 files, this is not an upgrade. What do I have to do to get this to work?
    [2/15/2011 7:24:18 AM] [2] Interpreting line <CreateSecureKey:MSExchangeIS\ParametersPrivate> -- ID:31259 --
    [2/15/2011 7:24:18 AM] [2]  CInsParser::ScProcessLine (f:\08.03.0083\sources\dev\admin\src\libs\exsetup\hiddenw1.cxx:1199)
               Error code 0XC007007A (122): The data area passed to a system call is too small.
    [2/15/2011 7:24:18 AM] [2] Processing file 'C:\Exchange Server\Setup\data\mdb_reg.ins', at or near line 77 (CreateSecureKey:MSExchangeIS\ParametersPrivate) -- ID:31111 -- CInsParser::ScProcessLine (f:\08.03.0083\sources\dev\admin\src\libs\exsetup\hiddenw1.cxx:488)
               Error code 0XC007007A (122): The data area passed to a system call is too small.
    [2/15/2011 7:24:18 AM] [2] Registry file name: 'C:\Exchange Server\Setup\data\mdb_reg.ins' CRegistryManager::ScProcessFile (f:\08.03.0083\sources\dev\admin\src\udog\setupbase\tools\regmgr.cxx:125)
               Error code 0XC007007A (122): The data area passed to a system call is too small.
    [2/15/2011 7:24:18 AM] [2] Filename = 'C:\Exchange Server\Setup\data\mdb_reg' CBaseAtom::ScRunRegistryFile (f:\08.03.0083\sources\dev\admin\src\udog\setupbase\basecomp\baseatom.cxx:1379)
               Error code 0XC007007A (122): The data area passed to a system call is too small.
    [2/15/2011 7:24:18 AM] [2] Leaving CBaseAtom(Information Store Service)::ScRunRegistryFile
    [2/15/2011 7:24:18 AM] [2] Filename = 'C:\Exchange Server\Setup\data\mdb_reg' CBaseAtom::ScAddRegistryKeys (f:\08.03.0083\sources\dev\admin\src\udog\setupbase\basecomp\baseatom.cxx:1249)
               Error code 0XC007007A (122): The data area passed to a system call is too small.
    [2/15/2011 7:24:18 AM] [2] Leaving CBaseAtom(Information Store Service)::ScAddRegistryKeys
    [2/15/2011 7:24:18 AM] [2]  CAtomBaseMDB::ScAddRegistryKeys (f:\08.03.0083\sources\dev\admin\src\udog\exsetdata\components\server\a_basemdb.cxx:132)
               Error code 0XC007007A (122): The data area passed to a system call is too small.
    [2/15/2011 7:24:18 AM] [2] Leaving CAtomBaseMDB::ScAddRegistryKeys
    [2/15/2011 7:24:18 AM] [2]  CBaseAtom::ScAdd (f:\08.03.0083\sources\dev\admin\src\udog\setupbase\basecomp\baseatom.cxx:639)
               Error code 0XC007007A (122): The data area passed to a system call is too small.
    [2/15/2011 7:24:18 AM] [2] Leaving CBaseAtom(Information Store Service)::ScAdd
    [2/15/2011 7:24:18 AM] [2] Service = 'MSExchangeIS' CBaseServiceAtom::ScAdd (f:\08.03.0083\sources\dev\admin\src\udog\setupbase\basecomp\basesvcatom.cxx:203)
               Error code 0XC007007A (122): The data area passed to a system call is too small.
    [2/15/2011 7:24:18 AM] [2] Leaving CBaseServiceAtom(Information Store Service)::ScAdd
    [2/15/2011 7:24:18 AM] [2] mode = 'Install' (61953) CBaseAtom::ScSetup (f:\08.03.0083\sources\dev\admin\src\udog\setupbase\basecomp\baseatom.cxx:535)
               Error code 0XC007007A (122): The data area passed to a system call is too small.
    [2/15/2011 7:24:18 AM] [2]  ScSetupAtom (f:\08.03.0083\sources\dev\admin\src\udog\exsetdata\exsetds.cxx:897)
               Error code 0XC007007A (122): The data area passed to a system call is too small.
    [2/15/2011 7:24:18 AM] [2] Leaving ScSetupAtom
    [2/15/2011 7:24:18 AM] [2] [ERROR] An error occurred. The error code was 3221684346. The message was The data area passed to a system call is too small..
    [2/15/2011 7:24:18 AM] [1] The following 1 error(s) occurred during task execution:
    [2/15/2011 7:24:18 AM] [1] 0.  ErrorRecord: An error occurred. The error code was 3221684346. The message was The data area passed to a system call is too small..
    [2/15/2011 7:24:18 AM] [1] 0.  ErrorRecord: Microsoft.Exchange.Management.Deployment.ExsetdataException: An error occurred. The error code was 3221684346. The message was The data area passed to a system call is too small..
    [2/15/2011 7:24:18 AM] [1] [ERROR] An error occurred. The error code was 3221684346. The message was The data area passed to a system call is too small..
    [2/15/2011 7:24:18 AM] [1] Setup is halting task execution because of one or more errors in a critical task.
    [2/15/2011 7:24:18 AM] [1] Finished executing component tasks.
    [2/15/2011 7:24:18 AM] [1] Ending processing.
    [2/15/2011 7:42:08 AM] [0] End of Setup
    [2/15/2011 7:42:08 AM] [0] **********************************************

    I would probably rebuild the host machine. The Exchange installation should occur without any issues, and where a problem does occur that can be an indication of a more widespread problem. Rebuild the machine, reinstall the prerequisites and try again.
    Simon.
    Simon Butler, Exchange MVP
    Blog |
    Exchange Resources | In the UK?
    Hire Me.
    Hello Poster.
    I am having the same issue, however it is most likely NOT a host box problem. The above advice is not a fix. I have 3 servers that are cloned with the same setup. 2 were fixed by doing the Vista compatibility trick, this one gave a different error (which
    happened to be the same as above). This org was a 5.5 to 2000. to 2003 coexistence with 2007 currently(because the mailbox role won't install). It has something to do with AD or permissions. Server 2008 r2 inherently has problems installing exchange.
    Example, having to use vista compatibility to get the mailbox role to install. SP2 patch gives the same error to some people, and also doesn't upgrade the mailbox role properly in some cases. Some people have had luck restarting the IIS admin service, but
    that did not solve my copy of this error. I will repost here if I find a solution to this issue...
    Same exact setup log for me as well.
    [3/4/2011 10:45:51 AM] [2] Interpreting line <OpenMachineKey:SYSTEM\CurrentControlSet\Services> -- ID:31259 --
    [3/4/2011 10:45:51 AM] [2] Interpreting line <CreateSecureKey:MSExchangeIS\ParametersPrivate> -- ID:31259 --
    [3/4/2011 10:45:51 AM] [2]  CInsParser::ScProcessLine (f:\08.03.0083\sources\dev\admin\src\libs\exsetup\hiddenw1.cxx:1199)
               Error code 0XC007007A (122): The data area passed to a system call is too small.
    [3/4/2011 10:45:51 AM] [2] Processing file 'C:\Program Files\Microsoft\Exchange Server\Setup\data\mdb_reg.ins', at or near line 77 (CreateSecureKey:MSExchangeIS\ParametersPrivate) -- ID:31111 -- CInsParser::ScProcessLine (f:\08.03.0083\sources\dev\admin\src\libs\exsetup\hiddenw1.cxx:488)
               Error code 0XC007007A (122): The data area passed to a system call is too small.
    [3/4/2011 10:45:51 AM] [2] Registry file name: 'C:\Program Files\Microsoft\Exchange Server\Setup\data\mdb_reg.ins' CRegistryManager::ScProcessFile (f:\08.03.0083\sources\dev\admin\src\udog\setupbase\tools\regmgr.cxx:125)
               Error code 0XC007007A (122): The data area passed to a system call is too small.
    [3/4/2011 10:45:51 AM] [2] Filename = 'C:\Program Files\Microsoft\Exchange Server\Setup\data\mdb_reg' CBaseAtom::ScRunRegistryFile (f:\08.03.0083\sources\dev\admin\src\udog\setupbase\basecomp\baseatom.cxx:1379)
               Error code 0XC007007A (122): The data area passed to a system call is too small.
    [3/4/2011 10:45:51 AM] [2] Leaving CBaseAtom(Information Store Service)::ScRunRegistryFile
    [3/4/2011 10:45:51 AM] [2] Filename = 'C:\Program Files\Microsoft\Exchange Server\Setup\data\mdb_reg' CBaseAtom::ScAddRegistryKeys (f:\08.03.0083\sources\dev\admin\src\udog\setupbase\basecomp\baseatom.cxx:1249)
               Error code 0XC007007A (122): The data area passed to a system call is too small.
    [3/4/2011 10:45:51 AM] [2] Leaving CBaseAtom(Information Store Service)::ScAddRegistryKeys
    [3/4/2011 10:45:51 AM] [2]  CAtomBaseMDB::ScAddRegistryKeys (f:\08.03.0083\sources\dev\admin\src\udog\exsetdata\components\server\a_basemdb.cxx:132)
               Error code 0XC007007A (122): The data area passed to a system call is too small.
    [3/4/2011 10:45:51 AM] [2] Leaving CAtomBaseMDB::ScAddRegistryKeys
    [3/4/2011 10:45:51 AM] [2]  CBaseAtom::ScAdd (f:\08.03.0083\sources\dev\admin\src\udog\setupbase\basecomp\baseatom.cxx:639)
               Error code 0XC007007A (122): The data area passed to a system call is too small.
    [3/4/2011 10:45:51 AM] [2] Leaving CBaseAtom(Information Store Service)::ScAdd
    [3/4/2011 10:45:51 AM] [2] Service = 'MSExchangeIS' CBaseServiceAtom::ScAdd (f:\08.03.0083\sources\dev\admin\src\udog\setupbase\basecomp\basesvcatom.cxx:203)
               Error code 0XC007007A (122): The data area passed to a system call is too small.
    [3/4/2011 10:45:51 AM] [2] Leaving CBaseServiceAtom(Information Store Service)::ScAdd
    [3/4/2011 10:45:51 AM] [2] mode = 'Install' (61953) CBaseAtom::ScSetup (f:\08.03.0083\sources\dev\admin\src\udog\setupbase\basecomp\baseatom.cxx:535)
               Error code 0XC007007A (122): The data area passed to a system call is too small.
    [3/4/2011 10:45:51 AM] [2]  ScSetupAtom (f:\08.03.0083\sources\dev\admin\src\udog\exsetdata\exsetds.cxx:897)
               Error code 0XC007007A (122): The data area passed to a system call is too small.
    [3/4/2011 10:45:51 AM] [2] Leaving ScSetupAtom
    [3/4/2011 10:45:51 AM] [2] [ERROR] An error occurred. The error code was 3221684346. The message was The data area passed to a system call is too small..
    [3/4/2011 10:45:51 AM] [1] The following 1 error(s) occurred during task execution:
    [3/4/2011 10:45:51 AM] [1] 0.  ErrorRecord: An error occurred. The error code was 3221684346. The message was The data area passed to a system call is too small..
    [3/4/2011 10:45:51 AM] [1] 0.  ErrorRecord: Microsoft.Exchange.Management.Deployment.ExsetdataException: An error occurred. The error code was 3221684346. The message was The data area passed to a system call is too small..
    [3/4/2011 10:45:51 AM] [1] [ERROR] An error occurred. The error code was 3221684346. The message was The data area passed to a system call is too small..
    [3/4/2011 10:45:51 AM] [1] Setup is halting task execution because of one or more errors in a critical task.
    [3/4/2011 10:45:51 AM] [1] Finished executing component tasks.
    [3/4/2011 10:45:51 AM] [1] Ending processing.
    Just curious though, how long is your FQDN? Mine is 34 characters plus whatever exchange is adding to it during setup for this particular string. I found a post with the same error for ISA server and some buffer is only 100 characters for a system call.
    ERROR_INSUFFICIENT_BUFFER 122 (0x7A) The data area passed to a system call is too small. http://msdn.microsoft.com/en-us/library/ms681382(v=vs.85).aspx Indicates a msft programming problem.
    Outsource Technology Inc. MSFT Professional Consultant

  • Reading output of a system call

    Hi,
    It appears that java system call does not return a value in Netware OS.
    The same code functions flawlessly on other OS'es, eg. linux and windows.
    If the following code is run on a Netware (6.5), the following error is
    returned:
    External App Returned:
    java.io.IOException: Bad file number
    Does anyone knows how to receive the values from the system call on Netware?
    To reproduce the problem, do the following:
    1) save the included source code to netware server's sys:java/classes
    with a filename ExecuteExternalApp.java
    2) compile it issuing a console command:
    javac sys:java/classes/ExecuteExternalApp.java
    3) execute the application:
    java ExecuteExternalApp volumes
    This should successfully launch the system command "volumes" but also
    would give an error message:
    External App Returned:
    java.io.IOException: Bad file number
    ---- Source code
    import java.io.*;
    public class ExecuteExternalApp{
    public static String executeSystemCommand(String command) throws
    Exception {
    String ret = "";
    try
    Process process = Runtime.getRuntime().exec(command);
    BufferedReader input = new BufferedReader(new
    InputStreamReader(process.getInputStream()));
    BufferedReader err = new BufferedReader(new
    InputStreamReader(process.getErrorStream()));
    //InputStreamReader iar = new
    InputStreamReader(process.getInputStream());
    StringBuffer sb = new StringBuffer();
    String line = "";
    //while ((line = input.readLine()) != null)
    //testi tuleeko yksi rivi
    line = input.readLine();
    sb.append(line);
    input.close();
    ret = sb.toString();
    catch (Exception err)
    ret = err.toString();
    return ret;
    public static void main(String[] args) throws Exception {
    if (args.length > 0){
    String output = executeSystemCommand(args[0]);
    System.out.println("External App Returned:");
    System.out.println(output);
    else
    System.out.println("Usage: ExecuteExternalApp <command>");

    Guenter wrote:
    > Hi Jonne,
    > Jonne Viljanen <jonne.viljanen@rmv_this.helsinki.fi> wrote in
    > news:y%[email protected]:
    >
    >> Thank you for your effort. I've been trying to write a simple program
    >> that would monitor if any cluster resource would be in comatose and in
    >> such case, it would try to online the resource on some other cluster
    >> node. For this I'd need to run these system commands and parse their
    >> output:
    >>
    >> - "cluster resources" - to see if any resource is in comatose
    >>
    >> and
    >>
    >> - "cluster view" - to determine which nodes are online.
    >>
    >> Also i'd need to run "cluster offline resource" and "cluster online
    >> resource node", but for these command I would not need to get the
    >> output.
    >>
    >> I know that my approach is a bit clumsy, but it's beauty is in its
    >> simplicity. Novell's engineer suggested that with a bit more effort one
    >> could read the data from ldap or cluster related virtual XML files on
    >> the _Admin volume. I think that I should investigate the latter
    >> approach, since I'd like to avoid handling the ldap authentication. I
    >> appreciate any comments and suggestions. Code examples are also greatly
    >> welcomed ;-)
    > hmmm, well that sounds to me as if the language doesnt matter at all since
    > finally you most likely fire your app from cron to do these tasks frequently
    > automatically, right? Therefore I'd suggest you take a look at Perl - it
    > seems better suited for these tasks; look at sys:/perl/scripts where you find
    > Perl scripts which do already some cluster stuff, and AFAICT these make use
    > of the _ADMIN volume.
    > Additional info and Perl samples can be found with the VFS NDK IIRC:
    > http://developer.novell.com/wiki/ind..._File_Services
    >
    > greetz, Gnter.
    >
    Hi Gnter,
    Thank you for your excellent help. I started to play with the _ADMIN
    -volume today. I was amazed to see how much can be done with it. I got
    my little cluster watch application almost working in just 1 hour, but
    then spent the rest of the day trying to get it fully functional ;-) I
    still cannot figure out what is wrong with my code, so I was wondering
    if I could get any help from this newsgroup.
    I'm able to read the *.xml files and determine the cluster state and all
    the information I need. However I dont seem to be able to write the
    command files. I'm trying the following:
    public void offlineClusterResource(String resourceName) {
    String fileName = "_ADMIN:/Novell/cluster/Resource.cmd";
    //String logFile = "sys:java/classes/ClusterWorker.log";
    String commandLine = "<virtualIO><datastream
    name=\"command\"></virtualIO>"+
    "<ncsRequest><offline>" +
    "<resource>" + resourceName + "</resource>" +
    "</offline></ncsRequest>";
    //Log("Turning the cluster resource " + resourceName + "
    offline!!!", logFile);
    try {
    //PrintWriter in autoFlush mode
    PrintWriter pw = new PrintWriter(new FileWriter(fileName,
    false), false);
    pw.println(commandLine);
    pw.close();
    } catch (IOException e) {
    System.out.println("Unable to write " + fileName);
    It seems not to write anything to _ADMIN:/Novell/cluster/Resource.cmd.
    If I set the file to be eg. SYS:/tmp/Resource.cmd -it writes nicely to
    the file.
    What am I missing here?
    Cheers,
    Jonne

  • How to call a external program in java?

    Help!!
    Is there any method that can a java program can call a external program? For example execute a exe file.
    Thanks.

    Yes.
    Runtime.getRuntime().exec("exactly what you would type at the command line");
    But be aware that this is operating-system-specific and full of gotchas. When you run into one of them, come back to the forum and do a search, this is a frequent topic of discussion.

  • System() call not working

    I have a single line batch file that calls an ATMEL GUI via command line params. The batch file works fine. However, trying to call the batch file in a system() or LaunchExe() call does not. I am stumped. I have tried all of the following variants of calling it programmatically--none of which produce an output log file and all of which terminate almost immediately. When I run the batch file manually via a command window, it takes about 20-30 seconds to run. Any ideas?
       1) err = system("C:\\Program Files\\ATMEL Corporation\\SAM-BA v2.10\\pgmall.bat");
        2)err = system("C:\\Program Files\\ATMEL Corporation\\SAM-BA v2.10\\sam-ba.exe \\usb\\ARM0 AT91SAM9G20-EK pgmall.tcl > pgm_all.log 2>&1");
        3) err =system("cmd.exe C:\\Program Files\\ATMEL Corporation\\SAM-BA v2.10\\pgm_all.bat");
    4) err = LaunchExecutableEx ("C:\\Program Files\\ATMEL Corporation\\SAM-BA v2.10\\pgm_all.bat", LE_SHOWMINIMIZED, &g_bat);
    5) err = LaunchExecutableEx ("C:\\Program Files\\ATMEL Corporation\\SAM-BA v2.10\\usb\\ARM0 AT91SAM9G20-EK pgmall.tcl > pgm_all.log 2>&1", LE_SHOWMINIMIZED, &g_bat);
    Other suggestions?

    One possible problem can be the embedded spaces in the pathname: in this case Windows requires the command to be enclosed in quotes. Try this:
    err = system("\"C:\\Program Files\\ATMEL Corporation\\SAM-BA v2.10\\pgmall.bat\"");
    Another possibility is that prepending a "cmd /c" be required in some case, depending on the content of the batch file or for redirection.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

Maybe you are looking for