fix PIDFile in local chronyd.service on upgrades from chrony < 3.3-2
This commit is contained in:
parent
1284f5a8d4
commit
947de079b7
@ -157,6 +157,14 @@ getent passwd chrony > /dev/null || /usr/sbin/useradd -r -g chrony \
|
||||
:
|
||||
|
||||
%post
|
||||
# fix PIDFile in local chronyd.service on upgrades from chrony < 3.3-2
|
||||
if grep -q 'PIDFile=%{_localstatedir}/run/chronyd.pid' \
|
||||
%{_sysconfdir}/systemd/system/chronyd.service 2> /dev/null && \
|
||||
! grep -qi '^[ '$'\t'']*pidfile' %{_sysconfdir}/chrony.conf 2> /dev/null
|
||||
then
|
||||
sed -i '/PIDFile=/s|/run/|/run/chrony/|' \
|
||||
%{_sysconfdir}/systemd/system/chronyd.service
|
||||
fi
|
||||
%systemd_post chronyd.service chrony-wait.service
|
||||
|
||||
%preun
|
||||
|
Loading…
Reference in New Issue
Block a user