Open dauletilyassov opened 3 months ago
From /etc/init.d/README
:
You are looking for the traditional init scripts in /etc/rc.d/init.d,
and they are gone?
Here's an explanation on what's going on:
You are running a systemd-based OS where traditional init scripts have
been replaced by native systemd services files. Service files provide
very similar functionality to init scripts. To make use of service
files simply invoke "systemctl", which will output a list of all
currently running services (and other units). Use "systemctl
list-unit-files" to get a listing of all known unit files, including
stopped, disabled and masked ones. Use "systemctl start
foobar.service" and "systemctl stop foobar.service" to start or stop a
service, respectively. For further details, please refer to
systemctl(1).
Note that traditional init scripts continue to function on a systemd
system. An init script /etc/rc.d/init.d/foobar is implicitly mapped
into a service unit foobar.service during system initialization.
Thank you!
chkconfig --add squid
is failing because there's no /etc/rc.d/init.d/squid
service to add, and that's your culprit 🙂
From
/etc/init.d/README
:You are looking for the traditional init scripts in /etc/rc.d/init.d, and they are gone? Here's an explanation on what's going on: You are running a systemd-based OS where traditional init scripts have been replaced by native systemd services files. Service files provide very similar functionality to init scripts. To make use of service files simply invoke "systemctl", which will output a list of all currently running services (and other units). Use "systemctl list-unit-files" to get a listing of all known unit files, including stopped, disabled and masked ones. Use "systemctl start foobar.service" and "systemctl stop foobar.service" to start or stop a service, respectively. For further details, please refer to systemctl(1). Note that traditional init scripts continue to function on a systemd system. An init script /etc/rc.d/init.d/foobar is implicitly mapped into a service unit foobar.service during system initialization. Thank you!
chkconfig --add squid
is failing because there's no/etc/rc.d/init.d/squid
service to add, and that's your culprit 🙂
Thanks for the response.
Yes. I have seen that too. However, it is the same on AL2 and this works without systemd
provider.
cat /etc/init.d/README
You are looking for the traditional init scripts in /etc/rc.d/init.d,
and they are gone?
Here's an explanation on what's going on:
You are running a systemd-based OS where traditional init scripts have
been replaced by native systemd services files. Service files provide
very similar functionality to init scripts. To make use of service
files simply invoke "systemctl", which will output a list of all
currently running services (and other units). Use "systemctl
list-unit-files" to get a listing of all known unit files, including
stopped, disabled and masked ones. Use "systemctl start
foobar.service" and "systemctl stop foobar.service" to start or stop a
service, respectively. For further details, please refer to
systemctl(1).
Note that traditional init scripts continue to function on a systemd
system. An init script /etc/rc.d/init.d/foobar is implicitly mapped
into a service unit foobar.service during system initialization.
Thank you!
# cat /etc/system-release
Amazon Linux release 2 (Karoo)
# /sbin/chkconfig --add squid
error reading information on service squid: No such file or directory
@dauletilyassov on al2
there is the squid-sysvinit
package providing the /etc/rc.d/init.d/squid
service script. There's no such package in al2023
. The package provides SysV initscript for squid caching proxy
. That's why chkconfig --add
woks on al2
and fails on al2023
@dauletilyassov on
al2
there is thesquid-sysvinit
package providing the/etc/rc.d/init.d/squid
service script. There's no such package inal2023
. The package providesSysV initscript for squid caching proxy
. That's whychkconfig --add
woks onal2
and fails onal2023
/etc/rc.d/init.d/squid
Hey @elsaco, where do you see that on al2?
cat /etc/rc.d/init.d/squid
cat: /etc/rc.d/init.d/squid: No such file or directory
Just to be clear running chkconfig
on AL2 fails with the same error as on AL2023
/sbin/chkconfig --add squid
error reading information on service squid: No such file or directory
Also, this also fails for iptables, squid and named services on AL2023 where systemd
provider is not specified
Error: Could not enable iptables: Execution of '/sbin/chkconfig --add iptables' returned 1: error reading information on service iptables: No such file or directory
Error: /Stage[main]/Firewall::Linux::Redhat/Service[iptables]/enable: change from false to true failed: Could not enable iptables: Execution of '/sbin/chkconfig --add iptables' returned 1: error reading information on service iptables: No such file or directory
Error: Could not enable squid: Execution of '/sbin/chkconfig --add squid' returned 1: error reading information on service squid: No such file or directory
Error: /Stage[main]/Squid/Service[squid]/enable: change from false to true failed: Could not enable squid: Execution of '/sbin/chkconfig --add squid' returned 1: error reading information on service squid: No such file or directory
Error: Could not enable named: Execution of '/sbin/chkconfig --add named' returned 1: error reading information on service named: No such file or directory
Error: /Stage[main]/Network::Localdnscache/Service[named]/enable: change from false to true failed: Could not enable named: Execution of '/sbin/chkconfig --add named' returned 1: error reading information on service named: No such file or directory
These are the packages on al2
:
squid.x86_64 : The Squid proxy caching server
squid-migration-script.x86_64 : Migration script for squid caching proxy
squid-sysvinit.x86_64 : SysV initscript for squid caching proxy
If you want to manage services the old way installing squid-sysvinit
will provide the script. Notice that this package is not a requirement to install squid
on al2
, only squid-migration-script
is.
This is the entire content of the package:
[ec2-user ~]$ rpm -qpl squid-sysvinit-3.5.20-17.amzn2.7.20.x86_64.rpm
/etc/rc.d/init.d/squid
These are the packages on
al2
:squid.x86_64 : The Squid proxy caching server squid-migration-script.x86_64 : Migration script for squid caching proxy squid-sysvinit.x86_64 : SysV initscript for squid caching proxy
If you want to manage services the old way installing
squid-sysvinit
will provide the script. Notice that this package is not a requirement to installsquid
onal2
, onlysquid-migration-script
is.This is the entire content of the package:
[ec2-user ~]$ rpm -qpl squid-sysvinit-3.5.20-17.amzn2.7.20.x86_64.rpm /etc/rc.d/init.d/squid
This is what I have installed on al2:
yum list installed | grep squid
squid.x86_64 7:3.5.20-17.amzn2.7.1 @amzn2-core
squid-migration-script.x86_64 7:3.5.20-17.amzn2.7.1 @amzn2-core
We do not use squid-sysvinit.x86_64 : SysV initscript for squid caching proxy
on al2.
AFAIK, AL2 should be using systemd
by default to manage services and I think it does, otherwise this would have failed to enable squid
like on AL2023. But for some reason, AL2023 needs systemd
provider to be stated explicitly. This happens for at least 3 services, once I move to AL2023. However, this works fine without any errors on al2023.
I am trying to understand what changes on AL2023 have been made so that enabling services without explicit systemd
provider won't work. My PR does not have any changes that could have interfered with that.
Describe the bug On Amazon Linux 2, Puppet was able to manage services without the need to explicitly specify the
systemd
provider. However, on Amazon Linux 2023, I need to explicitly specify thesystemd
provider to enable and manage services properly.To Reproduce Steps to reproduce the behavior:
Expected behavior Puppet should manage services on Amazon Linux 2023 without needing to explicitly specify the systemd provider, similar to how it functions on Amazon Linux 2.
Desktop (please complete the following information):
Additional context Disabling the enable attribute allows Puppet to run without errors:
Not sure, why specifying the
systemd
provider explicitly is necessary for Amazon Linux 2023 and consider making it consistent with Amazon Linux 2 where the provider did not need to be specified. AWS Docs say they retain backwards compatibility with System V service (init) scripts but that does not explain the culprit because AL2 usessystemd
by default.