I want to ensure that the logs written, have the correct timestamp.

So, when ntpd completes the sync (ntpq -c rv displays sync_ntp), I want to restart rsyslogd. But I am not finding any hooks/config to do this!

Also, I am not sure, if I should be doing this in ntpd or rsyslog config (if possible)?

Any help, or workarounds to achieve this?

  • 2
    Are you sure you need to do that? Why wouldn't rsyslog just begin using the new time after it had been set? – Celada Dec 22 '14 at 18:37
  • After ntpd synced the time, I was still seeing that the logs in /var/log/syslog was showing older timestamps, and rsyslogd restart fixed it. But, I wanted to do it automatically, rather than manually. Or, I'm not sure if I'm missing some config in rsyslogd! – vyom Dec 23 '14 at 3:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.