Systemd PIDFile needs to be in /run not in /var/run

Otherwise (in CentOS 9) we get the following warning:
  systemd[1]: /etc/systemd/system/tripleo_cinder_api.service:14: PIDFile=references a path below legacy directory /var/run/, updating
  /var/run/cinder_api.pid → /run/cinder_api.pid; please update the unit file accordingly.

Tested on CentOS 9 Stream env and we no longer get the warnings and the
services are still up and working correctly:
[root@undercloud-0 ~]# journalctl |grep PIDFile |grep tripleo
[root@undercloud-0 ~]#

Closes-Bug: #1942297

Change-Id: Ifca971e14abb184c4b7b8a0d004e8c2fbd0ecb68
This commit is contained in:
Michele Baldessari 2021-09-01 08:18:07 +02:00
parent c416ff04cb
commit 60875cfcd4
2 changed files with 2 additions and 2 deletions

View File

@ -287,7 +287,7 @@ class TripleoContainerManage:
'managed_by': 'tripleo_ansible', 'managed_by': 'tripleo_ansible',
'config_data': config 'config_data': config
}, },
'conmon_pidfile': f"/var/run/{name}.pid", 'conmon_pidfile': f"/run/{name}.pid",
'debug': self.debug, 'debug': self.debug,
'log_driver': 'k8s-file', 'log_driver': 'k8s-file',
'log_opt': {"path": f"{self.log_base_path}/{name}.log"}, 'log_opt': {"path": f"{self.log_base_path}/{name}.log"},

View File

@ -20,7 +20,7 @@ ExecStopPost=/usr/bin/podman stop -t {{ lookup('dict', container_data_unit).valu
SuccessExitStatus=137 142 143 SuccessExitStatus=137 142 143
KillMode=none KillMode=none
Type=forking Type=forking
PIDFile=/var/run/{{ lookup('dict', container_data_unit).key }}.pid PIDFile=/run/{{ lookup('dict', container_data_unit).key }}.pid
{% if lookup('dict', container_data_unit).value.systemd_exec_flags is defined %} {% if lookup('dict', container_data_unit).value.systemd_exec_flags is defined %}
{% for s_flag, s_value in lookup('dict', container_data_unit).value.systemd_exec_flags.items() %} {% for s_flag, s_value in lookup('dict', container_data_unit).value.systemd_exec_flags.items() %}
{{ s_flag }}={{ s_value }} {{ s_flag }}={{ s_value }}