Jira (PUP-11034) Unable to 'mask' a 'static' systemd service

102 views
Skip to first unread message

Nick Maludy (Jira)

unread,
Apr 28, 2021, 3:56:04 PM4/28/21
to puppe...@googlegroups.com
Nick Maludy created an issue
 
Puppet / Bug PUP-11034
Unable to 'mask' a 'static' systemd service
Issue Type: Bug Bug
Affects Versions: PUP 7.6.0
Assignee: Unassigned
Created: 2021/04/28 12:55 PM
Priority: Normal Normal
Reporter: Nick Maludy

Puppet Version: 7.6.1
Puppet Server Version: N/A
OS Name/Version: CentOS 8.3

I'm trying to translate the following command into Puppet:

systemctl stop systemd-coredump.socket
systemctl mask systemd-coredump.socket

The Puppet code i've written to do this is:

service { 'systemd-coredump.socket':
   ensure => 'stopped',
   enable => 'mask',
}

Desired Behavior:

I would expect the service to be stopped and masked.

Actual Behavior:

The service is a 'static' service on the system and is resulting in a debug log being printed:

debug - Puppet - Unable to enable or disable static service systemd-coredump.socket
 

`

 

Please take a moment and attach any relevant log output and/or manifests. This will help us immensely when troubleshooting the issue.

Examples:
Run puppet agent with --test --trace --debug

Relevant sections of /var/log/puppetlabs/puppetserver/puppetserver.log or any applicable logs from the same directory.

For more detailed information turn up the server logs by upping the log level in the server's logback.xml

Relevant sections of configurations files (puppet.conf, hiera.conf, Server's conf.d, defaults/sysconfig)

For memory issues with server heap dumps are also helpful.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Nick Maludy (Jira)

unread,
Apr 28, 2021, 3:58:03 PM4/28/21
to puppe...@googlegroups.com
Nick Maludy updated an issue
Change By: Nick Maludy
*Puppet Version: 7.6.1*
*Puppet Server Version: N/A*
*OS Name/Version: CentOS 8.3*


I'm trying to translate the following command into Puppet:
{code:java}
systemctl stop systemd-coredump.socket
systemctl mask systemd-coredump.socket{code}

The Puppet code i've written to do this is:
{code:java}
service { 'systemd-coredump.socket':
   ensure => 'stopped',
   enable => 'mask',
}{code}
*Desired Behavior:*


I would expect the service to be stopped and masked.

*Actual Behavior:*


The service is a 'static' service on the system and is resulting in a debug log being printed:
{code:java}
debug - Puppet - Executing: '/bin/systemctl is-enabled -- systemd-coredump.socket'debug - Puppet - Unable to enable or disable static service systemd-coredump.socket
{code}


`

 

Please take a moment and attach any relevant log output and/or manifests. This will help us immensely when troubleshooting
Running the issue systemctl commands manually, works just fine .

Examples Doing a little digging, i found the following code :
Run puppet agent with --test --trace --debug

Relevant sections of {{ [https: / var / log github.com /puppetlabs/ puppetserver puppet / puppetserver blob/main/lib/puppet/provider/service/systemd . log}} or any applicable logs from the same directory. rb#L42-L56]

For more detailed information turn up the server logs by upping the log level The comment in the server's logback.xml

Relevant sections of configurations files (puppet.conf
block is accurate , hiera.conf, Server however a little misleading because ' s conf static' services are allowed to be 'masked' . d, defaults/sysconfig)

For memory issues with server heap dumps are also helpful.  

Nick Maludy (Jira)

unread,
Apr 28, 2021, 4:02:02 PM4/28/21
to puppe...@googlegroups.com
Nick Maludy commented on Bug PUP-11034
 
Re: Unable to 'mask' a 'static' systemd service

Workaround:

      exec { "systemctl mask -- ${service}":
        path   => ['/usr/bin/', '/sbin', '/bin'],
        unless => "systemctl status -- ${service} | grep -q masked",
      } 

Nick Maludy (Jira)

unread,
Apr 28, 2021, 4:02:03 PM4/28/21
to puppe...@googlegroups.com
Nick Maludy updated an issue
Change By: Nick Maludy
*Puppet Version: 7.6.1*
*Puppet Server Version: N/A*
*OS Name/Version: CentOS 8.3*

I'm trying to translate the following command into Puppet:
{code:java}systemctl stop systemd-coredump.socket
systemctl mask systemd-coredump.socket{code}
The Puppet code i've written to do this is:
{code:java}service { 'systemd-coredump.socket':
   ensure => 'stopped',
   enable => 'mask',
}{code}
*Desired Behavior:*

I would expect the service to be stopped and masked.

*Actual Behavior:*

The service is a 'static' service on the system and is resulting in a debug log being printed:
{code:java}debug - Puppet - Executing: '/bin/systemctl is-enabled -- systemd-coredump.socket'debug - Puppet - Unable to enable or disable static service systemd-coredump.socket
{code}
Running the systemctl commands manually, works just fine.


Doing a little digging, i found the following code:
[https://github.com/puppetlabs/puppet/blob/main/lib/puppet/provider/service/systemd.rb#L42-L56]

The comment in the block is accurate, however a little misleading because 'static' services are allowed to be 'masked'.

 

Mihai Buzgau (Jira)

unread,
Apr 29, 2021, 3:17:02 AM4/29/21
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Labels: community

Gabriel Nagy (Jira)

unread,
May 17, 2021, 9:33:04 AM5/17/21
to puppe...@googlegroups.com

Gabriel Nagy (Jira)

unread,
May 17, 2021, 9:34:03 AM5/17/21
to puppe...@googlegroups.com
Gabriel Nagy updated an issue
 
Change By: Gabriel Nagy
Fix Version/s: PUP 7.7.0
Fix Version/s: PUP 6.23.0

Claire Cadman (Jira)

unread,
May 19, 2021, 8:53:01 AM5/19/21
to puppe...@googlegroups.com
Claire Cadman updated an issue
Change By: Claire Cadman
Labels: community doc-reviewed
Reply all
Reply to author
Forward
0 new messages