tomcat: check if user exist before checking its Tomcat instance
All checks were successful
Ansible Lint |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
gitea/ansible-roles/pipeline/head This commit looks good

This commit is contained in:
Will 2025-01-03 15:50:08 +01:00 committed by Brice Waegeneire
parent 39a58c3d53
commit eb54157271
2 changed files with 5 additions and 0 deletions

View file

@ -17,6 +17,8 @@ The **patch** part is incremented if multiple releases happen the same month
### Fixed
* tomcat: check if user exist before checking its Tomcat instance.
### Removed
### Security

View file

@ -13,6 +13,9 @@ output=""
instances=$(ls "${TOMCAT_ROOT}")
for instance in ${instances}; do
if ! id -u "${instance}" 2> /dev/null; then
continue
fi
port=$(id -u "${instance}")
if [ -h "${TOMCAT_ROOT}/${instance}/.config/systemd/user/default.target.wants/tomcat.service" ]; then
/usr/lib/nagios/plugins/check_tcp -p "${port}" >/dev/null 2>&1