Jira (PUP-11815) Use systemd for services with Amazon Linux 2023

5 views
Skip to first unread message

Luca Terzi (Jira)

unread,
Apr 7, 2023, 9:34:02 AM4/7/23
to puppe...@googlegroups.com
Luca Terzi created an issue
 
Puppet / Bug PUP-11815
Use systemd for services with Amazon Linux 2023
Issue Type: Bug Bug
Affects Versions: PUP 7.24.0
Assignee: Unassigned
Created: 2023/04/07 6:33 AM
Priority: Normal Normal
Reporter: Luca Terzi

Puppet Version: 7.24
Puppet Server Version: None
OS Name/Version: Amazon Linux 2023

 

I'm using Puppet 7.24 installed from `https://yum.puppet.com/puppet7-release-el-9.noarch.rpm`

The same issue reported in PUP-11168 and PUP-11433 also applies for Amazon Linux 2023.

When using the service resource type, Amazon Linux 2023 is not listed in https://github.com/puppetlabs/puppet/blob/main/lib/puppet/provider/service/systemd.rb, so it falls back to using chkconfig and /sbin/service.

 

Desired Behavior:{}

Amazon Linux 2023 should use systemd for services.

 

Actual Behavior:

The service resource type in Amazon Linux 2023 falls back to chkconfig and /sbin/service.

Let's suppose an example service like this:

service

{ 'my-service':   ensure => 'running',   name => 'my-service',   enable => true, }

When running puppet apply I get errors from chkconfig

 

Error: Could not enable envoy: Execution of '/sbin/chkconfig --add my-service' returned 1: error reading information on service my-service: No such file or directory

Error: /Stage[main]/My_Class/Service[my-service]/ensure: change from 'stopped' to 'running' failed: Could not enable my-service: Execution of '/sbin/chkconfig --add my-service' returned 1: error reading information on service my-service: No such file or directory

 

By patching /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/provider/service/systemd.rb with:

defaultfor :operatingsystem => :amazon, :operatingsystemmajrelease => ["2", "2023"]

the issue appears to be fixed.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.20.11#820011-sha1:0629dd8)
Atlassian logo

Josh Cooper (Jira)

unread,
Apr 11, 2023, 4:06:03 PM4/11/23
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
*Puppet Version:* 7.24
*Puppet Server Version:* None
*OS Name/Version:* Amazon Linux 2023

 

I'm using Puppet 7.24 installed from `[https://yum.puppet.com/puppet7-release-el-9.noarch.rpm]`

The same issue reported in PUP-11168 and PUP-11433 also applies for Amazon Linux 2023.

When using the service resource type, Amazon Linux 2023 is not listed in {{{}[https://github.com/puppetlabs/puppet/blob/main/lib/puppet/provider/service/systemd.rb]{}}}, so it falls back to using {{chkconfig}} and {{{}/sbin/service{}}}.

 

{*}Desired Behavior:{*}{*}{{*}}


Amazon Linux 2023 should use {{systemd}} for services.

 

*Actual Behavior:*

The service resource type in Amazon Linux 2023 falls back to {{chkconfig}} and {{{}/sbin/service{}}}.


Let's suppose an example service like this:

{code:puppet}
service { 'my-service':
  ensure => 'running',
  name => 'my-service',
  enable => true,
}
{code}


When running {{puppet apply}} I get errors from {{chkconfig}}

  {noformat}

Error: Could not enable envoy: Execution of '/sbin/chkconfig --add my-service' returned 1: error reading information on service my-service: No such file or directory

Error: /Stage[main]/My_Class/Service[my-service]/ensure: change from 'stopped' to 'running' failed: Could not enable my-service: Execution of '/sbin/chkconfig --add my-service' returned 1: error reading information on service my-service: No such file or directory
{noformat}
 

By patching {{/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/provider/service/systemd.rb}} with:


{{defaultfor :operatingsystem => :amazon, :operatingsystemmajrelease => ["2", "2023"]}}



the issue appears to be fixed.
Reply all
Reply to author
Forward
0 new messages