Difference between revisions of "Package:Chrony"

m
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
{{Ebuild
 +
|Summary=Chrony is a pair of programs (chronyd and chronyc) which are used to maintain the accuracy of the system clock on a computer. chronyd has been specifically written to work well for systems which have only an intermittent (e.g. dial-up) connection to the network where the NTP servers are. It still works well in a "permanently connected" mode.
 +
|CatPkg=net-misc/chrony
 +
|Homepage=http://chrony.tuxfamily.org/
 +
}}
 +
 
=== Accurate System Time (NTP) ===
 
=== Accurate System Time (NTP) ===
  
 
It's important that your Funtoo Linux system has an accurate clock. NTP (network time protocol) can ensure your clock is accurate at all time.
 
It's important that your Funtoo Linux system has an accurate clock. NTP (network time protocol) can ensure your clock is accurate at all time.
  
My favorite and recommended NTP client/server is '''{{Package|net-misc/chrony}}'''. It is recommended for Funtoo systems:
+
The recommended NTP client/server is '''{{Package|net-misc/chrony}}'''.
  
<console>
+
{{console|body=
 
###i## emerge chrony
 
###i## emerge chrony
###i## rc-update add chronyd default
+
}}
</console>
+
  
Use something like the following for your <tt>/etc/chrony/chrony.conf</tt>:
+
{{important|Chrony ''' ''requires'' ''' you set an upstream ntp server.}}
 +
 
 +
For broadband users:
 +
{{console|body=###i## echo "server pool.ntp.org iburst" >> /etc/chrony/chrony.conf}}
 +
 
 +
For dial up or slow connections:
 +
{{console|body=###i## echo "server pool.ntp.org offline" >> /etc/chrony/chrony.conf}}
 +
 
 +
Use something like the following for your {{c|/etc/chrony/chrony.conf}}:
  
 
<pre>
 
<pre>
Line 31: Line 44:
 
</pre>
 
</pre>
  
Chronyd can then be started immediately by running <tt>rc</tt> to start all new services:
+
Chronyd can then be started immediately by running <code>rc</code> to start all new services:
  
<console>
+
=== Set Time ===
# ##i##rc
+
To test chronyd, set the time immediately, & exit:
</console>
+
{{console|body=###i## chronyd -q}}
  
Because Funtoo Linux starts network daemons without waiting for an Internet connection to become available, and because chrony will attempt to synchronize the clock over the Internet when it first starts, you must manually configure chronyd to be dependent on whatever method you use to enable your outbound network connectivity. For example, if using <tt>dhcpcd</tt>, add the following to <tt>/etc/conf.d/chronyd</tt>:
+
=== Service ===
 +
To start the chronyd service:
 +
{{console|body=
 +
###i## rc-update add chronyd default
 +
###i## rc
 +
}}
 +
 
 +
Because Funtoo Linux starts network daemons without waiting for an Internet connection to become available, and because chrony will attempt to synchronize the clock over the Internet when it first starts, you must manually configure chronyd to be dependent on whatever method you use to enable your outbound network connectivity. For example, if using {{c|dhcpcd}}, add the following to {{c|/etc/conf.d/chronyd}}:
  
 
<pre>
 
<pre>
Line 43: Line 63:
 
</pre>
 
</pre>
  
You should notice a marked improvement in your system clock's accuracy. If your system time was off by a significant amount, <tt>chronyd</tt> will gradually correct your clock while the system runs.
+
You should notice a marked improvement in your system clock's accuracy. If your system time was off by a significant amount, {{c|chronyd}} will gradually correct your clock while the system runs.
 +
 
 +
==== Hardware Clock ====
 +
To write your NTP sync time to the hardware at shutdown, and read hw clock at start.
 +
 
 +
{{console|body=
 +
###i## echo 'clock_hctosys="YES"' >> /etc/conf.d/hwclock
 +
###i## echo 'clock_systohc="YES"' >> /etc/conf.d/hwclock
 +
###i## rc-service hwclock restart
 +
###i## rc-update add hwclock boot
 +
}}
 +
 
 
[[Category:System]]
 
[[Category:System]]
 +
[[Category:Official Documentation]]
 +
 +
{{EbuildFooter}}

Latest revision as of 02:05, May 30, 2015

net-misc/chrony


Source Repository:Repository:Gentoo Portage Tree

http://chrony.tuxfamily.org/

Summary: Chrony is a pair of programs (chronyd and chronyc) which are used to maintain the accuracy of the system clock on a computer. chronyd has been specifically written to work well for systems which have only an intermittent (e.g. dial-up) connection to the network where the NTP servers are. It still works well in a "permanently connected" mode.

Use Flags

cmdmon
Support for command and monitoring
ntp
Support for the Network Time Protocol (NTP)
phc
Support for the PTP (Precision Time Protocol) Hardware Clock (PHC) interface
pps
Support for the Linux Pulse Per Second (PPS) interface
refclock
Support for reference clocks
rtc
Support for the Linux Real Time Clock interface
adns
Support for asynchronous DNS

News

Drobbins

IP Space Migration Continues

All Funtoo user containers in the 8.28 IP space will be moving into our new IP space (172.97) over the next few days. If you have DNS set up -- be sure to watch your container and update to the new IP! container.host.funtoo.org DNS will be updated after the move.
2015-08-27 by Drobbins
Drobbins

Funtoo Hosting IP Move

Funtoo user containers with IPs in the 72.18.x.x range will be gradually migrating to new IP addresses this week. If you have DNS entries for your containers, please be aware that your DNS will need to be updated.
2015-08-11 by Drobbins
Drobbins

New ARM Stages

New ARM Stages, built with a new toolchain, are now hitting mirrors. Existing ARM users should re-install using these stages (dated Aug 3, 2015 or later,) rather than upgrade using emerge.
2015-08-06 by Drobbins
More...

Chrony

Tip

We welcome improvements to this page. To edit this page, Create a Funtoo account. Then log in and then click here to edit this page. See our editing guidelines to becoming a wiki-editing pro.


Accurate System Time (NTP)

It's important that your Funtoo Linux system has an accurate clock. NTP (network time protocol) can ensure your clock is accurate at all time.

The recommended NTP client/server is Package:Chrony.

# emerge chrony


Important

Chrony requires you set an upstream ntp server.

For broadband users:

# echo "server pool.ntp.org iburst" >> /etc/chrony/chrony.conf


For dial up or slow connections:

# echo "server pool.ntp.org offline" >> /etc/chrony/chrony.conf


Use something like the following for your /etc/chrony/chrony.conf:

server time.apple.com
maxupdateskew 100
driftfile /etc/chrony/chrony.drift
keyfile /etc/chrony/chrony.keys
commandkey 1
dumponexit
dumpdir /var/log/chrony
initstepslew 10 time.apple.com
logdir /var/log/chrony
log measurements statistics tracking
logchange 0.5
mailonchange me@emailprovider.com 0.5
rtcfile /etc/chrony/chrony.rtc
rtconutc
sched_priority 1
lock_all

Chronyd can then be started immediately by running rc to start all new services:

Set Time

To test chronyd, set the time immediately, & exit:

# chronyd -q


Service

To start the chronyd service:

# rc-update add chronyd default
# rc


Because Funtoo Linux starts network daemons without waiting for an Internet connection to become available, and because chrony will attempt to synchronize the clock over the Internet when it first starts, you must manually configure chronyd to be dependent on whatever method you use to enable your outbound network connectivity. For example, if using dhcpcd, add the following to /etc/conf.d/chronyd:

rc_need=dhcpcd

You should notice a marked improvement in your system clock's accuracy. If your system time was off by a significant amount, chronyd will gradually correct your clock while the system runs.

Hardware Clock

To write your NTP sync time to the hardware at shutdown, and read hw clock at start.

# echo 'clock_hctosys="YES"' >> /etc/conf.d/hwclock
# echo 'clock_systohc="YES"' >> /etc/conf.d/hwclock
# rc-service hwclock restart
# rc-update add hwclock boot