Skip to content

PIDFile , StandardOutput, StandardError and mcollective.service

Steve Traylen requested to merge pid into master

Consolidate all the existing mcollective drop files back into the main mcollective unit file.

Also fix some warnings on CC9 that cannot be fixed with drop files, see https://gitlab.cern.ch/ai/it-puppet-module-cernmco/-/merge_requests/73 for failed attempt at fixing with drop files.

Obsolete dropfile /etc/systemd/system/mcollective.service.d/simple.conf

This was added in the past for https://its.cern.ch/jira/browse/AI-5600

contains:

[Service]
Type=simple
KillMode=control-group
ExecStart=
ExecStart=/opt/puppetlabs/puppet/bin/mcollectived --config=/etc/puppetlabs/mcollective/server.cfg --no-daemonizev

push this into the main mcollective unit file.

Use ascii and avoid use of fancy unicode and colours in some commands.

Dropfile /etc/systemd/system/mcollective.service.d/ascii.conf contains:

[Service]
Environment=LANG=C SYSTEMD_COLORS=false

implement this in main mcollective unit file.

CentOS 9 on daemon-reload shows

Apr 13 10:41:46 lxplus9s00.cern.ch systemd[1]:
/usr/lib/systemd/system/mcollective.service:17: Standard output type
syslog is obsolete, automatically updating to journal. Please update
your unit file, and consider removing the setting altogether.
Apr 13 10:41:46 lxplus9s00.cern.ch systemd[1]:
/usr/lib/systemd/system/mcollective.service:18: Standard output type
syslog is obsolete, automatically updating to journal. Please update
your unit file, and consider removing the setting altogether.
Apr 13 10:41:46 lxplus9s00.cern.ch systemd[1]:
/usr/lib/systemd/system/mcollective.service:21: PIDFile= references a
path below legacy directory /var/run/, updating
/var/run/puppetlabs/mcollective.pid → /run/puppetlabs/mcollective.pid;
please update the unit file accordingly.

as reported in https://cern.service-now.com/nav_to.do?uri=incident.do?sysparm_query=number=INC3107860

Remove PIDFile, StandardOutput=syslog,StandardError=syslog

Dropping PIDFile is clearly fine and correct since we do not even create a PIDFile for sometime.

As for StandardOutput and Error we switch to the defaults:

  • On CC7 and CC8 this switches the properties from 'syslog' to:
StandardOutput=journal
StandardError=inherit
  • On CS9 the properties are already being overridden to journal so this change does nothing

I see no reason to not just set these to the the defaults, the logs end up in journald whatever.

From a deployment point of view the existing drop files will do no harm and they can be cleaned up after without urgency.

Edited by Steve Traylen

Merge request reports