RHEL 7 – Notes: NTP:Chronyd

Update ntp server in RHEL7 using new chronyd.service

vi /etc/chrony.conf
systemctl restart chronyd.service
systemctl enable chronyd.service
chronyc sources -v
#timedatectl
Local time: Tue 2015-12-22 04:21:22 EST
Universal time: Tue 2015-12-22 09:21:22 UTC
RTC time: Tue 2015-12-22 09:21:22
Time zone: America/New_York (EST, -0500)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: no
Last DST change: DST ended at
Sun 2015-11-01 01:59:59 EDT
Sun 2015-11-01 01:00:00 EST
Next DST change: DST begins (the clock jumps one hour forward) at
Sun 2016-03-13 01:59:59 EST
Sun 2016-03-13 03:00:00 EDT

#timedatectl list-timezones
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Bamako

#How to change time zone

#timedatectl
Local time: Tue 2015-12-22 04:23:16 EST
Universal time: Tue 2015-12-22 09:23:16 UTC
RTC time: Tue 2015-12-22 09:23:15
       Time zone: America/New_York (EST, -0500)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: no
Last DST change: DST ended at
Sun 2015-11-01 01:59:59 EDT
Sun 2015-11-01 01:00:00 EST
Next DST change: DST begins (the clock jumps one hour forward) at
Sun 2016-03-13 01:59:59 EST
Sun 2016-03-13 03:00:00 EDT

# timedatectl set-timezone Asia/Singapore

# timedatectl
Local time: Tue 2015-12-22 17:23:29 SGT
Universal time: Tue 2015-12-22 09:23:29 UTC
RTC time: Tue 2015-12-22 09:23:29
Time zone: Asia/Singapore (SGT, +0800)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a

RHEL 7 – Notes: rsyslog

echo “*.debug /var/log/messages-debug” > debug.conf
cat debug.conf
systemctl restart rsyslog
systemctl status rsyslog
logger -p user.debug “this is test message”
tailf /var/log/messages-debug

RHEL 7 – Notes: Journalctl

Journalctl to view system logs:

===========================

journalctl -n
journalctl -n 5
journalctl -p err
journalctl –since today
journalctl –since “2015-12-22 02:00:00” –until “2015-12-22 03:00:00”
journalctl -o verbose

journalctl _PID=1

journalctl -b (since last reboot if they were made persistent)

 

How to make persistent:

mkdir /var/log/journal

chown root:systemd-journal /var/log/journal

chmod 2755 /var/log/journal

kilall -USR1 systemd-journald