Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
PUP 7.6.0
-
None
-
Needs Assessment
-
Bug Fix
-
Fix a bug where the systemd provider would refuse to mask static systemd services. Fix contributed by community member nmaludy.
-
Needs Assessment
Description
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 - Executing: '/bin/systemctl is-enabled -- systemd-coredump.socket'debug - Puppet - Unable to enable or disable static service systemd-coredump.socket |
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'.