Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to ntp package in Debian Bookworm #234

Closed
pedrorosadodias opened this issue Jul 3, 2023 · 1 comment
Closed

Changes to ntp package in Debian Bookworm #234

pedrorosadodias opened this issue Jul 3, 2023 · 1 comment

Comments

@pedrorosadodias
Copy link

pedrorosadodias commented Jul 3, 2023

👻 Brief Description

The ntp package, which used to be the default way to set the system clock from a Network Time Protocol (NTP) server, has been replaced by ntpsec in Debian Bookworm [1].

References:
[1] https://www.debian.org/releases/bookworm/amd64/release-notes/ch-information.en.html

🥞 Cookbook version

5.0.10

👩‍🍳 Chef-Infra Version

16.18.30

🎩 Platform details

Debian 12 (Bookworm)

Steps To Reproduce

Steps to reproduce the behavior:

  1. Added the ntp::defaultrecipe to chef run_list
  2. Obtained the following error:
       Recipe: ntp::default
         * apt_package[ntp] action install (up to date)
         * apt_package[Remove ntpdate] action remove (skipped due to only_if)
         * directory[/var/lib/ntp] action create
           * cannot determine user id for 'ntp', does the user exist on this system?
           ================================================================================
           Error executing action `create` on resource 'directory[/var/lib/ntp]'
           ================================================================================
           
           Chef::Exceptions::UserIDNotFound
           --------------------------------
           cannot determine user id for 'ntp', does the user exist on this system?
           
           Resource Declaration:
           ---------------------
           # In /tmp/kitchen/cache/cookbooks/ntp/recipes/default.rb
           
            71:     directory ntpdir do
            72:       owner node['ntp']['var_owner']
            73:       group node['ntp']['var_group']
            74:       mode '0755'
            75:     end
            76:   end
           
           Compiled Resource:
           ------------------
           # Declared in /tmp/kitchen/cache/cookbooks/ntp/recipes/default.rb:71:in `block in from_file'
           
           directory("/var/lib/ntp") do
             action [:create]
             default_guard_interpreter :default
             declared_type :directory
             cookbook_name "ntp"
             recipe_name "default"
             owner "ntp"
             group "ntp"
             mode "0755"
           end
           
           System Info:
           ------------
           chef_version=16.18.30
           platform=debian
           platform_version=12
           ruby=ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [x86_64-linux]
           program_name=/opt/chef/bin/chef-client
           executable=/opt/chef/bin/chef-client
           
       
       Running handlers:
       [2023-06-30T16:29:42+01:00] ERROR: Running exception handlers
       Running handlers complete
       [2023-06-30T16:29:42+01:00] ERROR: Exception handlers complete
       Chef Infra Client failed. 3 resources updated in 14 seconds
       [2023-06-30T16:29:43+01:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
       [2023-06-30T16:29:43+01:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
       [2023-06-30T16:29:43+01:00] FATAL: Chef::Exceptions::UserIDNotFound: directory[/var/lib/ntp] (ntp::default line 71) had an error: Chef::Exceptions::UserIDNotFound: cannot determine user id for 'ntp', does the user exist on this system?
root@d-hseupjgd:/home/debian# cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

root@d-hseupjgd:/home/debian# cat /etc/passwd | grep -i ntp
ntpsec:x:101:108::/nonexistent:/usr/sbin/nologin

Possible solution:

if platform?('debian') && node['platform_version'] == '12'
  node.force_default['ntp']['var_owner'] = 'ntpsec'
  node.force_default['ntp']['var_group'] = 'ntpsec'
end
@bugoff bugoff mentioned this issue Jan 24, 2024
3 tasks
damacus added a commit that referenced this issue Feb 14, 2024
Updated readme this cookbook only supports Chef 15.5+ 

Since Debian Bookworm the NTP user is ntpsec (i expect Debian will continue to use this in all later versions)

For Debian / RedHat based OS'es there is a leap-second file, prefer using this.

# Issues Resolved

- Readme 
  #230

- bookworm
  #234
  #224

- leap-second file
  #217

---------

Co-authored-by: Dan Webb <[email protected]>
@damacus
Copy link
Member

damacus commented Feb 14, 2024

Closed via #242

@damacus damacus closed this as completed Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants