Processes in UNIX

Hi guys.
I'm trying to execute a process in Compaq UNIX Tru64, but I can't do it!
The code I use is the following:
import java.io.*;
public class RunProcess {
public RunProcess(String[] args) {
if (args.length == 0) {
System.out.println("You missed command");
System.exit(0);
try {
Runtime rt = Runtime.getRuntime();
Process p = rt.exec(args);
int i = Integer.MIN_VALUE;
while ((i = p.waitFor()) != 0) {
System.out.println("waiting...");
System.out.println("Finish" + p.exitValue());
catch (Exception ex) {
ex.printStackTrace();
public static void main(String[] args) {
new RunProcess(args);
If I run this code in Windows, for instance using:
java RunProcess WinWord MyDocument.doc
I've no problem: the MS-Word document appears on my screen and the Java program loop within while until I close the MS-Word document. After that the Java program prints "Finish" and the session in stopped.
If I trying to execute another program (not java!!!!!!) on a UNIX PC using the same RunProcess class, the Java program always loop within while (it continuously prints "waiting...") and it never stops.
Anyone of you could explain such different behaviour from Windows to UNIX?
Thanx.

You should NOT loop in waitFor! It is sufficient to call it only once!
public abstract int waitFor() throws InterruptedException
Waits for the subprocess to complete. This method returns immediately if the subprocess has already terminated. If the subprocess has not yet terminated, the calling thread will be blocked until the subprocess exits.

Similar Messages

  • Looping processes in unix

    Hi,
    Can anyone tell me how do i check the looping processes in unix and how can i resolve it.

    I am not sure what you trying to ask, but my general understanding of you question tells, that you are trying to find out a session with lots of CPU utilitzation(looping)
    on your command prompt type:
    oracle(FC4/) % prstat
    or
    oracle(FC4/) % top
    PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
    25291 oracle 3288M 3251M sleep 21 0 0:00.26 2.2% oracle/2
    by looking at under the "PID" column and co-relating the value with "CPU" column value will tell you which session/process are consuming lots of CPU, as you have mentioned already that there are some looping processes.
    hope it helps.
    Cheers,
    Z
    Message was edited by:
    Zahid Lakhani

  • How can I see the memory of a process in Unix

    I want to see how much memory a process with a specific pid takes in Solaris. How can I do this? I don�t have the top command available.
    Thank�s in advance

    use the ps command with the -vp switches then the pid (i.e. ps -vp 123)
    to show the percentage of memory the process is taking
    (note: Top shows the same info that this shows, I have a feeling that
    you want to know the exact amount of memory in bytes that the process is
    taking. In that case you should post this question in a Linux/Unix/Solaris
    forum for better answers)
    Hope that helps.

  • Process Scheduler UNIX - PSDSTSRV no post

    Hello I have a trouble.
    I have defined a Process Scheduler in UNIX… the processes and reports finish correct, but the distribution finishes incorrect… in the file stdout I have the following message:
    OprId = VP1
    PS_TOKEN=AAAAnwECAwQAAQAAAAACvAAAAAAAAAAsAARTaGRyAgBOZwgAOAAuADEAMBQa2m1pVz/gsTCheZFtS1f62cS47wAAAF8ABVNkYXRhU3icHYpLDkBAAEPfILN0ExPzQRwAO5mE2Fq6pMOpaZPXpinwmKpuMEjV+9NykfGWhZ2tVT9YObk15ESgl2c6MRSmQo8janEMSqfH78jEyAcNZwp8
    The XML file returned by the web server is invalid. (63,94)
    XML document object creation failed. (63,102)
    Unable to process HTTP reply from Report Repository. (63,73)
    =================================Error===============================
    Message: Unable to post report/log file for Process Instance: 7075, Report Id: 5359
    Process Name: AEMINITEST, Type: Application Engine
    Description: Programa Simple Pruebas AE
    Directory: /psoft/pt849/appserv/prcs/fs9dmo/log_output/AE_AEMINITEST_7075
    =====================================================================
    Can anybody help me?

    Its hard to tell why report distribution fails , there is a lot of criteria that needs to be in place to make it work.
    Does the user have process scheduler admin/report distribution admin roles assigned ?
    Is local node setup with user id/password ?It could be unix report node definition pointing to an incorrect location.
    what is the reports location in web server config.properties file ?

  • Launch background process from unix command line and detect if it is runnin

    in Cocoa, I am able to run unix app by using NSTask, it works fine to me. But I want to do the following:
    1. Start up a background process.
    2. Wait to see if this background process has been launched correctly.
    3. If yes, keep running following codes...
    With NSTask, I cannot make sure when the background process has been launched correctly... and other codes just keep running...
    If I do something like:
    while (bgprocess isRunning)
    }

    What exactly do you mean by "launched correctly"? Do you just care that the process has begun? Do you want to make sure it is still running? Do you want to see if there is some signal emitted (either affirmative "I am running" or absence of a child-died signal)?
    Your isRunning example does appear to be in accord with the NSTask docs for "do blah blah blah while the task is running", but that doesn't seem to be what your description says you want to do. Is "blah blah blah" an idle loop until the task has started, or is it something to do while the task is actually running?
    How about looking up the pid of the child process (processIdentifier for the NSTask) and then check whether that process is still running?

  • Auditting Java Process under Unix

    Is there a way to see which java processes are running
    in Unix?
    ps -f does not work because the arguments passed
    to java are too long and get truncated

    Hi,
    Try this command:
    # top | grep java
    "top" utility you can download it from http://www.sunfreeware.com for appropriate solaris versions.
    Revert back.
    Thanks,
    Senthilkumar

  • Killing the process at unix level

    Hi friends,
    I wanted to kill a process at the unixlevel, can any one help me.
    In SMLT i have scheduled a language it is running from last two days, i tried to check in SM66,SM50 and SM04 there is nothing there.
    I have checked in SM37 also there is no job there.
    But in SMLT i can see the tranport icon.
    I want to kill from the unix level . Pl help.
    thanks.

    There is no easy way of "deleting that icon" - various tables are involved in the language import, they apparently contain the wrong state.
    I suggest you either debug the program yourself and "fix" that manually or create an OSS call and let support people have a look on the system.
    Markus

  • Identifying lingering PeopleSoft process on Unix

    I am applying at PeopleTools patch. The doc says to shut down any appservers, web servers, process schedluers, and EM Agents before applying and make sure there are no lingering threads from any processes or things could get messed up. I shut down the appserver and process scheduler and the EM Agent on unix. The webserver is running on Windows along with another appserver and process scheduler.
    However, when I make a backup of the PS_HOME before patching, the backup copy is a slightly different size, suggesting that a file is not copied because it is in use. The difference is the backup copy has a smaller appserv directory and a slightly larger verity directory.
    How do I make sure all processes are killed and also get a complete backup?
    I am doing the copy as root and getting subdirectories and keeping the same permissions. There are other PS_HOMES on this server.

    Yes, on unix, my backup copy of the PS_HOME for that environment is about 300K smaller than the original.
    Sessions to the database don't show anything from that PeopleSoft user/home owner.
    i dont want the patch to fail (due to something in use) then the backup be invalid. Our unix admin did some work with the fuser command and revealed nothing. He thinks I shouldn't worry about the slight difference.
    I did notice something strange though after a while, a .adm folder appeared in the backup home. It contained only what appeared to be a license key.

  • Process in Unix

    How to bring process to background.?
    How to bring process to  foreground.?
    How to deburg an shell script file.?
    How to find errors in shell scripting file.?

    How does your questions relate to the Oracle Forms product?
    Craig...

  • HOWTO: start/stop htmldb processes in Unix

    I've installed 10gR2 DB, and then installed HTMLDB from the companion CD. I could access the server no problems, so my configuration is good and working.
    The issue is how do I start/stop the processes. It appears (from this forum) that Windows installs create a service but that's of course no good to me as I'm on AIX.
    I'm a database guy, not an iAS guy, and it took me a while to figure out the way to make this all work.
    First, set your ORACLE_HOME to the HTTP home (not the DB home).
    In ORACLE_HOME/opmn/bin is the magic command:
    ./opmnctl startall
    or
    ./opmnctl stopall
    Seems to do the job.

    That's almost right - that command will start & stop the Oracle HTTP Server (Apache). If Apache is down, then there is no way to access HTML DB via a web browser. However, users - if they had access - could still access the database, of course.
    There is no such thing as the "HTML DB Process", as HTML DB is nothing more than a schema in the database.
    Thanks,
    - Scott -

  • Multiple processes on unix server even stop replicat, is that block port?

    I have configured on source server Oracle goldengate manager/extract on port 7809 and same configured on target server with port 7809.
    Now over the weekend, I encountered two problems.
    1). tcp ip timeout from extract error log and extract abend.
    test : telnet linuxserver 7809
    $ telnet linuxserver 7809
    Trying...
    Connected to linuxserver.
    Escape character is '^]'.
    Connection closed.
    It connected, then after a second, connection closed.
    2). On target server, there are multiple processes for replicat existed even I stopped replicat and stopped manager. There are nothing running.
    ps -ef|grep ggs
    oracle 13595 1 0 May20 ? 00:00:00 ./replicat INITIALDATALOAD -p 7819-12818 -m 7809 PARAMFILE /u01/app/oracle/product/11.2.0/ggs/dirprm/load2.prm REPORTFILE /u01/app/oracle/product/11.2.0/ggs/dirrpt/LOAD2.rpt PROCESSID LOAD2 USESUBDIRS
    oracle 14031 1 0 May20 ? 00:00:00 ./replicat INITIALDATALOAD -p 7819-12818 -m 7809 PARAMFILE /u01/app/oracle/product/11.2.0/ggs/dirprm/load2.prm REPORTFILE /u01/app/oracle/product/11.2.0/ggs/dirrpt/LOAD2.rpt PROCESSID LOAD2 USESUBDIRS
    oracle 14447 1 0 May20 ? 00:00:00 ./replicat INITIALDATALOAD -p 7819-12818 -m 7809 PARAMFILE /u01/app/oracle/product/11.2.0/ggs/dirprm/load2.prm REPORTFILE /u01/app/oracle/product/11.2.0/ggs/dirrpt/LOAD2.rpt PROCESSID LOAD2 USESUBDIRS
    oracle 14674 1335 0 13:34 pts/0 00:00:00 grep ggs
    oracle 14962 1 0 May20 ? 00:00:00 ./replicat INITIALDATALOAD -p 7819-12818 -m 7809 PARAMFILE /u01/app/oracle/product/11.2.0/ggs/dirprm/load2.prm REPORTFILE /u01/app/oracle/product/11.2.0/ggs/dirrpt/LOAD2.rpt PROCESSID LOAD2 USESUBDIRS
    oracle 15529 1 0 May20 ? 00:00:00 ./replicat INITIALDATALOAD -p 7819-12818 -m 7809 PARAMFILE /u01/app/oracle/product/11.2.0/ggs/dirprm/load2.prm REPORTFILE /u01/app/oracle/product/11.2.0/ggs/dirrpt/LOAD2.rpt PROCESSID LOAD2 USESUBDIRS
    oracle 28295 1 0 May20 ? 00:00:00 ./replicat INITIALDATALOAD -p 7819-12818 -m 7809 PARAMFILE /u01/app/oracle/product/11.2.0/ggs/dirprm/load2.prm REPORTFILE /u01/app/oracle/product/11.2.0/ggs/dirrpt/LOAD2.rpt PROCESSID LOAD2 USESUBDIRS
    oracle 28751 1 0 May20 ? 00:00:00 ./replicat INITIALDATALOAD -p 7819-12818 -m 7809 PARAMFILE /u01/app/oracle/product/11.2.0/ggs/dirprm/load2.prm REPORTFILE /u01/app/oracle/product/11.2.0/ggs/dirrpt/LOAD2.rpt PROCESSID LOAD2 USESUBDIRS
    oracle 29158 1 0 May20 ? 00:00:00 ./replicat INITIALDATALOAD -p 7819-12818 -m 7809 PARAMFILE /u01/app/oracle/product/11.2.0/ggs/dirprm/load2.prm REPORTFILE /u01/app/oracle/product/11.2.0/ggs/dirrpt/LOAD2.rpt PROCESSID LOAD2 USESUBDIRS
    I have to manually kill those processes by kill -9 on server.
    How to control this manner?
    thanks.

    I have another quetion, in real life migration, our database have a lot clobs datatype, and logsegments, etc. What is the best practice or advices you can give to me?
    I am probably not the best guy to answer this question.
    Can I create multiple extracts on source and multiple replicat on source?
    Yes.
    Let's say we have 10 application users in the prod database, do I create at least extracts for each schema? then within each schema, I create multiple extracts to based on datatype or others?
    Yes. You can create one Extract/Replicat group per schema. That would help in parallelizing the things.

  • O/S oracle process in Unix

    How can I get the sid in v$session if I know the Oracle process on the O/S side? Thanks in advance for the reply.

    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> select process from v$session where username = 'DBADMIN';
    PROCESS
    9534
    SQL> !ps -ef | grep -i 9534
    bcm       9534  1553  0 19:00 pts/0    00:00:00 sqlplus               
    oracle    9535  9534  0 19:00 ?        00:00:00 oraclev112 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
    bcm      10085  9534  0 20:17 pts/0    00:00:00 /bin/bash -c ps -ef | grep -i 9534
    bcm      10087 10085  0 20:17 pts/0    00:00:00 grep -i 9534Edited by: sb92075 on May 10, 2010 8:18 PM

  • GetInputStream from Process in Unix

    child=rt.exec("sh test.sh");
    DataInputStream disOutput = new DataInputStream(new BufferedInputStream(child.getInputStream()));
    while ((temp = disOutput.readLine()) != null)
    System.out.println("Ouput:"+ temp);
    This code works in NT, but it doesn't in unix. I don't understand why, I want to read the InputStream while they are being printed, in NT it prints, but in UNIX nothing gets printed, however, the test.sh still executes.
    Why and how to solve this problem? Thanx a bunch
    Edmund

    DataInputStream seems an odd choice for reading streams of text. An InputStreamReader wrapped in a BufferedReader would make more sense. Might not solve your current problem, but why not try it?

  • Do I need to stop the SDM process on UNIX for backups?

    We are running Netweaver 04 SP13 on HPUX.  Can the SDM process stay running or do we need to shut it down during backups?
    Thanks!
    Steve

    As the technical operations manual stated:
    Create a backup of the SDM installation directory /usr/sap/<SID>/JC<inst_nr>/SDM.
    Make sure the SDM is stopped during backup.
    That should be clear enough...
    Regards,
    Benny

  • Process for setting up new directories and files on Unix

    I am trying to document a process �Process for setting up new directories and files on Unix batch servers�.
    Developer will be developing project on Windows and I need tell them as well as QA team how the Unix directory and file structure.
    Please let me know how is the process in Unix on AIX.
    If I get some documentation regarding this it will be useful.
    Thanks in advance
    Regards
    San

    well on unix/Linux/solaris there are no drives but storage heirarchy starts with a root directory represented with ' / '. and all files and directories are created in root directoy like
    /usr/local/bin
    /export/home/san
    etc
    also filesystem of unix consists iNodes rathar than FAT entries as in case of Windows.
    some basic information is available at
    http://www.techonthenet.com/unix/index.php
    Regards

Maybe you are looking for

  • My macbook pro (late 09) restart itself and refused start up.

    this my first post ever - been using Mac all my life but a rookie when it comes to crash report. My Macbook Pro (late 09) running Mavericks (all apps and everything else, kept updated) to day restart itself and i wonder what caused. had to do the rit

  • How do I install Snow Leopard 10.6.7 on my new SSD upgrade?

    I have a 2011 13.3" MBP.  I just bought a Corsair P3-128 SSD to upgrade it.  When I try to install the OS onto that HD it stops at about 20-25% and brings up some kind of error which does not let me go further.  The SSD was partitioned for GUID so it

  • Editing an iWeb site from a second Mac

    I recently purchased ILife 06 and have begun switching my existing web sites on my .mac account to be on iWeb format but i have a few questions: 1. I published the iWeb site with my iBook but I also want to populate and edit it with images from i Pho

  • Where does the resources bundle files need to be

    Hi All, Does any of you knows where all the custom resources bundle files that will be used on BCC need to be? I have something like this: BCC module /src/com/mycompany/resources/WebAppResources.properties But when I try to use it This happens javax.

  • Delivery Split ( 1 STO n deliveries)

    Dear all, I have a req where I need to create multiple Deliveries for one STO, there are standard pallet quantity in WM and they want to create 1 TO per delivery. there is going to be only one line item per STO. Eg: say we have a STO for 198 each pal