bash: shell commands are no longer logged to /var/log/bash.log

Bug #1917864 reported by Zhixiong Chi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
High
Zhixiong Chi

Bug Description

Brief Description
-----------------
Shell commands are no longer written to /var/log/bash.log in recent master branch.
And when the os is started, there is no the /var/log/bash.log file.
Only when set the shopt variable, the commands will be logged into the /var/log/bash.log file.

controller-0:~$ sudo tail -l /var/log/bash.log
Password:
tail: cannot open ‘/var/log/bash.log’ for reading: No such file or directory
controller-0:~$ shopt -p |grep syslog_history
shopt -u syslog_history
controller-0:~$ shopt -s syslog_history
controller-0:~$ shopt -p |grep syslog_history
shopt -s syslog_history
controller-0:~$ shopt -u syslog_history
controller-0:~$ sudo tail -l /var/log/bash.log
2021-03-05T06:39:52.000 controller-0 -sh: info HISTORY: PID=176919 UID=42425 shopt -p |grep syslog_history

Severity
--------
Major

Steps to Reproduce
------------------
Install controller-0 node
controller-0:~$ sudo tail -l /var/log/bash.log
Password:
tail: cannot open ‘/var/log/bash.log’ for reading: No such file or directory
controller-0:~$ shopt -p |grep syslog_history
shopt -u syslog_history
controller-0:~$ shopt -s syslog_history
controller-0:~$ shopt -p |grep syslog_history
shopt -s syslog_history
controller-0:~$ shopt -u syslog_history
controller-0:~$ sudo tail -l /var/log/bash.log
2021-03-05T06:39:52.000 controller-0 -sh: info HISTORY: PID=176919 UID=42425 shopt -p |grep syslog_history

Expected Behavior
------------------
When we login the controller-0 node, we can see the history of the shell commands.

Actual Behavior
----------------
The log file is not here.

Reproducibility
---------------
100% Reproducible on all nodes.

System Configuration
--------------------
Every node system.

Branch/Pull Time/Commit
-----------------------
stx master: Feb 22, 2021

Last Pass
---------
stx master: Jan 22,2021

Timestamp/Logs
--------------
Issue is reproducible

Test Activity
-------------
Manually scan the log file

Workaround
----------
Set the shopt variable for syslog_history.

Changed in starlingx:
assignee: nobody → Zhixiong Chi (zhixiongchi)
status: New → In Progress
Revision history for this message
Ghada Khalil (gkhalil) wrote :

stx.5.0 / high - issue introduced by a recent upversion of the bash package

Changed in starlingx:
importance: Undecided → High
tags: added: stx.5.0 stx.distro.other
Revision history for this message
Zhixiong Chi (zhixiongchi) wrote :
Changed in starlingx:
status: In Progress → Fix Committed
Changed in starlingx:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to compile (f/centos8)

Fix proposed to branch: f/centos8
Review: https://review.opendev.org/c/starlingx/compile/+/793743

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to compile (f/centos8)
Download full text (4.1 KiB)

Reviewed: https://review.opendev.org/c/starlingx/compile/+/793743
Committed: https://opendev.org/starlingx/compile/commit/30556b9bd01d82af5f6b67ee80afeba5521c8354
Submitter: "Zuul (22348)"
Branch: f/centos8

commit 5f0f710f66852568b3a27bffafaedf0247227984
Author: Chris Friesen <email address hidden>
Date: Wed Jul 15 19:46:08 2020 -0400

    fix net/http caching of broken persistent connections

    The net/http transport code is currently broken, it keeps broken
    persistent connections in the cache if a write error happens during
    h2 handshake.

    This is documented in the upstream bug at:
    https://github.com/golang/go/issues/40213

    The problem occurs because in the "go" compiler the http2 code is
    imported into http as a bundle, with an additional "http2" prefix
    applied. This messes up the erringRoundTripper handling because
    the name doesn't match.

    The solution is to have the "go" compiler look for an interface
    instead, so we add a new dummy function that doesn't actually do
    anything and then the "go" compiler can check whether the specified
    RoundTripper implements the dummy function.

    This is slightly different from the proposed upstream fixes for the
    above upstream bug, it more closely follows how the equivalent
    problem was solved by IsHTTP2NoCachedConnError().

    Change-Id: Ia6e91acb15ff4fe996c8ea9b8a1032cede6c4aab
    Partial-Bug: 1887438
    Signed-off-by: Chris Friesen <email address hidden>

commit 49e4df5e538b239d9267baa28b100fa0edfbec69
Author: Zhixiong Chi <email address hidden>
Date: Fri Mar 5 04:05:50 2021 -0500

    bash: enable to log the shell command

    After merging the upversion commit
     https://review.opendev.org/c/starlingx/compile/+/771784,
    the new version add a condition check "syslog_history" variable to
    enable/disable the syslog of bash command.
    If the syslog_history shopt variable is unset as default, the shell
    commands won't be logged.

    Now we always enable it, since the commands run by every user in a
    login shell need to be logged to /var/log/bash.log. This is very
    important as an aid in troubleshooting and debugging issues.

    Closes-Bug: #1917864

    Change-Id: I4aa2f49a0ea4c54a0e836b8ccb33bcc173653252
    Signed-off-by: Zhixiong Chi <email address hidden>

commit 95c560dffeeeeab6a05766f327a05c06b9b3d65d
Author: Li Zhou <email address hidden>
Date: Wed Jan 27 00:50:01 2021 -0500

    python: fix CVE-2019-9636 CVE-2019-10160 CVE-2019-9948 CVE-2019-16056 in srpm build

    Upgrade python to python-2.7.5-89 for fixing above CVEs.

    This commit need work together with the commit
    <python: fix CVE-2019-9636 CVE-2019-10160 CVE-2019-9948 CVE-2019-16056
    in rpm list> for repository starlingx/tools.

    Depends-On: https://review.opendev.org/c/starlingx/tools/+/772627

    Story: 2008532
    Task: 41665
    Signed-off-by: Li Zhou <email address hidden>
    Change-Id: Iead83a4f8e617bed8182020d21d582273ae1e67e

commit 9af8123c7a2b8277408b47efc9128b9dfdcf5763
Author: Zhixiong Chi <email address hidden>
Date: Thu Jan 21 05:...

Read more...

tags: added: in-f-centos8
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.