From e8d916756d439cf63eed52f347a2a547fc5124cb Mon Sep 17 00:00:00 2001 From: Andy Ning Date: Wed, 17 Jun 2020 10:40:23 -0400 Subject: [PATCH] Set up /var/run/dcmanager as dcmanager's default temp files location dcmanager call the k8s python client to perform a number of operations. The k8s python client creates temp files under /tmp and continues use these tmp files for the life-cycle of the processes. However systemd-tmpfiles-clean.service will run every day to clean up files in /tmp dir that are older than 10 days. If the k8s client code is not triggered for more than 10 days (thus its temp files are not accessed for more than 10 days), these temp files will be removed as part of the cleanup. Certain dcmanager operations then starts to fail with an error that the tmp file is no longer there. This is a known issue of kubernetes python client: https://github.com/kubernetes-client/python/issues/765 The commit fixes this issue by setting TMPDIR to /var/run/dcmanager when sm starts dcmanager-manager. Change-Id: Ib147c2ab26e303032e18da51a506e3768bc471e0 Closes-Bug: 1883599 Signed-off-by: Andy Ning --- distributedcloud/ocf/dcmanager-manager | 2 ++ 1 file changed, 2 insertions(+) diff --git a/distributedcloud/ocf/dcmanager-manager b/distributedcloud/ocf/dcmanager-manager index 835fb26c0..7823286ce 100644 --- a/distributedcloud/ocf/dcmanager-manager +++ b/distributedcloud/ocf/dcmanager-manager @@ -38,6 +38,8 @@ OCF_RESKEY_pid_default="$HA_RSCTMP/$OCF_RESOURCE_INSTANCE.pid" : ${OCF_RESKEY_user=${OCF_RESKEY_user_default}} : ${OCF_RESKEY_pid=${OCF_RESKEY_pid_default}} +export TMPDIR=/var/run/dcmanager + ####################################################################### usage() {