Sponsored Content
Top Forums Shell Programming and Scripting Capturing PIDs of same process at different instances Post 302570091 by Corona688 on Wednesday 2nd of November 2011 11:12:08 AM
Old 11-02-2011
system() doesn't work that way. The calling process is suspended until the thing it's calling finishes.

If the thing you're calling creates and forks and backgrounds a process on its own, how to capture that depends entirely on the thing you're running. It may tell you by some means(which we can't predict, not knowing what program) -- or it may not.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

capturing process id

I am newbie to unix shells world. I am trying to capture a background process id into a file so that it can be killed later. this process is basically a java program running in background as: java TestApp & this returning process id immediately. So how can i redirect that pid into a file.... (1 Reply)
Discussion started by: bvreddy
1 Replies

2. HP-UX

PIDs of background process

How to track the pid of a background child process(shell script) from a parent script ? For example :- $ sleep 10000 & 4220 where 4220 is the pid of bg process sleep. Now my requirement is to keep the sleep statement in a shell script(test.ksh) and will be invoking it from... (3 Replies)
Discussion started by: ramkumar
3 Replies

3. UNIX for Dummies Questions & Answers

Capturing the Process ID of a process

hi Everybody I am trying to capture process id of a process which has been started through the execution of a shell script CLASSPATH=. CLASSPATH=${CLASSPATH}:sampleswing.jar java -cp ${CLASSPATH} Sample echo $! > pid.sh above is the simple script file called swings.sh When i... (8 Replies)
Discussion started by: appleforme1415
8 Replies

4. Shell Programming and Scripting

Checking for multiple instances of a process

Hi I have a scenario where i need to check multiple instances of a running shell script (abc.sh) . How can I find from inside a running shell script whether any other instance of the same script is running or not? If any other instance of same shell script is running I need to exit from... (4 Replies)
Discussion started by: raghu.amilineni
4 Replies

5. AIX

Capturing Process on AIX boxes - IMP

Guys we all know what command 'COLUMNS=2047 /usr/bin/ps –eo pid,ppid,uid,user,args' does.It prints 5-column output for the running processes on a AIX box. Here is simple thing i need: I need to insert this tabular data in a db2 table. How do i need? I have created table with these five... (0 Replies)
Discussion started by: ak835
0 Replies

6. Shell Programming and Scripting

Capturing running process name

i'm looking to have my script capture it's own process name while running. i'm going to use this in the output of the script to track which script produced which output file(s). when i run: ps -ef | grep processname i only get as results a ps -ef listing for the grep inside my... (6 Replies)
Discussion started by: danmauer
6 Replies

7. Shell Programming and Scripting

Capturing the CPU% used by a process

Hi, I just wonder I need to write a script where I can check if a particular process is consuming X amount of CPU. I was thinking of using the ps command but doesn't seems to work. Any ideas. Thanks. (2 Replies)
Discussion started by: arizah
2 Replies

8. Shell Programming and Scripting

Capturing the killed process logs

I have two set of questions. 1) To skip killing some process automatically. 2) To kill other process and capture their log. I have set of process, some needs to be killed gracefully and others should be skipped. Listed are the process. adm 1522... (1 Reply)
Discussion started by: murali1687
1 Replies

9. Shell Programming and Scripting

Capturing the return code from background process

Hi All, I was out not working on unix from quite sometime and came back recently. I would really appreciate a help on one of the issue I am facing.... I am trying to kick off the CodeNameProcess.sh in PARALLEL for all the available codes. The script runs fine in parallel. Let say there are... (1 Reply)
Discussion started by: rkumar28
1 Replies

10. Hardware

CUDA GPU terminates process at random instances

I am trying to start troubleshooting an error on a virtual server that uses the ubuntu 14.04 OS. Basically what happens (seeming random) is that the GPU stops processing and terminates. What Imean by seeming random is that for 3 runs there is no error then on run 4 the error appears. It has... (2 Replies)
Discussion started by: cmccabe
2 Replies
cmappmgr(1m)															      cmappmgr(1m)

NAME
cmappmgr - launches and monitors an application process on a node SYNOPSIS
cmappmgr -node node_name [-cmappserver_timeout number_of_seconds] -service service_name DESCRIPTION
cmappmgr launches and monitors the specified application process on a specified node. The cmappserver(1m) daemon process must be running on the specified node, and there must be a routable TCP/IP network between the specified node and the local host where cmappmgr(1m) is run. cmappmgr exits when the application process exits. Options cmappmgr supports the following options: -node node_name Name of the node on which to launch the application process. -cmappserver_timeut number_of_seconds The number of seconds that must elapse before cmappmgr times out the connection with cmappserver on the specified node. This is optional. The default value is 10 seconds. The maximum value that can be specified is 600 seconds, and the mini- mum value is 1 second. -service service_name The full command line for the application or process to be launched. Note that -service must be the last argument speci- fied for cmappmgr as all strings following the argument are considered as part of the command line to launch the applica- tion process. Quotation marks ("") are not required. RETURN VALUE
cmappmgr returns the following value upon completion: 0 Successful completion. >= 1 One or more error conditions occurred. The value generally reflects the exit code of the process. If, for any reason, the process fails to launch on the specified node (for example, because of an error connecting to cmappserver), cmappmgr exits with 1. EXAMPLES
To launch an xclock application on the node v-smp1: cmappmgr -node v-smp1 -service /usr/bin/X11/xclock -display 16:89:255:19:0.0 AUTHOR
cmappmgr was developed by HP. SEE ALSO
cmappserver(1m). Designing high-availability solutions with HP Serviceguard and HP Integrity Virtual Machines Requires Optional Serviceguard Software cmappmgr(1m)
All times are GMT -4. The time now is 01:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy