Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1929556

Summary: Job for pmlogger.service failed because the service did not take the steps required by its unit configuration.
Product: Red Hat Enterprise Linux 8 Reporter: Martin Pitt <mpitt>
Component: pcpAssignee: Nathan Scott <nathans>
Status: CLOSED DUPLICATE QA Contact: Jan Kurik <jkurik>
Severity: high Docs Contact: Apurva Bhide <abhide>
Priority: unspecified    
Version: 8.4CC: agerstmayr, jkurik, mgoodwin, nathans, patrickm, yuokada
Target Milestone: rcKeywords: Regression, Reopened, Triaged
Target Release: 8.4Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-02-19 08:52:46 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 Martin Pitt 2021-02-17 06:41:06 UTC
Description of problem: pcp is broken in latest RHEL 8.4 nightlies:

# systemctl start pmlogger
Job for pmlogger.service failed because the service did not take the steps required by its unit configuration.
See "systemctl status pmlogger.service" and "journalctl -xe" for details.

● pmlogger.service - Performance Metrics Archive Logger
   Loaded: loaded (/usr/lib/systemd/system/pmlogger.service; disabled; vendor preset: disabled)
   Active: activating (start) since Wed 2021-02-17 01:39:22 EST; 4s ago
     Docs: man:pmlogger(1)
 Main PID: 11309 (pmlogger)
    Tasks: 4 (limit: 5520)
   Memory: 3.6M
   CGroup: /system.slice/pmlogger.service
           ├─11309 /bin/sh /usr/libexec/pcp/lib/pmlogger start-systemd
           ├─11369 /bin/sh /usr/libexec/pcp/bin/pmlogger_check --quick -V
           ├─11476 /bin/sh /usr/libexec/pcp/bin/pmlogger_check --quick -V
           └─11692 pmsleep 0.1

Feb 17 01:39:22 m1.cockpit.lan systemd[1]: pmlogger.service: Service RestartSec=100ms expired, scheduling restart.
Feb 17 01:39:22 m1.cockpit.lan systemd[1]: pmlogger.service: Scheduled restart job, restart counter is at 21.
Feb 17 01:39:22 m1.cockpit.lan systemd[1]: Stopped Performance Metrics Archive Logger.
Feb 17 01:39:22 m1.cockpit.lan systemd[1]: Starting Performance Metrics Archive Logger...
Feb 17 01:39:22 m1.cockpit.lan pmlogger[11309]: /usr/libexec/pcp/lib/pmlogger: Warning: Performance Co-Pilot archive logger(s) not permanently enabled.
Feb 17 01:39:22 m1.cockpit.lan pmlogger[11309]:     To enable pmlogger, run the following as root:
Feb 17 01:39:22 m1.cockpit.lan pmlogger[11309]:     # /usr/bin/systemctl enable pmlogger.service



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

pcp-5.2.5-3.el8.x86_64

How reproducible: Always

Additional info:

The previous version pcp-5.2.3-1.el8.x86_64 worked fine:

# systemctl start pmlogger
# systemctl status pmlogger|cat
● pmlogger.service - Performance Metrics Archive Logger
   Loaded: loaded (/usr/lib/systemd/system/pmlogger.service; disabled; vendor preset: disabled)
   Active: active (running) since Wed 2021-02-17 01:40:23 EST; 4s ago
     Docs: man:pmlogger(1)
 Main PID: 1741 (pmlogger)
    Tasks: 1 (limit: 5520)
   Memory: 4.0M
   CGroup: /system.slice/pmlogger.service
           └─1741 /usr/libexec/pcp/bin/pmlogger -N -P -r -T24h10m -c config.default -v 100mb -m pmlogger_check %Y%m%d.%H.%M

Feb 17 01:40:21 m1.cockpit.lan systemd[1]: Starting Performance Metrics Archive Logger...
Feb 17 01:40:22 m1.cockpit.lan pmlogger[1475]: /usr/libexec/pcp/lib/pmlogger: Warning: Performance Co-Pilot archive logger(s) not permanently enabled.
Feb 17 01:40:22 m1.cockpit.lan pmlogger[1475]:     To enable pmlogger, run the following as root:
Feb 17 01:40:22 m1.cockpit.lan pmlogger[1475]:     # /usr/bin/systemctl enable pmlogger.service
Feb 17 01:40:23 m1.cockpit.lan systemd[1]: Started Performance Metrics Archive Logger.

Comment 5 Martin Pitt 2021-02-17 18:24:04 UTC
Right after boot, pmlogger.service is not running, and /var/log/pcp/pmlogger/ just contains an empty .NeedRewrite stamp file.

Unfortunately pcp doesn't really use systemd, so drilling down into the startup scripts:

# sh -x /usr/libexec/pcp/lib/pmlogger start-systemd
[...lots of relatively uninteresting startup/variable init noise ...]
+ pmlogger_check --quick -V
# sits here for some 10s
 bgstatus=0
+ '[' -s /var/tmp/pmlogger_rc_start.2TxNhEGJu/pmcheck ']'
+ return 0
+ estatus=true
+ '[' start-systemd = start-systemd ']'
+ true
+ _RC_STATUS
+ _rc_status=0
+ '[' '' = -v ']'
+ return 0
+ status=0
+ false
+ rm -rf /var/tmp/pmlogger_rc.sMfd2t9AE /var/tmp/pmlogger_rc_start.2TxNhEGJu
+ exit 0


After that, there is *no* pcp/pm* related process running, so despite claiming success (exit 0), it did not really start something. As systemd never gets a notify, it eventually declares the unit failed as there is no process left.

I now have a new log file:

# cat /var/log/pcp/pmlogger/pmlogger_check.log
pmlogger_check [/etc/pcp/pmlogger/control.d/local:26]
Warning: creating directory (/var/log/pcp/pmlogger/m1.cockpit.lan) for PCP archive files
Wed Feb 17 13:17:48 EST 2021
Arrgghhh ... pmcd at localhost failed to start after 5 seconds
=== failing pmprobes ===
pmprobe: Cannot connect to PMCD on host "local:": Connection refused

It also created /var/log/pcp/pmlogger/m1.cockpit.lan/ but that is empty.

pmcd.service is indeed not running. So trying this again:

systemctl start pmcd  # succeeds
systemctl start pmlogger

This now succees as well.

So apparently the change is that pmlogger now started to depend on pmcd.service (it was not before), but does not declare that dependency with Requires/After=pmcd.service ?

Comment 6 Andreas Gerstmayr 2021-02-17 18:48:55 UTC
(In reply to Martin Pitt from comment #5)
> So apparently the change is that pmlogger now started to depend on
> pmcd.service (it was not before)

Are you using the default pmlogger config, which includes a "primary logger" which connects to a local pmcd (configured in /etc/pcp/pmlogger/control.d/local)?
If so, then you need to start pmcd before pmlogger, because pmlogger is configured to connect and log metrics from the local pmcd.

> but does not declare that dependency with
> Requires/After=pmcd.service ?

pmlogger in general does not depend on a local pmcd, that's why we've removed the Require= systemd dependency (it used to be there before).
For example, if you want to log remote pmcds only, there is no need to have a local pmcd daemon running. See upstream discussion [1] and the PR [2] for more context.

fwiw, we still have a After=pmcd.service dependency in pmlogger.service, to make sure that pmlogger starts after pmcd. But there is no Require= anymore, because it depends on the pmlogger configuration if a local pmcd should be running or not.


[1] https://github.com/performancecopilot/pcp/issues/1200
[2] https://github.com/performancecopilot/pcp/pull/1206

Comment 7 Martin Pitt 2021-02-18 05:23:45 UTC
(In reply to Andreas Gerstmayr from comment #6)
> Are you using the default pmlogger config, which includes a "primary logger"
> which connects to a local pmcd (configured in
> /etc/pcp/pmlogger/control.d/local)?

This is a bog standard "dnf install pcp on a cloud image" install, I didn't touch any pcp config. Here it is:

# cat /etc/pcp/pmlogger/control.d/local 
#
# PCP archive logging configuration/control
#
# see ../control for a description of the format
#

# === VARIABLE ASSIGNMENTS ===
#
# DO NOT REMOVE OR EDIT THE FOLLOWING LINE
$version=1.1

# Uncomment one of the lines below to enable/disable compression behaviour
# that is different to the pmlogger_daily default.
# Value is days before compressing archives, 0 is immediate compression,
# "never" or "forever" suppresses compression.
#
#$PCP_COMPRESSAFTER=0
#$PCP_COMPRESSAFTER=3
#$PCP_COMPRESSAFTER=never

# === LOGGER CONTROL SPECIFICATIONS ===
#
#Host		P?  S?	directory			args

# local primary logger
LOCALHOSTNAME	y   n	PCP_ARCHIVE_DIR/LOCALHOSTNAME	-r -T24h10m -c config.default -v 100Mb

That's exactly the file that is shipped in pcp.rpm.

> If so, then you need to start pmcd before pmlogger, because pmlogger is
> configured to connect and log metrics from the local pmcd.

If "you" is "me", then no -- that is just plain a regression. With my user's hat on, I don't really care what "pmcd" is, I just want pcp to collect local metrics. I started/enabled pmlogger.service, upgrade to 8.4, and it starts to  fail.

If "you" means "pcp's startup scripts", then yes, that would do it.

> pmlogger in general does not depend on a local pmcd, that's why we've
> removed the Require= systemd dependency (it used to be there before).

That does seem more efficient indeed. So what I'd suggest is:

 * Replace the static Requires=pmcd with a dynamic check in /usr/libexec/pcp/lib/pmlogger that starts pmcd.service if necessary (with systemctl --no-block, as you are in the middle of a systemd transaction)
 * Reconsider if the default config should really require pmcd if you want it off by default.

Thanks for clarifying!

Comment 8 Nathan Scott 2021-02-18 23:45:07 UTC
After chatting with Andreas today, we're going to back out the (one-line) unit file change and rethink our options in the 8.5 timeframe.

Comment 9 Nathan Scott 2021-02-19 00:23:35 UTC
These two BZs are one and the same problem, viewed from two different angles (via pmie and pmlogger - its one patch and one git-revert to fix both BZs.

Since this will now need to go through the exception review process for 8.4 I'm streamlining this into one BZ to save everyone time.

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