LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-30-2024, 10:15 PM   #1
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,489
Blog Entries: 7

Rep: Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580
NTP problem on boot after recent patch - (15.0 stable 64 bit)


After installing the latest update to NTP, I get this message on boot:

Code:
Starting NTP daemon: /usr/sbin/ntpd -g -u ntp:ntp daemon control: got EOF
Which is odd, because it was working before and the patch seemed harmless enough...

Oddly, it works fine if I start NTP with:

Code:
# /etc/rc.d/rc.ntpd start
 
Old 05-30-2024, 10:28 PM   #2
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,489

Original Poster
Blog Entries: 7

Rep: Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580
A clue from the logs:

Code:
31 May 13:20:42 ntpd[1225]: bind(21) AF_INET6 [xxxx::xxx:xxxx:xxxx:xxxxxx]:123 flags 0x811 failed: Cannot assign requested address
31 May 13:20:42 ntpd[1225]: unable to create socket on eth0 (5) for [xxxx::xxx:xxxx:xxxx:xxxxxx]:123
This machine is configured to use a static IPv4 address. Do I need to turn off IPv6 in the NTP config?

Last edited by rkelsen; 05-30-2024 at 11:19 PM. Reason: replaced IPv6 address digits with x
 
Old 05-31-2024, 12:21 AM   #3
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,489

Original Poster
Blog Entries: 7

Rep: Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580
So I fixed it by appending "ipv6.disable=1" to the kernel command line. Odd, because I didn't have to do that before.
 
1 members found this post helpful.
Old 05-31-2024, 12:36 AM   #4
teoberi
Member
 
Registered: Jan 2018
Location: Romania
Distribution: Slackware64-current (servers)/Windows 11/Ubuntu (workstations)
Posts: 624

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
I'm in the same situation on Slackware64-current but I can't disable IPV6. I have to find another solution to solve the problem only for NTP.
A solution could be the one in this link.
/etc/default/ntp
Code:
NTPD_OPTS='-4 -g' [Add the ' -4 ' to this line to tell NTPD to only listen to IPv4]
/etc/ntpd
Code:
#restrict -6 default limited kod nomodify notrap nopeer noquery

Last edited by teoberi; 05-31-2024 at 01:19 AM.
 
1 members found this post helpful.
Old 05-31-2024, 04:57 AM   #5
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,185

Rep: Reputation: 237Reputation: 237Reputation: 237
Quote:
Originally Posted by rkelsen View Post
A clue from the logs:

Code:
31 May 13:20:42 ntpd[1225]: bind(21) AF_INET6 [xxxx::xxx:xxxx:xxxx:xxxxxx]:123 flags 0x811 failed: Cannot assign requested address
31 May 13:20:42 ntpd[1225]: unable to create socket on eth0 (5) for [xxxx::xxx:xxxx:xxxx:xxxxxx]:123
This machine is configured to use a static IPv4 address. Do I need to turn off IPv6 in the NTP config?
This looks like a serious bug because the ipv6 address in this error message appears malformed in my case.

The error might be caused by improper memory access.
 
Old 05-31-2024, 05:07 AM   #6
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,489

Original Poster
Blog Entries: 7

Rep: Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580
Quote:
Originally Posted by teoberi View Post
/etc/default/ntp
That file seems to be ignored by Slackware's ntpd.
 
Old 05-31-2024, 05:35 AM   #7
teoberi
Member
 
Registered: Jan 2018
Location: Romania
Distribution: Slackware64-current (servers)/Windows 11/Ubuntu (workstations)
Posts: 624

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
When I restart the servers, the NTP doesn't start anymore, but it works if I start it manually according to @rkelsen's suggestion.

Last edited by teoberi; 06-01-2024 at 03:18 PM.
 
Old 05-31-2024, 05:51 AM   #8
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,467

Rep: Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226
Quote:
Originally Posted by rkelsen View Post
Code:
Starting NTP daemon: /usr/sbin/ntpd -g -u ntp:ntp daemon control: got EOF
[/code]
I am able to reproduce this error message, after removing the ntp user
Code:
# /etc/rc.d/rc.ntpd restart
Stopping NTP daemon...
Starting NTP daemon:  /usr/sbin/ntpd -g -u ntp:ntpdaemon control: got EOF
Can you check if you have ntp, both user and group, on your computer ?
 
Old 05-31-2024, 06:03 AM   #9
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,489

Original Poster
Blog Entries: 7

Rep: Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580
Quote:
Originally Posted by marav View Post
Can you check if you have ntp, both user and group, on your computer ?
Yes, ntp user and group both exist. The setup on this machine is basically stock standard. It has been running fine for >2 years.

The recent NTP patch seems to have broken something to do with IPv6, because when I disable it (as per post #3) everything works as normal.
 
Old 05-31-2024, 06:06 AM   #10
mrsam
LQ Newbie
 
Registered: Jan 2024
Distribution: Fedora, Ubuntu, Slackware
Posts: 14

Rep: Reputation: 11
Quote:
Originally Posted by guanx View Post
This looks like a serious bug because the ipv6 address in this error message appears malformed in my case.

The error might be caused by improper memory access.
The addresses are not malformed. They are link local ipv6 addresses.

# ip addr

will show them.

ntpd binds to every address by default. For some reason it chokes when binding the ipv6 link local address (which gets set up even if there are no ipv6 addresses enabled) but only if it's started during system boot. As a data point: I'm eating my own dogfood by running vera instead of sysvinit to boot Slackware (link in my github page), and I have the nm-online container enabled which waits for NetworkManager to acquire IP addresses before starting all rc.inet2 services. On a cold boot NetworkManager takes about 25 seconds, for some odd reason, to acquire an IPv4 address from my DHCP server (but it always does). On a cold boot, due to this natural delay, ntpd starts without any issues.

However, if I reboot: NetworkManager gets in gear without any delay, and assigns my IPv4 addresses immedately, all rc.inet2 services come up without delay, and ntp chokes in the manner described above.

I think that ntp is getting started before the IPv6 stack is fully up, and it fails to come up for that reason.

Anyway, another way to fix this is to grab your IPv6 link local address from the output of "ip addr", or the one that's logged in ntp.log, and add:

interface ignore <ipv6 address>

to your /etc/ntp.conf
 
2 members found this post helpful.
Old 06-01-2024, 11:29 AM   #11
teoberi
Member
 
Registered: Jan 2018
Location: Romania
Distribution: Slackware64-current (servers)/Windows 11/Ubuntu (workstations)
Posts: 624

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
I studied a bit rc.ntpd
At startup, the -p (path to the PID file) option is not specified, so the file is not created.
At stop there is an alternative if ntpd.pid is not found.
Restart is OK after adding the option.
The status is useless if the file does not exist.
If
Code:
-p /run/ntpd.pid
is added to startup, everything is OK, except if you try to start again.

Last edited by teoberi; 06-01-2024 at 11:37 AM.
 
Old 06-01-2024, 02:14 PM   #12
Markus Wiesner
Member
 
Registered: Mar 2016
Distribution: Slackware
Posts: 147

Rep: Reputation: 237Reputation: 237Reputation: 237
Quote:
Originally Posted by mrsam View Post
For some reason it chokes when binding the ipv6 link local address (which gets set up even if there are no ipv6 addresses enabled) but only if it's started during system boot.
Newly added IPv6 addresses are usually in a "tentative" state for a short time because of a duplicate address detection. I think binding to the address is not yet possible in this state. rc.inet1 works around this problem at boot:

Code:
        # IPv6's Duplicate Address Detection (DAD) causes a race condition when bringing up interfaces, as
        # described here:  https://www.agwa.name/blog/post/beware_the_ipv6_dad_race_condition
        # Disable DAD while bringing up the interface - but note that this means the loss of detection of a
        # duplicate address.  It's a trade off, unfortunately.
        debug_log "${1}: disabling IPv6 DAD"
        echo "0" >/proc/sys/net/ipv6/conf/${1}/accept_dad
# [snip]
        # Reset accept_dad back to default now all the IPs are configured:
        debug_log "${1}: resetting IPv6 DAD to default"
        cat /proc/sys/net/ipv6/conf/default/accept_dad >/proc/sys/net/ipv6/conf/${1}/accept_dad
But this won't help if the interfaces are configured by NetworkManager instead of rc.inet1. I don't know how to solve this with NetworkManager, but maybe it serves as a starting point. Maybe there is a configuration parameter or you can add a little delay after NetworkManager is started so that the DAD can complete before ntpd gets started?
 
Old 06-01-2024, 04:20 PM   #13
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,489

Original Poster
Blog Entries: 7

Rep: Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580Reputation: 2580
^ The problem happens here on a server with a statically set IPv4 address.
 
Old 06-01-2024, 09:07 PM   #14
thirdm
Member
 
Registered: May 2013
Location: Massachusetts
Distribution: Slackware, NetBSD, Debian, 9front
Posts: 327

Rep: Reputation: Disabled
Quote:
Originally Posted by mrsam View Post
Anyway, another way to fix this is to grab your IPv6 link local address from the output of "ip addr", or the one that's logged in ntp.log, and add:

interface ignore <ipv6 address>

to your /etc/ntp.conf
interface ignore also takes ipv6 in place of the address if you want to ignore all ipv6 addresses.

https://www.ntp.org/documentation/4....ries/ntp.conf/
 
2 members found this post helpful.
Old 06-02-2024, 02:45 AM   #15
teoberi
Member
 
Registered: Jan 2018
Location: Romania
Distribution: Slackware64-current (servers)/Windows 11/Ubuntu (workstations)
Posts: 624

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
The update from Sat Jun 1 19:52:37 UTC 2024 together with the "-4" option solved the problem for now. I will test the future versions of NTP to see if it has been solved for IPv6.
The issue of starting NTP remains unsolved (if NTP is already started), it gets a bit confusing (ntpd.pid), NTP must be stopped and restarted.
But it seems a general problem, for example in the case of Bind, starting again even though Bind is started leads to the creation of two processes.

In the end, the problem is solved for now, the thread can be closed.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
puppy thoughts after having a recent look see -- given recent developments .. jonyo Puppy 0 11-29-2011 08:45 PM
ntp drift file in /etc/ntp instead of /var/lib/ntp - suggestion for a patch in Slack niels.horn Slackware 16 05-07-2009 07:35 PM
NTP's ntp.conf pxumsgdxpcvjm Linux - Server 2 08-30-2007 09:34 PM
NTP cannot work with timeserver, NTP-d can jerryvapps Linux - Networking 0 08-04-2004 02:04 PM
NTP cannot use server, NTP -d can jerryvapps Linux - Newbie 0 07-28-2004 02:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration