Sponsored Content
Top Forums Programming different behaviour in fg and bg Post 302580708 by Bruble on Friday 9th of December 2011 10:29:56 AM
Old 12-09-2011
different behaviour in fg and bg

fg = foreground bg = background
I have a cobol program that I start with a very simple script.
The script is not at fault as it has not changed and the program worked in fg and bg before.
I have altered the logging in the program and moved my cursor declare to working storage.
The program runs as a daemon sleeping and checking every minute if it needs to run.
now when I run in foreground - it works creating the log file and reading the records from the oracle database
when run ./start_script& (in background)
no log file in /tmp
no records selected from oracle although in exact state as those set for foreground test?
Any help appreciated

Regards
Bruce
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Count behaviour when using su -

Gentlemen, OK, I have an odd issue here perhaps someone can shed some light for me. When running a script as its user/owner the below pause/wait works just fine. When a developer has used su - to assume the username the pause does not happen... This is a HPUX11.00 machine, I have copied the blurb... (1 Reply)
Discussion started by: Eronysis
1 Replies

2. Programming

Different behaviour of this program

Hi, I have one doubt, in the below program, if I declare char *b inside the main(), the function compiles & runs properly. But at the same time, if I declare it globally it compiles but when we run it, it creates core dump (segmentation fault) both in C & C++. It is not being trapped by catch... (7 Replies)
Discussion started by: royalibrahim
7 Replies

3. Shell Programming and Scripting

A Strange Behaviour!!!

Can some-one give me a view to this : I have a directory in an unix server, having permissions r-xr-xr-x .This directory is basically a source directory. Now there is another directory basically the destination directory which has all the permissions. Note:I log in as not the owner,but user... (5 Replies)
Discussion started by: navojit dutta
5 Replies

4. Shell Programming and Scripting

Why this behaviour of IF condition?

I have a variable, defndata, which is a number (fetched from a file using awk). I want that if defndata is not initialized (that is its not found in the file using awk), then to execute a block of statements, otherwise execute another block. if then .... else ... fi Now this... (4 Replies)
Discussion started by: indianjassi
4 Replies

5. Shell Programming and Scripting

cp -R behaviour

i 've noticed the following difference between freebsd cp and gnu cp from the freebsd cp man page: -R ... If the source_file ends in a /, the contents of the directory are copied rather than the directory itself. ... on gnu cp from the man pagewhile on gnu cp manpage: ‘-r'... (2 Replies)
Discussion started by: aegis
2 Replies

6. UNIX for Advanced & Expert Users

eval behaviour

Hi, I have snippet like the following x="1" prompt1="hi" if I say eval echo \$prompt$x then it is giving o/p "hi" if I say `eval echo \$prompt$x` here it is giving 1 ! if I add one more escape character i.e. `eval echo \\$prompt$x` then it is giving "hi" Can you please... (3 Replies)
Discussion started by: shahnazurs
3 Replies

7. Ubuntu

Weird rm behaviour

I am little bit confused by the behaviour of rm in Ubuntu. It seems that as a regular user I can delete files owned by another user even when the permissions are set to 644. Here is an example: cjohnson@carbon:~/test$ sudo touch testfile cjohnson@carbon:~/test$ ls -al total 8 drwxr-xr-x... (2 Replies)
Discussion started by: ccj4467
2 Replies

8. Programming

Sort behaviour

I see strange results when sorting with -n options and I wander if somebody can explain it. Input file and two results: $ cat aa 14 -1 11 -1 0 -1 0 $ sort -u aa -1 0 (1 Reply)
Discussion started by: migurus
1 Replies

9. Red Hat

Ps command different behaviour

Hi Experts, ps command behavior in Redhat is such that it outputs all the output(of long lengths). In Unix the ps command output was limited to only 80 chars. In that if you pipe its output to another command hen the 80 chars restriction wouldn't be there. This 80 char limitation will only be... (14 Replies)
Discussion started by: Albert_Pinto7
14 Replies
pfm_cleanup(3ncs)														 pfm_cleanup(3ncs)

Name
       pfm_cleanup - establish a clean-up handler

Syntax
       #include <idl/c/base.h>
       #include <idl/c/pfm.h>

       status_$t pfm_$cleanup(cleanup_record)
       pfm_$cleanup_rec *cleanup_record;

Arguments
       cleanup_record	   A  record  of the context when is called.  A program should treat this as an opaque data structure and not try to alter
			   or copy its contents.  It is needed by and to restore the context of the calling process at the clean-up handler  entry
			   point.

Description
       The  routine  establishes a clean-up handler that is executed when a fault occurs.  A clean-up handler is a piece of code executed before a
       program exits when a signal is received by the process.	The clean-up handler begins where is called; the routine registers an entry  point
       with the system where program execution resumes when a fault occurs.  When a fault occurs, execution resumes after the most recent call to

       There  can  be  more  than one clean-up handler in a program.  Multiple clean-up handlers are executed consecutively on a last-in/first-out
       basis, starting with the most recently established handler and ending with the first clean-up  handler.	 The  system  provides	a  default
       clean-up  handler  established at program invocation.  The default clean-up handler is always called last, just before a program exits, and
       releases any system resources still held, before returning control to the process that invoked the program.

Diagnostics
       When called to establish a clean-up handler, returns the status pfm_$cleanup_set to indicate the clean-up handler was  successfully  estab-
       lished.	 When the clean-up handler is entered in response to a fault signal, effectively returns the value of the fault that triggered the
       handler.

       This section lists status codes for errors returned by this routine in

       pfm_$bad_rls_order  Attempted to release a clean-up handler out of order.

       pfm_$cleanup_not_found
			   There is no pending clean-up handler.

       pfm_$cleanup_set    A clean-up handler was established successfully.

       pfm_$cleanup_set_signaledl
			   Attempted to use pfm_$cleanup_set as a signal.

       pfm_$invalid_cleanup_rec
			   Passed an invalid clean-up record to a routine.

       pfm_$no_space	   Cannot allocate storage for a clean-up handler.  Clean-up handler code runs with asynchronous faults  inhibited.   When
			   returns  something  other  than  pfm_$cleanup_set indicating that a fault has occurred, there are four possible ways to
			   leave the clean-up code:

			   o	  The program can call to start the next clean-up handler with a different fault signal.

			   o	  The program can call to start the next clean-up handler with the same fault signal.

			   o	  The program can continue with the code following the clean-up handler.  It should  generally	call  to  reenable
				  asynchronous	faults.   Execution  continues from the end of the clean-up handler code; it does not resume where
				  the fault signal was received.

			   o	  The program can reestablish the handler by calling before proceeding.

Files
See Also
       intro(3ncs), pfm_signal(3ncs)

																 pfm_cleanup(3ncs)
All times are GMT -4. The time now is 01:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy