From bac90e73ddd9b76eaebebf1876d1542fa99a799c Mon Sep 17 00:00:00 2001 From: Mykola Malkov Date: Wed, 29 Jul 2020 13:51:11 +0300 Subject: [PATCH] TT#84555 Check debug and messages files as optional These files are created by rsyslog with default conf file. Usually it's done after the deployment.sh's reboot. But when NGCP is installed via installer package on existing debian system there is no reboot between installation of rsyslog (as part of NGCP) and ngcp-initial-configuration which modifies /etc/rsyslog.conf. So in this case these files are not created. So check the ownership and permission of these files only if they exist. Change-Id: I33be13a4e78baee3926de8bd0135d655b89d5bb6 --- templates/135_filesys-logfiles.yaml.tt2 | 62 +++++++++++++++++++------ 1 file changed, 48 insertions(+), 14 deletions(-) diff --git a/templates/135_filesys-logfiles.yaml.tt2 b/templates/135_filesys-logfiles.yaml.tt2 index 6216b0f..bc14f99 100644 --- a/templates/135_filesys-logfiles.yaml.tt2 +++ b/templates/135_filesys-logfiles.yaml.tt2 @@ -42,20 +42,6 @@ file: group: adm filetype: file - /var/log/debug: - exists: true - mode: "0640" - owner: root - group: adm - filetype: file - - /var/log/messages: - exists: true - mode: "0640" - owner: root - group: adm - filetype: file - /var/log/ngcp/api.log: exists: @@ -159,3 +145,51 @@ command: - '!/./' stderr: - '!/./' + +# optionally existing files + + # /var/log/debug + + "find /var/log/ -type f -name debug ! -user root": + exit-status: 0 + stdout: + - '!/./' + stderr: + - '!/./' + + "find /var/log/ -type f -name debug ! -group adm": + exit-status: 0 + stdout: + - '!/./' + stderr: + - '!/./' + + "find /var/log/ -type f -name debug ! -perm 640": + exit-status: 0 + stdout: + - '!/./' + stderr: + - '!/./' + + # /var/log/messages + + "find /var/log/ -type f -name messages ! -user root": + exit-status: 0 + stdout: + - '!/./' + stderr: + - '!/./' + + "find /var/log/ -type f -name messages ! -group adm": + exit-status: 0 + stdout: + - '!/./' + stderr: + - '!/./' + + "find /var/log/ -type f -name messages ! -perm 640": + exit-status: 0 + stdout: + - '!/./' + stderr: + - '!/./'