Change Private Automation Hub pulpcore log location
Environment
- Ansible Automation Hub 2.x.
Issue
- Pulpcore logs in /var/log/messages.
- The amount of pulp logging is too much which hides the real OS system logs.
- Need to categorize pulpcore logs.
Resolution
1) Create /etc/rsyslog.d/pulp.conf rsyslog file with the following content:
if $programname == 'pulpcore-api' then {
*.* /var/log/pulp/pulpcore-api.log
*.* stop
} else if $programname startswith 'pulpcore-worker' then {
*.* /var/log/pulp/pulpcore-worker.log
*.* stop
} else if $programname == 'gunicorn' then {
*.* /var/log/pulp/pulp.log
*.* stop
} else if $programname == 'pulpcore-content' then {
*.* /var/log/pulp/pulpcore-content.log
*.* stop
}
2) Create pulp log directory:
# mkdir /var/log/pulp
3) Restart rsyslog service:
# systemctl restart rsyslog
Root Cause
- Pulpcore service does not provide logs categorizing on the meantime.
Diagnostic Steps
- Check logs on /var/log/messages
Mar 27 15:18:19 PAH-FQDN gunicorn[511269]: [2023-03-27 15:18:19 +0200] [511269] [INFO] Shutting down: Master
Mar 27 15:23:02 PAH-FQDN gunicorn[512009]: [2023-03-27 15:23:02 +0200] [512009] [INFO] Starting gunicorn 20.1.0
Mar 27 15:23:03 PAH-FQDN gunicorn[512009]: [2023-03-27 15:23:02 +0200] [512009] [INFO] Listening at: unix:/var/run/pulpcore-api/pulpcore-api.sock (512009)
Mar 27 15:23:03 PAH-FQDN gunicorn[512009]: [2023-03-27 15:23:02 +0200] [512009] [INFO] Using worker: sync
Mar 27 15:23:03 PAH-FQDN gunicorn[512011]: [2023-03-27 15:23:02 +0200] [512011] [INFO] Booting worker with pid: 512011
Mar 27 15:23:08 PAH-FQDN gunicorn[512016]: [2023-03-27 15:23:08 +0200] [512016] [INFO] Starting gunicorn 20.1.0
Mar 27 15:23:08 PAH-FQDN gunicorn[512016]: [2023-03-27 15:23:08 +0200] [512016] [INFO] Listening at: unix:/var/run/pulpcore-content/pulpcore-content.sock (512016)
Mar 27 15:23:08 PAH-FQDN gunicorn[512016]: [2023-03-27 15:23:08 +0200] [512016] [INFO] Using worker: aiohttp.GunicornWebWorker
Mar 27 15:23:08 PAH-FQDN gunicorn[512026]: [2023-03-27 15:23:08 +0200] [512026] [INFO] Booting worker with pid: 512026
Mar 27 15:23:10 PAH-FQDN gunicorn[512044]: [2023-03-27 15:23:10 +0200] [512044] [INFO] Booting worker with pid: 512044
Mar 27 15:24:13 PAH-FQDN gunicorn[512016]: [2023-03-27 15:24:12 +0200] [512016] [INFO] Handling signal: term
Mar 27 15:24:13 PAH-FQDN gunicorn[512009]: [2023-03-27 15:24:12 +0200] [512009] [INFO] Handling signal: term
Mar 27 15:24:43 PAH-FQDN gunicorn[512015]: [2023-03-27 13:24:43 +0000] [512015] [INFO] Worker exiting (pid: 512015)
Mar 27 15:24:43 PAH-FQDN gunicorn[512016]: [2023-03-27 15:24:43 +0200] [512016] [INFO] Shutting down: Master
Mar 27 15:24:43 PAH-FQDN gunicorn[512016]: [2023-03-27 15:24:43 +0200] [512016] [WARNING] Worker with pid 512026 was terminated due to signal 9
Mar 27 15:24:15 PAH-FQDN pulpcore-worker[512036]: pulp [None]: pulpcore.tasking.pulpcore_worker:INFO: Worker 512036@ PAH-FQDN was requested to shut down.
Mar 27 15:24:15 PAH-FQDN pulpcore-worker[512040]: pulp [None]: pulpcore.tasking.pulpcore_worker:INFO: Worker 512040@ PAH-FQDN was requested to shut down.
Mar 27 15:24:19 PAH-FQDN pulpcore-worker[512036]: pulp [None]: pulpcore.tasking.pulpcore_worker:INFO: Worker 512036@ PAH-FQDN was shut down.
Mar 27 15:24:19 PAH-FQDN pulpcore-worker[512040]: pulp [None]: pulpcore.tasking.pulpcore_worker:INFO: Worker 512040@ PAH-FQDN was shut down.
Mar 27 15:25:59 PAH-FQDN pulpcore-worker[512195]: pulp [None]: pulpcore.tasking.entrypoint:WARNING: Attempting to start a resource-manager with the distributed tasking system
Mar 27 15:26:01 PAH-FQDN pulpcore-worker[512205]: pulp [None]: pulpcore.tasking.entrypoint:INFO: Starting distributed type worker
Mar 27 15:26:02 PAH-FQDN pulpcore-worker[512205]: pulp [None]: pulpcore.tasking.worker_watcher:INFO: New worker '512205@ PAH-FQDN' discovered
Mar 27 15:26:11 PAH-FQDN pulpcore-worker[512202]: pulp [None]: pulpcore.tasking.entrypoint:INFO: Starting distributed type worker
Mar 27 15:26:11 PAH-FQDN pulpcore-worker[512202]: pulp [None]: pulpcore.tasking.worker_watcher:INFO: New worker '512202@ PAH-FQDN' discovered
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments