Jira (PUP-7163) regression - systemd provider does not honor documented enabled states

19 views
Skip to first unread message

Alex Schultz (JIRA)

unread,
Feb 1, 2017, 11:01:02 PM2/1/17
to puppe...@googlegroups.com
Alex Schultz updated an issue
 
Puppet / Bug PUP-7163
regression - systemd provider does not honor documented enabled states
Change By: Alex Schultz
Affects Version/s: PUP 4.5.1
Affects Version/s: PUP 4.5.0
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Alex Schultz (JIRA)

unread,
Feb 1, 2017, 11:01:02 PM2/1/17
to puppe...@googlegroups.com
Alex Schultz created an issue
Issue Type: Bug Bug
Affects Versions: PUP 4.5.0, PUP 4.5.1
Assignee: Unassigned
Created: 2017/02/01 8:00 PM
Fix Versions: PUP 4.6.0
Priority: Major Major
Reporter: Alex Schultz

The systemd provider considers too many states as "disabled" and should probably just simply track the return value of "is-enabled" instead of capturing stdout and comparing it to a static list of knows states. This has the added benefit of us not having to externally track new states added to systemd over time.

This issue was found in puppet-nova's CI where we found that the virtlockd and virtlogd services attempt to be enabled on every run; their "is-enabled" state is "indirect".

https://www.freedesktop.org/software/systemd/man/systemctl.html
http://logs.openstack.org/30/308530/24/experimental/gate-puppet-openstack-integration-4-scenario001-tempest-ubuntu-xenial/e209217/console.html#_2016-05-26_22_48_06_290

Alex Schultz (JIRA)

unread,
Feb 1, 2017, 11:01:03 PM2/1/17
to puppe...@googlegroups.com

Emilien Macchi (JIRA)

unread,
Feb 1, 2017, 11:04:02 PM2/1/17
to puppe...@googlegroups.com

Alex Schultz (JIRA)

unread,
Feb 1, 2017, 11:05:03 PM2/1/17
to puppe...@googlegroups.com
Alex Schultz updated an issue
Change By: Alex Schultz
We found this bug again with puppet-agent 1.9.0

For CentOS:
puppet-agent-1.9.0-1.el7.x86_64

For Ubuntu:
ii  puppet-agent                          1.9.0-1xenial                         amd64
The  Puppet Agent package contains all of the elements needed to run puppet, including ruby, facter, hiera and mcollective.

The virtlockd/virtlogd services under
 systemd  (both on Ubuntu and CentOS) are being marked as non-idempotent due to
2017-02-02 03:38:31 +0000 /Stage[main]/Nova::Compute::Libvirt::Services/Service[virtlockd]/enable (notice): enable changed 'false' to 'true'
2017-02-02 03:38:31 +0000 /Stage[main]/Nova::Compute::Libvirt::Services/Service[virtlogd]/enable (notice): enable changed 'false' to 'true'

See logs
http://logs.openstack.org/38/393738/15/check/gate-puppet-openstack-integration-4-scenario002-tempest-ubuntu-xenial/55b4fbf/logs/puppet.txt.gz#_2017-02-02_03_38_31
http://logs.openstack.org/38/393738/15/check/gate-puppet-openstack-integration-4-scenario001-tempest-centos-7/ea5b599/logs/puppet.txt.gz#_2017-02-02_03_43_59


Previous bug PUP-6370 was described as:
The systemd
 provider considers too many states as "disabled" and should probably just simply track the return value of "is-enabled" instead of capturing stdout and comparing it to a static list of knows states.  This has the added benefit of us not having to externally track new states added to systemd over time.


This issue was found in puppet-nova's CI where we found that the virtlockd and virtlogd services attempt to be enabled on every run; their "is-enabled" state is "indirect".

Alex Schultz (JIRA)

unread,
Feb 1, 2017, 11:07:02 PM2/1/17
to puppe...@googlegroups.com
Alex Schultz updated an issue
Change By: Alex Schultz
Release Notes Summary: Previously, when checking whether a service was enabled, the systemd provider used hardcoded strings to compare to the output of {{systemctl}}. Now, we use the exit code from {{systemctl}}, which ensures that the provider's view of a service is in line with that of the system.
Release Notes: Bug Fix

Moses Mendoza (JIRA)

unread,
Feb 3, 2017, 12:43:03 PM2/3/17
to puppe...@googlegroups.com

Moses Mendoza (JIRA)

unread,
Feb 3, 2017, 12:43:05 PM2/3/17
to puppe...@googlegroups.com

Moses Mendoza (JIRA)

unread,
Feb 3, 2017, 12:44:03 PM2/3/17
to puppe...@googlegroups.com
Moses Mendoza updated an issue
Change By: Moses Mendoza
Sprint: Client 2016-06-29 , AP Grooming

Moses Mendoza (JIRA)

unread,
Feb 3, 2017, 12:44:04 PM2/3/17
to puppe...@googlegroups.com
Moses Mendoza commented on Bug PUP-7163
 
Re: regression - systemd provider does not honor documented enabled states

ping Branan Riley - i'm looking into this would you also mind taking a look?

Branan Riley (JIRA)

unread,
Feb 3, 2017, 1:36:06 PM2/3/17
to puppe...@googlegroups.com
Branan Riley commented on Bug PUP-7163

Treating indirect as disabled was intentional, and done in

PUP-6759 . This allows ensure => disabled to work for units in the indirect state.

From the systemd docs, indirect means "The unit file itself is not enabled, but it has a non-empty Also= setting in the "[Install]" unit file section, listing other unit files that might be enabled.". The documentation for Also= does not indicate that it flags a service as not enable-able.

This seeems to indicate one of two things:

  • These particular units cannot be enabled, outside of their status as indirect.
  • systemctl is returning indirect even when they are enabled, despite what the docs say

Either way, it's hard to handle within Puppet's model. I'd like for us to try to sort out a real understanding of what indirect means to Puppet instead of just flipflopping again, though

Alex Schultz (JIRA)

unread,
Feb 3, 2017, 3:02:02 PM2/3/17
to puppe...@googlegroups.com
Alex Schultz commented on Bug PUP-7163

So just FYI, the issue is that the fix for

PUP-6759 seems to no longer be in place as we are seeing the same errors as we did previously. From our perspective we didn't change systemd versions so it was a regression with the 1.9.0 update.

Geoff Nichols (JIRA)

unread,
Mar 1, 2017, 12:00:46 PM3/1/17
to puppe...@googlegroups.com
Geoff Nichols updated an issue
 
Change By: Geoff Nichols
Sprint: Client 2016-06-29, AP Grooming  On-Deck

Geoff Nichols (JIRA)

unread,
Mar 1, 2017, 12:00:54 PM3/1/17
to puppe...@googlegroups.com

Geoff Nichols (JIRA)

unread,
Mar 1, 2017, 12:01:43 PM3/1/17
to puppe...@googlegroups.com

Geoff Nichols (JIRA)

unread,
Apr 13, 2017, 1:45:09 AM4/13/17
to puppe...@googlegroups.com
Geoff Nichols updated an issue
Change By: Geoff Nichols
Sprint: Client 2016-06-29 , Agent Grooming On-Deck

Russell Mull (JIRA)

unread,
May 16, 2017, 6:02:04 PM5/16/17
to puppe...@googlegroups.com

Russell Mull (JIRA)

unread,
May 16, 2017, 6:03:03 PM5/16/17
to puppe...@googlegroups.com

R S (JIRA)

unread,
Aug 29, 2017, 12:51:04 PM8/29/17
to puppe...@googlegroups.com
R S commented on Bug PUP-7163
 
Re: regression - systemd provider does not honor documented enabled states

For what it's worth, after some considerable effort toward this problem in the context of the Ansible project, I've filed a bug with the systemd project asking them for better stdout return values for systemctl is-enabled, better accounting for Units that have an Also= line in their 'Install' section.

As far as I can tell, it is (currently) impossible by command line to accurately determine the state of Units (and all Units alongside, indicated with Also=) using systemctl is-enabled, such that executing systemctl (dis|en)able will product a predictable result. The bug I've filed: https://github.com/systemd/systemd/issues/6681

John Gallo (JIRA)

unread,
Apr 18, 2018, 10:53:51 AM4/18/18
to puppe...@googlegroups.com
John Gallo commented on Bug PUP-7163

Hello,

Any update on fixes/workarounds regarding Puppet Service Resources and Systemctl.

All my nodes with a service resource keep on returning a return code of '2' instead of '0', breaking my automation and integrations.

 

This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Branan Riley (JIRA)

unread,
May 14, 2018, 2:34:03 PM5/14/18
to puppe...@googlegroups.com
Branan Riley updated an issue
 
Change By: Branan Riley
Labels: linux service systemd triaged type_and_provider

Dylan Ratcliffe (JIRA)

unread,
Jul 8, 2018, 11:48:04 PM7/8/18
to puppe...@googlegroups.com

Adam Bottchen (JIRA)

unread,
Jul 26, 2018, 7:10:05 PM7/26/18
to puppe...@googlegroups.com
Adam Bottchen updated an issue
Change By: Adam Bottchen
CS Priority: Needs Priority Reviewed

Adam Bottchen (JIRA)

unread,
Jul 26, 2018, 7:20:05 PM7/26/18
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Nov 1, 2019, 12:37:03 PM11/1/19
to puppe...@googlegroups.com

Mihai Buzgau (Jira)

unread,
Apr 15, 2020, 2:13:03 AM4/15/20
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: Client 2016-06-29 , NW - 2020-04-29
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Mihai Buzgau (Jira)

unread,
Apr 15, 2020, 4:41:03 AM4/15/20
to puppe...@googlegroups.com

Luchian Nemes (Jira)

unread,
Apr 15, 2020, 6:10:03 AM4/15/20
to puppe...@googlegroups.com

Mihai Buzgau (Jira)

unread,
Apr 22, 2020, 3:28:03 AM4/22/20
to puppe...@googlegroups.com

Mihai Buzgau (Jira)

unread,
Apr 29, 2020, 4:41:03 AM4/29/20
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: Client 2016-06-29, NW - 2020-04-29 , NW - 2020-05-13

Luchian Nemes (Jira)

unread,
Apr 29, 2020, 8:28:04 AM4/29/20
to puppe...@googlegroups.com
Luchian Nemes updated an issue
Change By: Luchian Nemes
Release Notes: Bug Fix
Release Notes Summary: Enabling 'indirect' services was causing idempotency issue in puppet due to systemd limitations. It was fixed by not allowing users to enable/disable such services and print a debug log instead.

Josh Cooper (Jira)

unread,
May 13, 2020, 9:22:03 PM5/13/20
to puppe...@googlegroups.com

Gheorghe Popescu (Jira)

unread,
May 27, 2020, 5:59:03 AM5/27/20
to puppe...@googlegroups.com

Claire Cadman (Jira)

unread,
May 29, 2020, 4:28:03 AM5/29/20
to puppe...@googlegroups.com
Claire Cadman updated an issue
Change By: Claire Cadman
Labels: doc_reviewed linux service systemd type_and_provider

Ciprian Badescu (Jira)

unread,
Jul 2, 2020, 6:04:02 AM7/2/20
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages