Bug 73625

Summary: processes don't launch correctly with console redirected
Product: [Retired] Red Hat Linux Reporter: jrjohns
Component: SysVinitAssignee: Bill Nottingham <notting>
Status: CLOSED DEFERRED QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-01-28 06:08:09 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Testcase script, Part 1 / 3 - /etc/rc.d/init.d/testcase
none
Testcase script, Part 2/3 - /usr/bin/testcase_1
none
Testcase script, Part 3/3 - /usr/bin/testcase_2 none

Description jrjohns 2002-09-06 23:45:06 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1b) Gecko/20020721

Description of problem:
I have have determined that the kernel's command-line parameter to redirect the
console will cause initscripts to function differently than expected when
executed under init.  When the console is redirected, backgrounded processes
will die when the launching parent script exits, rather than continuing to run
as they normally do.  If the processes are started manually, or if the console
is not redirected when init launches the scripts, the processes will continue to
run.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.Set the boot parameter of the kernel to include "console=tty2 CONSOLE=/dev/tty2"
2.Boot the computer with initscripts that background processes (such as Tomcat;
see also attached simple testcase)
3.
	

Actual Results:  The process will die.

Expected Results:  The process should continue running in the background

Additional info:

This flaw affects some popular tools, such as Apache Tomcat
(http://jakarta.apache.org/tomcat/index.html), when the console is redirected.

The test case is composed of three scripts which I will add as an attachment. 
There are four use cases for the test case, and 1 of the four tests fails.

1) On a computer with with normal kernel boot parameters, reboot the system.  
When the system returns to operation, /usr/bin/testcase_2 should be 
operating in a permanent loop until killed ("service testcase stop" will 
kill it).  You can confirm that the logfile (/tmp/testcase.log) shows normal 
startups and shutdowns.  This is expected behavior (PASS).

2) If started manually ("service testcase start"), /usr/bin/testcase_2 
should again operate in a permanent loop in the background until terminated.
This is expected behavior (PASS).

3) On a computer with the console redirected in the boot parameters 
(console=tty2 CONSOLE=/dev/tty2), when the system is rebooted, 
/usr/bin/testcase_2 will begin running and then will die.  The logfile will 
show that when testcase_1 exited, testcase_2 stopped updating the logfile.  
It doesn't even get a nice SIGTERM.  This is UNEXPECTED behavior (FAIL).

4) On a computer with the console redirected in the boot parameters 
(console=tty2 CONSOLE=/dev/tty2), start the service manually as in test 2.  
Once more, /usr/bin/testcase_2 will operate in a loop in the background 
until terminated.  This is expected behavior (PASS).

Comment 1 jrjohns 2002-09-06 23:47:39 UTC
Created attachment 75384 [details]
Testcase script, Part 1 / 3 - /etc/rc.d/init.d/testcase

Comment 2 jrjohns 2002-09-06 23:49:38 UTC
Created attachment 75385 [details]
Testcase script, Part 2/3 - /usr/bin/testcase_1

Comment 3 jrjohns 2002-09-06 23:50:27 UTC
Created attachment 75386 [details]
Testcase script, Part 3/3 - /usr/bin/testcase_2

Comment 4 Bill Nottingham 2005-01-28 06:08:09 UTC
Closing out unresolved bugs on older, end-of-lifed releases.
Apologies for any lack of response.

Please reopen if the problem persists on a current release.