Fellow armv7-without-rtc-battery users. Maybe you have already learned this, but I THINK I have completed my education on this thanks to Miroslav Lichvar on the Chrony list.
There are two issues here: It takes time for chronyd to set the system time. And if it fails to reach the ntp servers, well, it failed to set the time.
For the first, we need to delay some services from starting until chronyd is successful. Postfix is one of them. So we need the following commands:
systemctl enable chrony-wait systemctl start chrony-wait sed -i '/^After=/ s/$/ time-sync.target/w /dev/stdout' /usr/lib/systemd/system/postfix.service
There are some possible instances where you also want to do this to httpd.service, but I have been advised on the postfix list NOT to run postfix if the systemtime is earlier than the postfix build date
$ postconf -dh mail_release_date 20130622
Plus the postfix.service runs aliases.db which will mess up your aliases.db timestamp.
Next there is that pesky issue about what if no ntp servers reached?
First:
cat <<EOF>/etc/sysconfig/chronyd || exit 1 OPTIONS=" -s" EOF
Since Centos7 has Chronyd 2.1.1, not 2.2, we have extra work to do in chronyd.conf:
cat <<EOF>>/etc/chrony.conf || exit 1 rtcdevice /dev/doesnotexist EOF
I am adding this to my basic server howto page.
I have updated:
http://medon.htt-consult.com/Centos7-armv7.html
With the Chronyd caveats and enabling rgn-tools.
On 04/21/2017 09:03 AM, Robert Moskowitz wrote:
Fellow armv7-without-rtc-battery users. Maybe you have already learned this, but I THINK I have completed my education on this thanks to Miroslav Lichvar on the Chrony list.
There are two issues here: It takes time for chronyd to set the system time. And if it fails to reach the ntp servers, well, it failed to set the time.
For the first, we need to delay some services from starting until chronyd is successful. Postfix is one of them. So we need the following commands:
systemctl enable chrony-wait systemctl start chrony-wait sed -i '/^After=/ s/$/ time-sync.target/w /dev/stdout' /usr/lib/systemd/system/postfix.service
There are some possible instances where you also want to do this to httpd.service, but I have been advised on the postfix list NOT to run postfix if the systemtime is earlier than the postfix build date
$ postconf -dh mail_release_date 20130622
Plus the postfix.service runs aliases.db which will mess up your aliases.db timestamp.
Next there is that pesky issue about what if no ntp servers reached?
First:
cat <<EOF>/etc/sysconfig/chronyd || exit 1 OPTIONS=" -s" EOF
Since Centos7 has Chronyd 2.1.1, not 2.2, we have extra work to do in chronyd.conf:
cat <<EOF>>/etc/chrony.conf || exit 1 rtcdevice /dev/doesnotexist EOF
I am adding this to my basic server howto page.
Arm-dev mailing list Arm-dev@centos.org https://lists.centos.org/mailman/listinfo/arm-dev
On 04/21/2017 06:03 AM, Robert Moskowitz wrote:
Fellow armv7-without-rtc-battery users. Maybe you have already learned this, but I THINK I have completed my education on this thanks to Miroslav Lichvar on the Chrony list.
There are two issues here: It takes time for chronyd to set the system time. And if it fails to reach the ntp servers, well, it failed to set the time.
For the first, we need to delay some services from starting until chronyd is successful. Postfix is one of them. So we need the following commands:
systemctl enable chrony-wait systemctl start chrony-wait sed -i '/^After=/ s/$/ time-sync.target/w /dev/stdout' /usr/lib/systemd/system/postfix.service
You're not going to want to do this here. Because systemd has a concept of overrides, administrator modifications should go in /etc/systemd/system, rather than directly modifying /usr/lib/systemd/* files. This will keep your changes across updates.
There are some possible instances where you also want to do this to httpd.service, but I have been advised on the postfix list NOT to run postfix if the systemtime is earlier than the postfix build date
$ postconf -dh mail_release_date 20130622
Plus the postfix.service runs aliases.db which will mess up your aliases.db timestamp.
Next there is that pesky issue about what if no ntp servers reached?
First:
cat <<EOF>/etc/sysconfig/chronyd || exit 1 OPTIONS=" -s" EOF
Since Centos7 has Chronyd 2.1.1, not 2.2, we have extra work to do in chronyd.conf:
cat <<EOF>>/etc/chrony.conf || exit 1 rtcdevice /dev/doesnotexist EOF
I am adding this to my basic server howto page.
Arm-dev mailing list Arm-dev@centos.org https://lists.centos.org/mailman/listinfo/arm-dev
On 04/22/2017 07:43 PM, Jim Perrin wrote:
On 04/21/2017 06:03 AM, Robert Moskowitz wrote:
Fellow armv7-without-rtc-battery users. Maybe you have already learned this, but I THINK I have completed my education on this thanks to Miroslav Lichvar on the Chrony list.
There are two issues here: It takes time for chronyd to set the system time. And if it fails to reach the ntp servers, well, it failed to set the time.
For the first, we need to delay some services from starting until chronyd is successful. Postfix is one of them. So we need the following commands:
systemctl enable chrony-wait systemctl start chrony-wait sed -i '/^After=/ s/$/ time-sync.target/w /dev/stdout' /usr/lib/systemd/system/postfix.service
You're not going to want to do this here. Because systemd has a concept of overrides, administrator modifications should go in /etc/systemd/system, rather than directly modifying /usr/lib/systemd/* files. This will keep your changes across updates.
I did not like changing postfix.service, but I have not found how to modify the After= instructions through /etc/systemd/system.
Can you point me to instructions? I looked at
/etc/systemd/system/multi-user.target.wants/postfix.service
And the change I made to /usr/lib/systemd/system/postfix.service carried over, and the timestamp in /etc/systemd did not change. Strange.
thanks
There are some possible instances where you also want to do this to httpd.service, but I have been advised on the postfix list NOT to run postfix if the systemtime is earlier than the postfix build date
$ postconf -dh mail_release_date 20130622
Plus the postfix.service runs aliases.db which will mess up your aliases.db timestamp.
Next there is that pesky issue about what if no ntp servers reached?
First:
cat <<EOF>/etc/sysconfig/chronyd || exit 1 OPTIONS=" -s" EOF
Since Centos7 has Chronyd 2.1.1, not 2.2, we have extra work to do in chronyd.conf:
cat <<EOF>>/etc/chrony.conf || exit 1 rtcdevice /dev/doesnotexist EOF
I am adding this to my basic server howto page.
Arm-dev mailing list Arm-dev@centos.org https://lists.centos.org/mailman/listinfo/arm-dev
On 04/23/2017 02:11 PM, Robert Moskowitz wrote:
On 04/22/2017 07:43 PM, Jim Perrin wrote:
On 04/21/2017 06:03 AM, Robert Moskowitz wrote:
Fellow armv7-without-rtc-battery users. Maybe you have already learned this, but I THINK I have completed my education on this thanks to Miroslav Lichvar on the Chrony list.
There are two issues here: It takes time for chronyd to set the system time. And if it fails to reach the ntp servers, well, it failed to set the time.
For the first, we need to delay some services from starting until chronyd is successful. Postfix is one of them. So we need the following commands:
systemctl enable chrony-wait systemctl start chrony-wait sed -i '/^After=/ s/$/ time-sync.target/w /dev/stdout' /usr/lib/systemd/system/postfix.service
You're not going to want to do this here. Because systemd has a concept of overrides, administrator modifications should go in /etc/systemd/system, rather than directly modifying /usr/lib/systemd/* files. This will keep your changes across updates.
I did not like changing postfix.service, but I have not found how to modify the After= instructions through /etc/systemd/system.
Can you point me to instructions? I looked at
/etc/systemd/system/multi-user.target.wants/postfix.service
And the change I made to /usr/lib/systemd/system/postfix.service carried over, and the timestamp in /etc/systemd did not change. Strange.
Meanwhile, I changed the SED command to:
sed -i '/^After=/ s/$/ time-sync.target/w /dev/stdout' /etc/systemd/system/*.wants/postfix.service
For each .service, it seems challenging to know which *.wants directory it ends up in. The wildcard seems to work here.
thanks
There are some possible instances where you also want to do this to httpd.service, but I have been advised on the postfix list NOT to run postfix if the systemtime is earlier than the postfix build date
$ postconf -dh mail_release_date 20130622
Plus the postfix.service runs aliases.db which will mess up your aliases.db timestamp.
Next there is that pesky issue about what if no ntp servers reached?
First:
cat <<EOF>/etc/sysconfig/chronyd || exit 1 OPTIONS=" -s" EOF
Since Centos7 has Chronyd 2.1.1, not 2.2, we have extra work to do in chronyd.conf:
cat <<EOF>>/etc/chrony.conf || exit 1 rtcdevice /dev/doesnotexist EOF
I am adding this to my basic server howto page.
Arm-dev mailing list Arm-dev@centos.org https://lists.centos.org/mailman/listinfo/arm-dev
Arm-dev mailing list Arm-dev@centos.org https://lists.centos.org/mailman/listinfo/arm-dev
On 04/23/2017 11:21 AM, Robert Moskowitz wrote:
Can you point me to instructions? I looked at
/etc/systemd/system/multi-user.target.wants/postfix.service
The easy way is 'systemctl edit postfix' This will create appropriate file in /etc/systemd/system/postfix.d/override.conf. (or something like that) and you can go from there. Once you're sure exactly where the file will be then you can mess with it some more.
And the change I made to /usr/lib/systemd/system/postfix.service carried over, and the timestamp in /etc/systemd did not change. Strange.
If you didn't systemctl daemon-reload, then that would be why.
On 04/24/2017 04:53 PM, Jim Perrin wrote:
On 04/23/2017 11:21 AM, Robert Moskowitz wrote:
Can you point me to instructions? I looked at
/etc/systemd/system/multi-user.target.wants/postfix.service
The easy way is 'systemctl edit postfix' This will create appropriate file in /etc/systemd/system/postfix.d/override.conf. (or something like that) and you can go from there. Once you're sure exactly where the file will be then you can mess with it some more.
I am beginning to see...
I will have to develop a command that takes the current After= line out of the default. service, append the wait-time and put that command into this override.conf file. A bit of a challenge.
And the change I made to /usr/lib/systemd/system/postfix.service carried over, and the timestamp in /etc/systemd did not change. Strange.
If you didn't systemctl daemon-reload, then that would be why.
No I did not. I just did a systemctl restart postfix after the editing.
This is a test server. Only a test server. My howto is such that I can start from a base image and get the working image up to current in about 1 hour, so once I work out enough of these issues, I will restart the process.
thanks
On 04/24/2017 04:53 PM, Jim Perrin wrote:
On 04/23/2017 11:21 AM, Robert Moskowitz wrote:
Can you point me to instructions? I looked at
/etc/systemd/system/multi-user.target.wants/postfix.service
The easy way is 'systemctl edit postfix' This will create appropriate file in /etc/systemd/system/postfix.d/override.conf. (or something like that) and you can go from there. Once you're sure exactly where the file will be then you can mess with it some more.
And the change I made to /usr/lib/systemd/system/postfix.service carried over, and the timestamp in /etc/systemd did not change. Strange.
If you didn't systemctl daemon-reload, then that would be why.
Now I see why...
The contents of /etc/systemd/system/multi-user.target.wants
is just sym links to files in /usr/lib/systemd/system
Change the default in /usr, nat it changes the what is seen in /etc/systemd....
Just about got the command written...
mkdir /etc/systemd/system/postfix.service.d sed -n '/^After=/ s/$/ time-sync.target/p' /usr/lib/systemd/system/postfix.service >> /etc/systemd/system/postfix.service.d/override.conf
I made it an append (>>) in case there is an existing override.conf.
Further refinement for the howto will be to use an environment variable of service=postfix so that if the reader wants to also do samba and httpd, it is easier to change the content of the variable than both the above lines...
thanks for pointing me in a 'better' direction on this one.
I hope! :)
On 04/24/2017 06:00 PM, Robert Moskowitz wrote:
On 04/24/2017 04:53 PM, Jim Perrin wrote:
On 04/23/2017 11:21 AM, Robert Moskowitz wrote:
Can you point me to instructions? I looked at
/etc/systemd/system/multi-user.target.wants/postfix.service
The easy way is 'systemctl edit postfix' This will create appropriate file in /etc/systemd/system/postfix.d/override.conf. (or something like that) and you can go from there. Once you're sure exactly where the file will be then you can mess with it some more.
And the change I made to /usr/lib/systemd/system/postfix.service carried over, and the timestamp in /etc/systemd did not change. Strange.
If you didn't systemctl daemon-reload, then that would be why.
Now I see why...
The contents of /etc/systemd/system/multi-user.target.wants
is just sym links to files in /usr/lib/systemd/system
Change the default in /usr, nat it changes the what is seen in /etc/systemd....
Just about got the command written...
mkdir /etc/systemd/system/postfix.service.d sed -n '/^After=/ s/$/ time-sync.target/p' /usr/lib/systemd/system/postfix.service >> /etc/systemd/system/postfix.service.d/override.conf
I made it an append (>>) in case there is an existing override.conf.
Further refinement for the howto will be to use an environment variable of service=postfix so that if the reader wants to also do samba and httpd, it is easier to change the content of the variable than both the above lines...
thanks for pointing me in a 'better' direction on this one.
systemctl enable chrony-wait systemctl start chrony-wait service=postfix mkdir /etc/systemd/system/$service.service.d cat <<EOF>>/etc/systemd/system/$service.service.d/override.conf || exit 1 [Unit] EOF sed -n '/^After=/ s/$/ time-sync.target/p' /usr/lib/systemd/system/$service.service >> /etc/systemd/system/$service.service.d/override.conf
Problem with this may occur if there is already an override.conf file with a [Unit] section. Likelihood is very low.
Thanks for all the help