ITPLAT-399 Systemd cleans up files in /tmp older than 10 days. This removes the /tmp/.java_pid* file which is the socket created by the JVM that facilitates thread dumps. This file is never recreated once it's deleted, and the only way to recreate it and restore thread dump functionality is to restart the JVM. If using OpenJDK there is no -F option to force thread dumps which bypasses the socket. Once the file is deleted there is no way to take a thread dump on OpenJDK until a restart is performed. This commit excludes required java hooks including the pid file from systemd's cleanup. For more info: https://bugzilla.redhat.com/show_bug.cgi?id=1704608

This commit is contained in:
Denise Unterwurzacher
2021-01-08 13:24:01 -06:00
parent 8de2dbf226
commit 7ede9c8cc1
2 changed files with 19 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
# Exclude java-hooks
x /tmp/hsperfdata_*
x /tmp/.java_pid*

View File

@@ -26,3 +26,19 @@
uid: "{{ atl_product_user_uid }}"
group: "{{ atl_product_user }}"
comment: "Product runtime user"
- name: Stop systemd-cleanup deleting the jvm socket file
copy:
src: java.conf
dest: "/usr/lib/tmpfiles.d/java.conf"
owner: root
group: root
mode: "644"
register: systemd_config_changed
- name: Force systemd to reload daemon configuration
systemd:
daemon_reload: yes
when:
- systemd_config_changed is defined
- molecule_yml is not defined # molecule cannot run systemctl commands and notest doesn't work for handlers