ntp: fix postinst on systemd based hosts
We need to make sure we're not trying to call systemctl on the build host. Thanks to holger for pinpointing this.
This commit is contained in:
parent
ba2e6da375
commit
20e26fcd3b
|
@ -25,7 +25,7 @@ SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-${PV}.tar.g
|
|||
file://ntpdate.cron \
|
||||
"
|
||||
|
||||
PR = "r8"
|
||||
PR = "r9"
|
||||
|
||||
SRC_URI[md5sum] = "65d8cdfae4722226fbe29863477641ed"
|
||||
SRC_URI[sha256sum] = "948274b88f1ed002d867ced6aaefdfd0999668b11285ac2b3a67ff2629d59d88"
|
||||
|
@ -162,6 +162,9 @@ pkg_postinst_ntpdate() {
|
|||
echo "comment the old crontab entry"
|
||||
sed -i -e "/^[^#]/ s/\(.*\)\(.*ntpdate-sync.*$\)/#\1\2/g" $D/var/spool/cron/root
|
||||
fi
|
||||
if [ "x$D" != "x" ]; then
|
||||
exit 0
|
||||
fi
|
||||
systemctl status crond > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
systemctl restart crond
|
||||
|
|
Loading…
Reference in New Issue