RHEL7.0, 6.5でタイムゾーン設定
忘れないようにメモ。
こちらも参考に
実践でも役立つLPICドリル(8):Linux時刻管理の仕組みと設定 (1/4) - @IT
RHEL6.5 HVM AMI (RHEL-6.5_HVM_GA-x86_64-7-HVM-Hourly2 - ami-53641e52 Tokyo Region)の場合
$ ls -l /etc/localtime -rw-r--r--. 1 root root 3519 4月 21 15:49 2014 /etc/localtime $ diff /etc/localtime /usr/share/zoneinfo/America/New_York $ date 2014年 8月 5日 火曜日 21:32:29 EDT
と、/etc/localtime がシンボリックリンクではなく実体コピーとなっていてEDTとなる。
$ sudo ln -f -s /usr/share/zoneinfo/Asia/Tokyo /etc/localtime $ ls -l /etc/localtime lrwxrwxrwx. 1 root root 30 8月 6 10:34 2014 /etc/localtime -> /usr/share/zoneinfo/Asia/Tokyo $ date 2014年 8月 6日 水曜日 10:34:27 JST
となる
注意: /etc/adjtime にUTCと書いてあること(LOCALと書いていないこと)を確認する。EC2の物理マシンはUTCで設定されているので念の為。
RHEL7.0 HVM AMI (ami-87206d86 Tokyo Region)の場合
ls -l /etc/localtime
lrwxrwxrwx. 1 root root 38 5月 22 15:16 /etc/localtime -> ../usr/share/zoneinfo/America/New_York
となっているので、タイムゾーンは以下のようにEDTとなっている
$ date 2014年 8月 5日 火曜日 21:11:40 EDT
そこで
$ sudo timedatectl set-timezone Asia/Tokyo
とすると、
$ ls -l /etc/localtime lrwxrwxrwx. 1 root root 32 8月 6 10:37 /etc/localtime -> ../usr/share/zoneinfo/Asia/Tokyo $ date 2014年 8月 6日 水曜日 10:18:18 JST
となる
参考 Chapter 2. Configuring the Date and Time