puppetlabs / puppetlabs-ntp

Puppet module to manage the NTP service
http://forge.puppetlabs.com/puppetlabs/ntp
Apache License 2.0
145 stars 328 forks source link

Add package and service name for Debian 12 'ntpsec' #700

Open FrankVanDamme opened 1 year ago

FrankVanDamme commented 1 year ago

Summary

Added one file in data to match Debian-12 hosts.

Additional Context

"ntp" is now a transitional dummy package in Debian and a Puppet run with the service enabled will fail since the service "ntp" is renamed to "ntpsec".

CLAassistant commented 1 year ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Frank Van Damme seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

octomike commented 1 year ago

Can't really reproduce on an upgraded system (from 11 to 12):

# puppet resource service ntp ensure=stopped
Notice: /Service[ntp]/ensure: ensure changed 'running' to 'stopped'
service { 'ntp':
  ensure   => 'stopped',
  provider => 'systemd',
}
# puppet resource service ntpsec
service { 'ntpsec':
  ensure   => 'stopped',
  enable   => 'true',
  provider => 'systemd',
}

# puppet resource service ntp
service { 'ntp':
  ensure   => 'stopped',
  enable   => 'true',
  provider => 'systemd',root@lip-vault:~
}

# ls -la /etc/systemd/system/ntp*
lrwxrwxrwx 1 root root 34 Sep 28 17:02 /etc/systemd/system/ntpd.service -> /lib/systemd/system/ntpsec.service
lrwxrwxrwx 1 root root  9 Sep 28 17:02 /etc/systemd/system/ntpsec.timer -> /dev/null
lrwxrwxrwx 1 root root 34 Sep 28 17:02 /etc/systemd/system/ntp.service -> /lib/systemd/system/ntpsec.service
smoeding commented 8 months ago

Well, it works using the service name ntp because the real service ntpsec installs these aliases to remain backwards compatible. Check /usr/lib/systemd/system/ntpsec.service to find the following snippet:

[Install]
Alias=ntp.service
Alias=ntpd.service

This causes systemd to create these files in addition to the real service files:

# ls -la /etc/systemd/system/ntp*
lrwxrwxrwx 1 root root 34 Sep 28 17:02 /etc/systemd/system/ntpd.service -> /lib/systemd/system/ntpsec.service
lrwxrwxrwx 1 root root 34 Sep 28 17:02 /etc/systemd/system/ntp.service -> /lib/systemd/system/ntpsec.service

Sticking with ntp as the service name will probably cause a problem when Debian decides to remove this compatibility shim. I would vote to update both the package and the service name to match the system state.

tdb commented 4 months ago

The same is true of Ubuntu 24.04, so a data/Ubuntu-24.04.yaml with the same content would be useful at the same time.