Bug 811046

Summary: mc kill bash before this is able save it's history file
Product: [Fedora] Fedora Reporter: Frantisek Hanzlik <franta>
Component: mcAssignee: Jindrich Novy <jnovy>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 16CC: dvlasenk, fatkasuvayu, jnovy, johannbg, lpoetter, metherid, notting, pahan, pknirsch, plautrba, slavazanko, systemd-maint
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: 2012-09-11 16:20:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Frantisek Hanzlik 2012-04-10 00:31:25 UTC
Description of problem:
In some cases systemd perhaps kill bash process, so that isn't able save it's history file. This may occur randomly perhaps when machine is rebooted too (but i'm not able simulate it now, it's only speculation).
But below described sequence give me 100% results.

Version-Release number of selected component (if applicable):
systemd-37-17.fc16.i686
bash-4.2.24-1.fc16.i686
mc-4.8.1-2.fc16.i686
kernel-PAE-3.3.1-3.fc16.i686

Steps to Reproduce:
1. from console shell run mc (Midnight Commander)
2. with CTRL/O hide mc panels and in subshell type several commands
3. then retrieve mc panels pressing CTRL/O again, and with F10 leave mc
4. history file (~/.bash_history) should contain entered commands appended, but these not there.
  
Additional info:
what is slightly interesting, when before point 3) above I tell systemd do debugging (by "/bin/kill -s SIGRTMIN+22 1" command), then bash suffice to save its history. In /var/log/messages however are no systemd messages (with the exception of "systemd[1]: Setting log level to debug." line).
And when I then will send "/bin/kill -s SIGRTMIN+23 1" command), and then repeate steps 1-4 above, then in messages is only "systemd[1]: Setting log level to info." line, and in history file are omitted subshell commands.

Comment 1 Lennart Poettering 2012-04-11 13:24:09 UTC
systemd is not involved with subshells executed by mc.

Comment 2 Frantisek Hanzlik 2012-05-13 13:21:47 UTC
(In reply to comment #1)
> systemd is not involved with subshells executed by mc.

Are You sure? When mc (subshell's parent process) exited, then subshell's parent will be systemd (PPID==1), OK? Isn't then possible, that systemd kill him without subshell is able save it's history?

And what about above described findings, where in systemd normal state is history in all tests lost, and with systemd in debugging mode is history in all tests fine?

Comment 3 Frantisek Hanzlik 2012-05-13 15:38:50 UTC
Several minutes ago I was filled Bug 821254 (https://bugzilla.redhat.com/show_bug.cgi?id=821254), which is almost equivalent of this bug - only shell isn't started from MC, but "screen" process. All other symptoms are same, thus it seems for ma as it isn't MC problem, and bug should be assigned back to systemd.

Comment 4 Jindrich Novy 2012-09-11 16:20:41 UTC

*** This bug has been marked as a duplicate of bug 821254 ***