Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 691430 - In /etc/bashrc, set PROMPT_COMMAND only if not yet set
In /etc/bashrc, set PROMPT_COMMAND only if not yet set
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: setup (Show other bugs)
5.6
All Linux
medium Severity medium
: rc
: ---
Assigned To: Ondrej Vasik
qe-baseos-daemons
: EasyFix, Triaged
Depends On: 691425
Blocks: 554476 726492
  Show dependency treegraph
 
Reported: 2011-03-28 10:43 EDT by J.H.M. Dassen (Ray)
Modified: 2013-07-03 00:13 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 691425
Environment:
Last Closed: 2012-02-21 00:39:18 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0198 normal SHIPPED_LIVE setup bug fix and enhancement update 2012-02-20 09:54:05 EST

  None (edit)
Description J.H.M. Dassen (Ray) 2011-03-28 10:43:09 EDT
+++ This bug was initially created as a clone of Bug #691425 +++

2. What is the nature and description of the request?

Make a change to the default /etc/bashrc file so that if PROMPT_COMMAND has not
already been set, then to set it.

[ -z "${PROMPT_COMMAND}" ] && PROMPT_COMMAND=
'echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}";
echo -ne "\007"' 

3. Why does the customer need this? (List the business requirements here).

Customer wants the bash .history contents to be a more reliable audit of user
activities. Multiple articles found via google recommend setting env variable
PROMPT_COMMAND to contain 'history -a' so that multiple simultaneous shells
will share (and write immediately) the most recent commands executed to the
history file; refer to (among others):

http://linuxcommando.blogspot.com/2007/11/keeping-command-history-across-multiple.html 

The problem with these are:
1. The file /etc/sysconfig/bash-prompt-xterm is run by bash at each prompt as a
new executable (in a new shell) so doesn't work for setting the current shell's
history (or any other environment variables).
2. The files in /etc/profile.d/*.sh are read by /etc/profile before the
/etc/bashrc file is read by the default ~/.bashrc (taken from
/usr/skel/.bashrc). All changes to PROMPT_COMMAND are over-written by
/etc/bashrc. 

4. How would the customer like to achieve this? (List the functional
requirements here)

An update to bash so that /etc/bashrc only modifies the PROMPT_COMMAND if not
already set in the previous /etc/profile.d/*.sh or
/etc/sysconfig/bash_prompt_xterm files.  Make available in a minor update
release.

5. For each functional requirement listed in question 4, specify how Red Hat
and the customer can test to confirm the requirement is successfully
implemented.

Customer is able to test the latest Z-stream release for RHEL5 and RHEL6
package that has the /etc/bashrc changes and confirms that their history
setting is saved properly.

6. Is there already an existing RFE upstream or in Red Hat bugzilla?

no

7. How quickly does this need resolved? (desired target release)

RHEL5.8, RHEL6.2.

8. Does this request meet the RHEL Inclusion criteria (please review)

yes. 

9. List the affected packages.

setup

10. Would the customer be able to assist in testing this functionality if
implemented?

Yes
Comment 11 errata-xmlrpc 2012-02-21 00:39:18 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0198.html

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