LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 06-02-2024, 02:48 AM   #16
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

But the mystery remains about why this became necessary all of a sudden.
 
Old 06-02-2024, 03:02 AM   #17
teoberi
Member
 
Registered: Jan 2018
Location: Romania
Distribution: Slackware64-current (servers)/Windows 11/Ubuntu (workstations)
Posts: 624

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
Quote:
Originally Posted by rkelsen View Post
But the mystery remains about why this became necessary all of a sudden.
Yes. That's why I said that I will follow the future versions of NTP.
 
Old 06-02-2024, 05:39 AM   #18
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
The update from Sat Jun 1 19:52:37 UTC 2024 together with the "-4" option solved the problem for now.
Sorry, I had missed that.

Yes I'll mark this as solved. Thanks Patrick!
 
Old 06-02-2024, 06:03 PM   #19
mrsam
LQ Newbie
 
Registered: Jan 2024
Distribution: Fedora, Ubuntu, Slackware
Posts: 14

Rep: Reputation: 11
Talking

Quote:
Originally Posted by teoberi View Post
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.
I'll just put in another plug for myself. As I mentioned earlier in the thread, I am eating my own dogfood, which, incidentally, solves this problem too. Live example using ntpd:

Code:
root@slackware:~# vlad status system/rc.M/rc.ntpd
system/rc.M/rc.ntpd:
    started (manual) Fri May 31 08:00:42 2024 (2 days ago)
        2005 /usr/sbin/ntpd -g -u ntp:ntp
root@slackware:~# vlad stop system/rc.M/rc.ntpd
Stopping NTP daemon...
root@slackware:~# vlad start system/rc.M/rc.ntpd
Starting NTP daemon:  /usr/sbin/ntpd -g -u ntp:ntp
root@slackware:~# vlad start system/rc.M/rc.ntpd
system/rc.M/rc.ntpd: cannot be started because it's not stopped
root@slackware:~# vlad status system/rc.M/rc.ntpd
system/rc.M/rc.ntpd:
    started (manual) 1 minute ago
        2290 /usr/sbin/ntpd -g -u ntp:ntp
I am not running bind, but it would work pretty much the same way. This problem is solvable.
 
Old 06-02-2024, 07:37 PM   #20
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,185

Rep: Reputation: 237Reputation: 237Reputation: 237
Quote:
Originally Posted by mrsam View Post
The addresses are not malformed. They are link local ipv6 addresses.

# ip addr

will show them.

... //snip
I mean the trailing %3 %4 %5 etc.
They are not part of an ipv6 address.

They might be intended, yet confusing and therefore suspicious.
 
Old 06-03-2024, 12:07 AM   #21
teoberi
Member
 
Registered: Jan 2018
Location: Romania
Distribution: Slackware64-current (servers)/Windows 11/Ubuntu (workstations)
Posts: 624

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
Quote:
Originally Posted by mrsam View Post
I'll just put in another plug for myself. As I mentioned earlier in the thread, I am eating my own dogfood, which, incidentally, solves this problem too. Live example using ntpd:

Code:
root@slackware:~# vlad status system/rc.M/rc.ntpd
system/rc.M/rc.ntpd:
    started (manual) Fri May 31 08:00:42 2024 (2 days ago)
        2005 /usr/sbin/ntpd -g -u ntp:ntp
root@slackware:~# vlad stop system/rc.M/rc.ntpd
Stopping NTP daemon...
root@slackware:~# vlad start system/rc.M/rc.ntpd
Starting NTP daemon:  /usr/sbin/ntpd -g -u ntp:ntp
root@slackware:~# vlad start system/rc.M/rc.ntpd
system/rc.M/rc.ntpd: cannot be started because it's not stopped
root@slackware:~# vlad status system/rc.M/rc.ntpd
system/rc.M/rc.ntpd:
    started (manual) 1 minute ago
        2290 /usr/sbin/ntpd -g -u ntp:ntp
I am not running bind, but it would work pretty much the same way. This problem is solvable.
What do you do if you want to start NTP which is stopped but ntpd.pid has not been deleted?
 
Old 06-03-2024, 05:57 AM   #22
mrsam
LQ Newbie
 
Registered: Jan 2024
Distribution: Fedora, Ubuntu, Slackware
Posts: 14

Rep: Reputation: 11
Quote:
Originally Posted by teoberi View Post
What do you do if you want to start NTP which is stopped but ntpd.pid has not been deleted?
I am not checking for the existence of ntpd.pid, that's not what this is based on. In fact, it looks like the current version of ntpd doesn't even use it. rc.ntpd:

Code:
  echo -n "Stopping NTP daemon..."
  if [ -r /run/ntpd.pid ]; then
    kill -HUP $(cat /run/ntpd.pid)
    rm -f /run/ntpd.pid
  else
    killall -HUP -q ntpd
  fi
  echo
I checked and I don't have run /run/ntpd.pid.

The "start" command runs "rc.<name> start" in its own container (cgroups2). If the container already exists, the service already started and you're informed of that happy fact.

The "stop" command runs "rc.<name> stop" in the same container. If the container does not exist it is stopped. After the stop script finishes any remaining processes in the container are SIGTERMed/SIGKILLed, and the container is removed. Stock slackware rc scripts typically run killall themselves, this is fine, this'll just clean up any rogue processes that the service failed to clean up.
 
Old 06-03-2024, 07:30 AM   #23
teoberi
Member
 
Registered: Jan 2018
Location: Romania
Distribution: Slackware64-current (servers)/Windows 11/Ubuntu (workstations)
Posts: 624

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
Quote:
Originally Posted by mrsam View Post
I am not checking for the existence of ntpd.pid, that's not what this is based on. In fact, it looks like the current version of ntpd doesn't even use it.
It is very correct what you say about ntpd.pid, I have also read about it.
 
Old 06-04-2024, 03:43 PM   #24
metaed
Member
 
Registered: Apr 2022
Location: US
Distribution: Slackware64 15.0
Posts: 379

Rep: Reputation: 175Reputation: 175
The update also came with a change to /etc/logrotate.d/ntp.

Code:
--- ntp 2021-05-21 19:02:19.000000000 +0000
+++ ntp.new     2024-06-04 19:56:51.000000000 +0000
@@ -3,6 +3,6 @@
     missingok
     rotate 4
     postrotate
-    [ -x /etc/rc.d/rc.ntpd ] && /etc/rc.d/rc.ntpd restart
+    ! [ -x /etc/rc.d/rc.ntpd ] || /etc/rc.d/rc.ntpd restart
     endscript
 }
The change probably prevents logrotate from bugging out when rc.ntpd has been made unexecutable. Fine and good.

Postrotate scripts get passed to /bin/sh. Is there some good technical reason why the change was made Bash-only instead of using the portable expression:
[ ! -x /etc/rc.d/rc.ntpd ] || /etc/rc.d/rc.ntpd restart
 
2 members found this post helpful.
Old 06-05-2024, 12:41 PM   #25
volkerdi
Slackware Maintainer
 
Registered: Dec 2002
Location: Minnesota
Distribution: Slackware! :-)
Posts: 2,560

Rep: Reputation: 8601Reputation: 8601Reputation: 8601Reputation: 8601Reputation: 8601Reputation: 8601Reputation: 8601Reputation: 8601Reputation: 8601Reputation: 8601Reputation: 8601
Quote:
Originally Posted by metaed View Post
The update also came with a change to /etc/logrotate.d/ntp.

Code:
--- ntp 2021-05-21 19:02:19.000000000 +0000
+++ ntp.new     2024-06-04 19:56:51.000000000 +0000
@@ -3,6 +3,6 @@
     missingok
     rotate 4
     postrotate
-    [ -x /etc/rc.d/rc.ntpd ] && /etc/rc.d/rc.ntpd restart
+    ! [ -x /etc/rc.d/rc.ntpd ] || /etc/rc.d/rc.ntpd restart
     endscript
 }
The change probably prevents logrotate from bugging out when rc.ntpd has been made unexecutable. Fine and good.

Postrotate scripts get passed to /bin/sh. Is there some good technical reason why the change was made Bash-only instead of using the portable expression:
[ ! -x /etc/rc.d/rc.ntpd ] || /etc/rc.d/rc.ntpd restart
This is what was passed to me as a fix. I've tested it here, and #!/bin/sh seems to accept the syntax just fine.
 
Old 06-06-2024, 07:42 AM   #26
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,388

Rep: Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764
Quote:
This is what was passed to me as a fix.
Consider yourself badly advised. My apologies. @metaed makes valid comment.
 
Old 06-06-2024, 07:45 AM   #27
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,960

Rep: Reputation: 1572Reputation: 1572Reputation: 1572Reputation: 1572Reputation: 1572Reputation: 1572Reputation: 1572Reputation: 1572Reputation: 1572Reputation: 1572Reputation: 1572
So, what is the problem with ! [ -x /etc/rc.d/rc.ntpd ] ?
 
Old 06-06-2024, 10:56 AM   #28
BrunoLafleur
Member
 
Registered: Apr 2020
Location: France
Distribution: Slackware
Posts: 428

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
From https://pubs.opengroup.org/onlinepub...V3_chap02.html :

Quote:
2.9.2 Pipelines

A pipeline is a sequence of one or more commands separated by the control operator '|'. For each command but the last, the shell shall connect the standard output of the command to the standard input of the next command as if by creating a pipe and passing the write end of the pipe as the standard output of the command and the read end of the pipe as the standard input of the next command.

The format for a pipeline is:

[!] command1 [ | command2 ...]

If the pipeline begins with the reserved word ! and command1 is a subshell command, the application shall ensure that the ( operator at the beginning of command1 is separated from the ! by one or more <blank> characters. The behavior of the reserved word ! immediately followed by the ( operator is unspecified.

The standard output of command1 shall be connected to the standard input of command2. The standard input, standard output, or both of a command shall be considered to be assigned by the pipeline before any redirection specified by redirection operators that are part of the command (see Redirection).

If the pipeline is not in the background (see Asynchronous Lists), the shell shall wait for the last command specified in the pipeline to complete, and may also wait for all commands to complete.
Exit Status

If the pipeline does not begin with the ! reserved word, the exit status shall be the exit status of the last command specified in the pipeline. Otherwise, the exit status shall be the logical NOT of the exit status of the last command. That is, if the last command returns zero, the exit status shall be 1; if the last command returns greater than zero, the exit status shall be zero.
So it is Posix and deals well with the intended fix.
 
2 members found this post helpful.
Old 06-07-2024, 08:30 AM   #29
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,388

Rep: Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764
Thanks @BrunoLafleur for confirming that my suggested fix is POSIX compliant to implement the required logic.
 
Old 06-07-2024, 05:54 PM   #30
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
Back on topic, I have tested and confirmed that the problem in post #1 of this thread only happens on machines which have a static IPv4 address set up.

I don't use IPv6 at all, but the errors in post #1 don't happen on any of the machines here which are set up to use DHCP with IPv4.

Edit: To clarify, on the machines with a static IP, the fix is to add the "-4" flag to the options in /etc/default/ntp in the newest versions of the ntp package.

Last edited by rkelsen; 06-07-2024 at 05:56 PM.
 
1 members found this post helpful.
  


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 05:47 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