From a1bf178ee014eaeaff8a9febeedd75c543b8369f Mon Sep 17 00:00:00 2001 From: lejeune quentin Date: Thu, 31 Aug 2023 16:18:34 +0200 Subject: [PATCH] [FIX] point_of_sale: Fix date on iot With the build of the new iot image we need to fix the date synchronization closes odoo/odoo#134138 X-original-commit: 41b0edf739f676723b9dab77066296565d6e135d Signed-off-by: Quentin Lejeune (qle) --- .../etc/init.d/timesyncd | 41 +++++++++++++++++++ .../etc/init_posbox_image.sh | 1 + 2 files changed, 42 insertions(+) create mode 100644 addons/point_of_sale/tools/posbox/overwrite_before_init/etc/init.d/timesyncd 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 new file mode 100644 index 00000000000..eb5ccf94091 --- /dev/null +++ b/addons/point_of_sale/tools/posbox/overwrite_before_init/etc/init.d/timesyncd @@ -0,0 +1,41 @@ +#!/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 377ca160ba4..c304a2d40f6 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,6 +142,7 @@ 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