View previous topic :: View next topic |
Author |
Message |
turtles Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/8003843766096d82d4fbf9.png)
Joined: 31 Dec 2004 Posts: 1698
|
Posted: Sun Mar 11, 2018 8:51 pm Post subject: net-misc/ntpclient set the system clock once and exit? |
|
|
Greetings all I tried to use ntpclient today to adjust my laptops clock today for daylight savings time
Code: | ntpclient -s -h pool.ntp.org |
No success.
Is there documentation available for net-misc/ntpclient ?
It seems the Gentoo version is actually a fork of the doolittle one:
http://doolittle.icarus.com/ntpclient/HOWTO
Gives nothing.
https://www.eecis.udel.edu/~mills/ntp/html/index.html
Gives too much
The webiste listed on the ebuild is not helpfull it is just a github account and has no docs.
https://github.com/troglobit/ntpclient
The Gentoo WIKI refers to a different ntp-client
I noticed my first problem is the -h option has different behavior than the doolottle one,
It displays the following help text instead of meaning 'host':
Code: | Usage: ntpclient [-dlnstv] [-c count] [-f frequency] [-g goodness]
[-i interval] [-p port] [-q min_delay] [-L] SERVER
Options:
-c count Stop after count time measurements. Default: 0 (forever)
-d Debug, or diagnostics mode Possible to enable more at compile
-f frequency Initialize frequency offset. Linux only, requires root
-g goodness Stop after getting a result more accurate than goodness msec,
microseconds. Default: 0 (forever)
-h Show summary of command line options and exit
-i interval Check time every interval seconds. Default: 600
-l Attempt to lock local clock to server using adjtimex(2)
-L Use syslog instead of stdout for log messages, enabled
by default when started as root
-n Don't fork. Prevents ntpclient from daemonizing by default
Only when running as root, does nothing for regular users
Use -L with this to use syslog as well, for Finit + systemd
-p port NTP client UDP port. Default: 0 ("any available")
-q min_delay Minimum packet delay for transaction (default 800 microseconds)
-s Simple clock set, implies -c 1 unless -l is also set
-t Trust network and server, no RFC-4330 recommended validation
-v Be verbose. This option will cause time sync events, hostname
lookup errors and program version to be displayed
-V Display version and copyright information
Arguments:
SERVER NTP server, mandatory, against which to sync system time
Bug report address: https://github.com/troglobit/ntpclient/issues
Project homepage: https://github.com/troglobit/ntpclient |
So I see I need to run it with the -n Flag to get errors printed to stdout
I have tried a few combinations of stuff:
Code: | ntpclient -dstvn pool.ntp.org |
Code: | ntpclient -dstvn http://pool.ntp.org |
Gives me:
Quote: | ERROR - Failed creating UDP socket() to SNTP server: Address family not supported by protocol |
(And yes I know about https://chrony.tuxfamily.org)
I am really curious if net-misc/ntpclient will set the system clock once and exit?
Thanks in advance! _________________ Donate to Gentoo |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Ant P. Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Sun Mar 11, 2018 10:28 pm Post subject: |
|
|
DST is handled by your /etc/timezone setting, NTP just sets the internal UTC time. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
NeddySeagoon Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
![](images/avatars/3946266373f47d606a2db3.jpg)
Joined: 05 Jul 2003 Posts: 54827 Location: 56N 3W
|
Posted: Sun Mar 11, 2018 10:42 pm Post subject: |
|
|
turtles,
turtles wrote: | I am really curious if net-misc/ntpclient will set the system clock once and exit? |
That's all it does.
Like Ant P. says, your internal clock should be UTC and all offsets from UTC are controlled by your timezone.
Its more complex if you dual boot with Windows. You need to let Windows deal with daylight saving time. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
turtles Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/8003843766096d82d4fbf9.png)
Joined: 31 Dec 2004 Posts: 1698
|
Posted: Mon Mar 12, 2018 3:57 am Post subject: |
|
|
Oh yeah Its been a while since I thought about it
So I have a
/etc/timezone of :
Code: | America/Los_Angeles |
and DST did not got set. Strange. _________________ Donate to Gentoo |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
turtles Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/8003843766096d82d4fbf9.png)
Joined: 31 Dec 2004 Posts: 1698
|
Posted: Mon Mar 12, 2018 5:13 pm Post subject: |
|
|
Greetings all
my main issue was ntpclient not working
Code: | ntpclient -dstvn pool.ntp.org |
would give me:
Quote: | ERROR - Failed creating UDP socket() to SNTP server: Address family not supported by protocol |
I traced the problem down to booting with
My guess is net-misc/ntpclient should use IPV4 if IPV6 is present and disabled.
When I temporarily removed ipv6.disable=1 from my grub command line and rebooted net-misc/ntpclient was able to set the time and exit without any command line options:
Code: | ntpclient pool.ntp.org |
As for the side issue of DST not getting set upon further investigation I had set /etc/conf.d/hwclock
to
This apparently disables sys-apps/openrc-0.34.11 from handling DST.
I have since set it to clock="UTC" and (hopefully) configured windows to use UTC also.
Perhaps this is also a bug in sys-apps/openrc?
Cheers
Turtles _________________ Donate to Gentoo |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|