Bug 219137 - kshd stops processes if these are in the background.
kshd stops processes if these are in the background.
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: krb5 (Show other bugs)
4.4
All Linux
medium Severity medium
: ---
: ---
Assigned To: Nalin Dahyabhai
Brian Brock
:
Depends On:
Blocks: 223669
  Show dependency treegraph
 
Reported: 2006-12-11 08:43 EST by Jose Plans
Modified: 2007-11-16 20:14 EST (History)
1 user (show)

See Also:
Fixed In Version: RHBA-2007-0238
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-05-07 18:09:56 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch allowing a task to be executed in the background in kshd. (1.18 KB, patch)
2006-12-11 08:43 EST, Jose Plans
no flags Details | Diff

  None (edit)
Description Jose Plans 2006-12-11 08:43:53 EST
Description of problem:
Using kshd and requesting it to execute tasks in the background always fails
even if it announces a success. If we trap SIGTERM, then it gets executed normally.

This comes from the upstream change :
--
2003-08-29  Ken Raeburn  <raeburn@mit.edu>

       * krshd.c (ignore_signals): Split out from cleanup().
       (doit): Call it when the shell process has completed, before
       calling syslog.
--

Which did a split in cleanup, performing all the syslog calls on
ignore_signals() to avoid deadlocks on syslog as shown in the upstream post in
krb5-bugs@. 

Now, the problem is that upstream forgot that this copy and paste on the split
was carrying a kill(-pid, SIGTERM); causing all the processes on this group to die.

Attached is a patch respecting their idea to split signal zone, allowing the
tasks to be executed in the background.

Version-Release number of selected component (if applicable):
krb5-server-1.3.4-33 and onwards.

How reproducible:
Always.

Steps to Reproduce:
1. Setup a KDC and xinetd enabling kshell.
2. Setup access (ktab / user account).
3. Supposidly we are using "jmp" run then :
   % /usr/kerberos/bin/rsh -n -l jmp -x kdc_host "sleep 60 < /dev/null
>/dev/null 2>/dev/null&"

   This task will be terminated.
   However, if you run it with :
       "trap \"\" TERM; sleep 60...........&"
   It will work.
  
Actual results:
Failure even if kshd reports success.

Expected results:
Task executed in the background.

Additional info:
Patch attached fixing this small bug (UPSTREAM too).
Please let me know if you require more informations.

     Jose
Comment 1 Jose Plans 2006-12-11 08:43:54 EST
Created attachment 143289 [details]
Patch allowing a task to be executed in the background in kshd.
Comment 17 Red Hat Bugzilla 2007-05-07 18:09:56 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2007-0238.html

Note You need to log in before you can comment on or make changes to this bug.