[FIX] point_of_sale: Remove timesyncd service from iot
With the new version of raspios the timesyncd service is not correctly stopped during a shutdown or a reboot. Here 'timedatectl set-ntp true' enables and starts the first existing network synchronization service closes odoo/odoo#134797 X-original-commit: b0669ec60095ae4d28276fbef0ae9e1e0197626f Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user