Bug 1833648

Summary: pmlogger service doesn't start or prints weird message
Product: Red Hat Enterprise Linux 8 Reporter: Renaud Métrich <rmetrich>
Component: pcpAssignee: Mark Goodwin <mgoodwin>
Status: CLOSED DUPLICATE QA Contact: Jan Kurik <jkurik>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.2CC: agerstmayr, jkurik, mgoodwin, nathans, patrickm
Target Milestone: rcKeywords: Triaged
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-05-11 12:12:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Renaud Métrich 2020-05-09 11:32:31 UTC
Description of problem:

This is a follow-up of BZ 1833647.
I believe there are other changes to be perform in pmlogger service startup sequence:

1. Upon startup, systemd complains with this message

-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
systemd[1]: pmlogger.service: Supervising process 6741 which is not our child. We'll most likely not notice when it exits.
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

This is due to /usr/share/pcp/lib/pmlogger forking the main pid but not detaching immediately.
Once initialization is complete, the main pid will have PID 1 as parent, so systemd will effectively monitor the process appropriately.

2. "pmlogger.service" has no "Required" dependency on "pmcd.service", causing AVCs and weird messages to be logged when "pmcd.service" is not enabled

-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
systemd[1]: Starting Performance Metrics Archive Logger...
pmlogger[1725]: /usr/share/pcp/lib/pmlogger: Warning: Performance Co-Pilot archive logger(s) not permanently enabled.
pmlogger[1725]:     To enable pmlogger, run the following as root:
pmlogger[1725]:     # /usr/bin/systemctl enable pmlogger.service
pmlogger[1725]: Starting pmlogger ...
systemd[1]: pmlogger.service: Can't open PID file /run/pcp/pmlogger.pid (yet?) after start: No such file or directory
root[2109]: pmlogger_check failed - see /var/log/pcp/pmlogger/pmlogger_check.log
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Additionally it waits for 120 seconds to report failure.
Looking at the pmlogger.service unit file, I see weird After/BindsTo dependencies on timers and no Requires on pmcd.service at all:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
After=pmlogger_check.timer pmlogger_daily.timer pmlogger_daily-poll.timer
BindsTo=pmlogger_check.timer pmlogger_daily.timer pmlogger_daily-poll.timer
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

I would expect this instead:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
Requires=pmcd.service
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

This would trigger automatic startup of "pmcd.service". Additionally having a BindsTo or After dependency on timers looks weird to me.


Version-Release number of selected component (if applicable):

pcp-5.0.2-5.el8.x86_64


How reproducible:

Always

Comment 1 Jan Kurik 2020-05-09 16:05:09 UTC
@Renaud: thanks for your report.
As I am unable to reproduce the AVC issue, can you please be more specific about it ?
Output of "ausearch -m AVC" or "audit2allow -a" would be helpful.

Comment 4 Renaud Métrich 2020-05-11 12:12:40 UTC
Indeed it's a DUP of BZ#1806428

*** This bug has been marked as a duplicate of bug 1806428 ***