From 7ede9c8cc18287f266f932e2b00c014f309d39f4 Mon Sep 17 00:00:00 2001 From: Denise Unterwurzacher Date: Fri, 8 Jan 2021 13:24:01 -0600 Subject: [PATCH 1/2] 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 --- roles/linux_common/files/java.conf | 3 +++ roles/linux_common/tasks/main.yml | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 roles/linux_common/files/java.conf diff --git a/roles/linux_common/files/java.conf b/roles/linux_common/files/java.conf new file mode 100644 index 0000000..d9a599f --- /dev/null +++ b/roles/linux_common/files/java.conf @@ -0,0 +1,3 @@ +# Exclude java-hooks +x /tmp/hsperfdata_* +x /tmp/.java_pid* \ No newline at end of file diff --git a/roles/linux_common/tasks/main.yml b/roles/linux_common/tasks/main.yml index 825fbd7..2fadb06 100644 --- a/roles/linux_common/tasks/main.yml +++ b/roles/linux_common/tasks/main.yml @@ -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 From 5c1b5f6877d936ff153539225a572332a01f3b13 Mon Sep 17 00:00:00 2001 From: Denise Unterwurzacher Date: Tue, 12 Jan 2021 18:32:20 -0600 Subject: [PATCH 2/2] ITPLAT-399 Updating Molecule (this was in an attempt to solve a testing issue that it did not solve, but it doesn't cause any problems) --- Pipfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Pipfile b/Pipfile index e78f929..55de93b 100644 --- a/Pipfile +++ b/Pipfile @@ -9,7 +9,7 @@ boto3 = "==1.9.242" botocore = "==1.12.242" [dev-packages] -molecule = "==2.20.2" +molecule = "==3.2.2" docker = "==4.1.0" six = "*" taskcat = "*"