Sponsored Content
Top Forums Shell Programming and Scripting Catch exit code of specific background process Post 302763865 by Xedrox on Wednesday 30th of January 2013 03:09:33 PM
Old 01-30-2013
Catch exit code of specific background process

Hi all, i hava a specific backgroud process. I have de PID of this process. At some time, the process finish his job, is there any way to catch the exit code? I use "echo $?" normally for commands.

Thanks!
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

catch SIGCHLD signal in parent process

I want to catch SIGCHLD signal in parent process. I can't use wait() system call to catch SIGCHLD according to project requirment. Operating system linux 3.1 can any one have a solution for this. Thanking you, ranjan (2 Replies)
Discussion started by: ranjan
2 Replies

2. Shell Programming and Scripting

background process return code

Hi I have the following piece of code that is calling another child process archive.ksh in the background while read file; do file_name=`ls $file`; ksh archive.ksh $file_name &; done < $indirect_file The problem is, indirect_file may contain anwhere from 2 to 20 different... (5 Replies)
Discussion started by: Vikas Sood
5 Replies

3. Shell Programming and Scripting

Return code of background process

Hi, I have a process that I run in the background that looks like this ${BASEDIR}/ksh/sqler.ksh ${compnames003} & and I would like to get the return code of the sqler.ksh script. so my code is like this ${BASEDIR}/ksh/sqler.ksh ${compnames003} & retcode=$? (3 Replies)
Discussion started by: c19h28O2
3 Replies

4. UNIX for Dummies Questions & Answers

Script to start background process and then kill process

What I need to learn is how to use a script that launches background processes, and then kills those processes as needed. The script successfully launches the script. But how do I check to see if the job exists before I kill it? I know my problem is mostly failure to understand parameter... (4 Replies)
Discussion started by: holocene
4 Replies

5. Shell Programming and Scripting

catch a particular word from a specific line -perlscript

Hi, App.log contains the data- ================================================= Value of DsRef =null Recovery File exixts Recovered readFile 20110509 17:00:00.369019 +0100s The DsRef Recovered from Recovery.txt file : 20110509 17:00:00.369019 +0100 Recovered from Recovery.txt file... (2 Replies)
Discussion started by: pspriyanka
2 Replies

6. Shell Programming and Scripting

How to put FTP process as a background process/job in perl?

Hi, I am using net::ftp for transferring files now i am trying in the same Linux server as a result ftp is very fast but if the server is other location (remote) then the file transferred will be time consuming. So i want try putting FTP part as a background process. I am unaware how to do... (5 Replies)
Discussion started by: vanitham
5 Replies

7. Shell Programming and Scripting

Background process, return code and pid.

Hey all, Okay, this one is tricky and I'm not sure there is a niec way to do it, or indeed anyway to do it. The main issue revolves around timing out a hung ssh. I am doing this by creating a wrapper script for the ssh with the following requirements. My requirements are: Defineable... (5 Replies)
Discussion started by: RECrerar
5 Replies

8. AIX

Catch Zombie Process

Hi All, Anyone have any shell script to capture the zombie process, as according to the support they need the real time zombie PID, they only provide the kdb (0) > p* |grep -i defunct (0) > p * | grep <hex pid> But this is doesn't seem easy to catch the zombie as it is not always... (1 Reply)
Discussion started by: ckwan
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. Shell Programming and Scripting

[BASH] Script to manage background scripts (running, finished, exit code)

Heyas, Since this question (similar) occur every now and then, and given the fact i was thinking about it just recently (1-2 weeks) anyway, i started to write something :p The last point for motivation was... (17 Replies)
Discussion started by: sea
17 Replies
vm-install-jobs(8)					      System Manager's Manual						vm-install-jobs(8)

NAME
vm-install-jobs - queries and manages VM creation jobs that were started by vm-install SYNOPSIS
vm-install-jobs [options ...] DESCRIPTION
VMs may be created by vm-install interactively, or as backgrounded jobs. The vm-install-jobs command manages backgrounded VM creation jobs. OPTIONS
--cancel job-id Cancels the specified job. If the VM is still running, it is stopped. This command may return before the VM is completely stopped or the vm-install process has completely exited. The job is not implicitly deleted, so that the cancelation progress may be observed. --delete job-id Deletes the specified job. The job must be in one of the FINISHED, FAILED, or CANCELED states. The VM's configuration is deleted, as are any disks that were created during the job. --detach job-id Detaches the created VM from the specified job. The job must be in the FINISHED state. The job is deleted, but the VM's configura- tion and its disks are left intact. --list Lists all known VM creation jobs, by ID. One job ID is output per line. --status job-id Outputs the status of the specified job. JOB STATES
Every job is always in one of the following states: 0: SETTINGS 1: PREP_INSTALL 2: INSTALL 3: POST_INSTALL 4: RUNTIME_CONF 5: RUNTIME 6: FINISHED 7: FAILED 8: CANCELED The normal progression is from state 0 to state 6. States 6, 7, and 8 are terminal states. JOB STATUS
Querying the job status will print (to stdout) a number of key/value pairs. The possible keys and their meanings are: exit The exit code of the VM creation job. This key is only present once the job is in one of the states FINISHED, FAILED, or CANCELED. To interpret the meaning of the exit code, see vm-install(8) id The job ID. Always present. inotify A filename to monitor (via inotify(7) ) for state changes. The recommended inotify mask to use is IN_CLOSE_WRITE. Always present. log The location of the log file. Always present. pid The process ID of the VM creation job. This key is only present if the VM creation process is still running. The PID is used internally to cancel the job. state The job's current state. See JOB STATES. Always present. uuid The VM's UUID. This key is only present once all of the VM's settings have been gathered. vnc The last known location to view the VM's console via VNC. Note that the presence of this key does not guarantee that the VM is cur- rently running. When no authentication is necessary, the URL will be ip::port. If authentication is necessary, the URL will be username:password@ip::port. DIAGNOSTICS
A zero exit code indicates success; non-zero indicates failure. Note that the exit code of this tool indicates the success of the job management command. It does not represent the success or failure of the job itself. SEE ALSO
To interpret the exit code of a job or of this command, see vm-install(8) To monitor state changes of jobs, see inotify(7) To report problems with this software or its documentation, visit http://bugzilla.novell.com 2007-02-01 vm-install-jobs(8)
All times are GMT -4. The time now is 11:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy