ãããç§ããã¹ããããä»®æ³ã¤ã³ã¿ãã§ã¼ã¹ãè½ã¡ã話
ä»ææ«ã¯ãããç§ãäºå®ããã¦ãã¾ããã
http://jjy.nict.go.jp/news/leaps2015.html
ããã«ã¤ãã¦ã¯æ§ã ãªã¨ããã§ãä½ãå½±é¿ãåããï¼ããã©ã対å¿ããï¼ããªã©ãæ¸ããã¦ãã¾ãã
ä»åã¯ãã®ä¸ã§ãããäºåã«è©¦é¨ç°å¢ã§ãããç§ãå
¥ãã¦ã¿ãããã¨ã«ã¤ãã¦RedHatã®è¨äºãæ¸ããã¦ããã®ã§ããã®ã話ã
How to clear the Leap Second Insertion flag after it has been received?
ãã®è¨äºã®ä¸ã§ã¯ leap-a-day.c ã¨ããã³ã¼ããå ¬éããã¦ãã¦ãç°¡åã«è¨ãã¨
- ntpdã«ãããç§ã®éç¥ãè¡ã (adjtimex)
- ãããç§ã®ç´åã¾ã§æå»ãé²ãã (settimeofday)
ã¨ãããã¨ããã£ã¦ããã¾ãã
ããã試é¨ç°å¢ã§å®è¡ããã¨ãããä»®æ³ãããã¯ã¼ã¯ã¤ã³ã¿ãã§ã¼ã¹(IP alias)ãè½ã¡ãã®ã§ãåç¾æ¡ä»¶ãè¨é²ãã¦ããã¾ãã
ãªãããã®åé¡ã«ãããç§ã¯æ¬è³ªçã«é¢ä¿ããã¾ããã
OS
CentOS 6.4 2.6.32-358.23.2.el6.x86_64 on VirtualBox
ãããã¯ã¼ã¯è¨å®
eth0 â DHCP (staticã«ããªã)
/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0 HWADDR=08:00:27:B8:4B:7E TYPE=Ethernet UUID=0402e253-5c54-44cc-9611-141c5b00c5f0 ONBOOT=yes #NM_CONTROLLED=no BOOTPROTO=dhcp DNS1=192.168.60.100 IPV6INIT=no
eth0:0 â static
/etc/sysconfig/network-scripts/ifcfg-eth0:0
DEVICE=eth0:0 ONBOOT=yes IPADDR=192.168.60.144 NETMASK=255.255.255.0 BOOTPROTO=static ONBOOT=yes USERCTL=no
æºå
- VMã®å¤ããIP alias (192.168.60.144) ã«pingãæã¡ã£ã±ãªãã«ãã¦ãã
- leap-a-day.c ãã³ã³ãã¤ã«ãã¦ãã
- tail -f /var/log/messages ãã¦ãã
åç¾å®é¨
./leap-a-day -s
ãã°ããå¦çãé²ãã§ãã^Cã§æ¢ãã
syslogã以ä¸ã®ããã«åºåãããã
Jun 20 08:59:59 ku0001 kernel: Clock: inserting leap second 23:59:60 UTC Jun 21 09:00:00 ku0001 kernel: Clock: deleting leap second 23:59:59 UTC Jun 22 08:59:59 ku0001 kernel: Clock: inserting leap second 23:59:60 UTC Jun 23 09:00:00 ku0001 kernel: Clock: deleting leap second 23:59:59 UTC Jun 24 09:01:14 ku0001 dhclient[1977]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6 (xid=0x59ff7945) Jun 24 09:01:15 ku0001 dhclient[1977]: DHCPOFFER from 192.168.60.100 Jun 24 09:01:15 ku0001 dhclient[1977]: DHCPREQUEST on eth0 to 255.255.255.255 port 67 (xid=0x59ff7945) Jun 24 09:01:15 ku0001 dhclient[1977]: DHCPACK from 192.168.60.100 (xid=0x59ff7945) Jun 24 09:01:16 ku0001 ntpd[1274]: Deleting interface #10 eth0, 192.168.60.10#123, interface stats: received=9, sent=9, dropped=0, active_time=179 secs Jun 24 09:01:16 ku0001 ntpd[1274]: Deleting interface #11 eth0:0, 192.168.60.144#123, interface stats: received=0, sent=0, dropped=0, active_time=176 secs Jun 24 09:01:18 ku0001 NET[2173]: /sbin/dhclient-script : updated /etc/resolv.conf Jun 24 09:01:18 ku0001 dhclient[1977]: bound to 192.168.60.10 -- renewal in 298 seconds. Jun 24 09:01:19 ku0001 ntpd[1274]: Listening on interface #13 eth0, 192.168.60.10#123 Enabled Jun 24 09:06:16 ku0001 dhclient[1977]: DHCPREQUEST on eth0 to 192.168.60.100 port 67 (xid=0x59ff7945) Jun 24 09:06:16 ku0001 dhclient[1977]: DHCPACK from 192.168.60.100 (xid=0x59ff7945) Jun 24 09:06:17 ku0001 dhclient[1977]: bound to 192.168.60.10 -- renewal in 240 seconds.
eth0:0ãè½ã¡ã¦ãã
$ ifconfig | eth0 eth0 Link encap:Ethernet HWaddr 08:00:27:B8:4B:7E
pingãçéããªããªã£ã¦ãã
64 bytes from 192.168.60.144: icmp_seq=96 ttl=64 time=0.234 ms 64 bytes from 192.168.60.144: icmp_seq=97 ttl=64 time=0.219 ms 64 bytes from 192.168.60.144: icmp_seq=98 ttl=64 time=0.186 ms From 192.168.60.144 icmp_seq=137 Destination Host Unreachable From 192.168.60.144 icmp_seq=138 Destination Host Unreachable From 192.168.60.144 icmp_seq=139 Destination Host Unreachable
ä½ãèµ·ãã¦ããã®ã
ã©ãããleap-a-dayã«ãã£ã¦æ¥ä»ãé²ã¿ãdhclientãDHCPã®ãªã¼ã¹æéã大å¹
è¶
éããã¨ã¿ãªãããã®ã¨ãã®eth0ããã³aliasãä¸åº¦å
¨ã¦è½ã¨ãã¦ãã¾ã£ã¦ããããã§ãã
ãã®å¾DHCPã§eth0ã¯åè¨å®ããã¾ãããeth0:0ã¯å
ã«æ»ããªãããã§ãã
syslogã«ã¯ntpdãinterfaceãåé¤ãããããªãã°ãåºã¾ãããntpdãæ¶ãã¯ãã¯ãã¡ãããªããããã¯bindãã¦ããã¤ã³ã¿ãã§ã¼ã¹ãè½ã¨ããããã¨ãæ¤ç¥ãã¦ããã ãã¿ããã§ãã
é çªã¨ãã¦ã¯syslogããããããã¨ãã以ä¸ã®ããã«åãã¦ãã¾ãã
- dhclientãèµ·åãã
- ãªã¼ã¹æéãåãã¦ããã®ã§ã¤ã³ã¿ãã§ã¼ã¹ãå ¨é¨(eth0, eth0:0)è½ã¡ã
- ããã«hookãã¦ntpdãbindãã¦ããã¤ã³ã¿ãã§ã¼ã¹ãå ¨é¨(eth0, eth0:0)å¤ã
- dhclientãDHCPã§IPã¢ãã¬ã¹ã(eth0ã ã)è¨å®ããªãã
- ntpdãeth0ã®ã¿ã«bindãã
å ã«æ»ã
ntpdateã§æå»ãå
ã«æ»ããservice network restartã§å
éãã«ãªãã¾ãã
ããã«ãã¦ããã®æåã¯ä¸ä¾¿â¦
æè¨ãé²ããã¨ãã¯æ°ãã¤ãã¾ãããã