Bug 1652312

Summary: When reboot or poweroff server, bash history some time is not saved
Product: [Fedora] Fedora Reporter: Dario Lesca <d.lesca>
Component: systemdAssignee: systemd-maint
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 29CC: lnykryn, mattdm, msekleta, ssahani, s, systemd-maint, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-11-27 20:25:15 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 Dario Lesca 2018-11-21 21:14:37 UTC
Description of problem:

When reboot or poweroff Fedora Server 29 (minimal install),
bash history some time is not saved.

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

[root@s-addc ~]# rpm -q systemd bash
systemd-239-6.git9f3aed1.fc29.x86_64
bash-4.4.23-5.fc29.x86_64

How reproducible:

Start server, connect to it via ssh, then Reboot or poweroff via line command 

At the next login, some time the last bash commands are not saved into .bash_history

Steps to Reproduce:
1. connect to server via ssh
2. type some cmd
3. do reboot or poweroff
4. access to bash and verify if last command is saved.

Actual results:
Sometime last command are not save if reboot or shutdown the server.

Expected results:
Always last command must save when reboot or shutdown the server.

Additional info:

If I do exit the history is always saved

It seems (IMHO) that the shutdown process, started from reboot or poweroff, send a SIGKILL, or destroyed in some other mode, all active process, including the section of ssh which supports bash (sshd: root@pts/0), without give to it the time to save the history.
  
If someone have some suggest to investigate this random issue, let me know.

Thanks

Dario

Comment 1 Matthew Miller 2018-11-27 20:25:15 UTC

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