diff --git a/addons/point_of_sale/tools/posbox/overwrite_before_init/etc/init.d/odoo b/addons/point_of_sale/tools/posbox/overwrite_before_init/etc/init.d/odoo index d54c96bd0f0..8a8a25b7a16 100755 --- a/addons/point_of_sale/tools/posbox/overwrite_before_init/etc/init.d/odoo +++ b/addons/point_of_sale/tools/posbox/overwrite_before_init/etc/init.d/odoo @@ -27,12 +27,10 @@ test -x $DAEMON || exit 0 set -e function _start() { - # Wait for time to be synced or AP to start or max 30 seconds - cnt=30 - while ! test -a /run/systemd/timesync/synchronized && ! ip route | grep 10.11.12.1 && ((cnt--)); do - sleep 1 - done start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid $USER:$USER --background --make-pidfile --exec $DAEMON -- --config $CONFIG --logfile $LOGFILE --load=$MODULES --max-cron-threads=0 + + # this enables and starts the first existing network synchronization service + timedatectl set-ntp true } function _stop() { diff --git a/addons/point_of_sale/tools/posbox/overwrite_before_init/etc/init.d/timesyncd b/addons/point_of_sale/tools/posbox/overwrite_before_init/etc/init.d/timesyncd deleted file mode 100644 index eb5ccf94091..00000000000 --- a/addons/point_of_sale/tools/posbox/overwrite_before_init/etc/init.d/timesyncd +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -### BEGIN INIT INFO -# Provides: timesyncd -# Required-Start: $remote_fs $network -# Required-Stop: $remote_fs -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Start systemd-timesyncd daemon at boot time -# Description: Enable service provided by daemon. -### END INIT INFO - -start() -{ - echo "start timesyncd" - service systemd-timesyncd start -} - -stop() -{ - echo "stop timesyncd" - service systemd-timesyncd stop -} - -restart() -{ - stop; - sleep 1; - start; -} -case $1 in -start) - start;; -stop) - stop;; -restart) - restart;; -*) - start;; -esac - -exit 0 diff --git a/addons/point_of_sale/tools/posbox/overwrite_before_init/etc/init_posbox_image.sh b/addons/point_of_sale/tools/posbox/overwrite_before_init/etc/init_posbox_image.sh index c304a2d40f6..377ca160ba4 100755 --- a/addons/point_of_sale/tools/posbox/overwrite_before_init/etc/init_posbox_image.sh +++ b/addons/point_of_sale/tools/posbox/overwrite_before_init/etc/init_posbox_image.sh @@ -142,7 +142,6 @@ echo "* * * * * rm /var/run/odoo/sessions/*" | crontab - update-rc.d -f hostapd remove update-rc.d -f nginx remove update-rc.d -f dnsmasq remove -update-rc.d timesyncd defaults systemctl enable ramdisks.service systemctl enable led-status.service