BalenaOS 2.48.0+rev1 and supervisor 10.8.0 running on a BalenaFin(cm3) in local mode
I am trying to synchronize my BalenaFin system time with hwclock, on receiving a gps message from an external hardware (mqtt message), using my python program running inside a container.
I have tried some settings and I got hwclock command available in the container. I can do now commands like,
/ # hwclock --show
Tue May 19 10:04:22 2020 0.000000 seconds
However it doesn’t have permission to do operations like
hwclock --hctosys etc, I am getting an error Operation not permitted. How do I get required permission inside container to do this.
/ # hwclock --hctosys
hwclock: settimeofday: Operation not permitted
I tried following to make the hwclock available in container,
add a device to docker-compose.yml
devices: - "/dev/rtc:/dev/rtc"
this is my docker-compose.yml
version: '2.1' volumes: system-service: services: mercury-system-service: build: ./system-service/ network_mode: "host" volumes: - system-service:/app devices: - "/dev/rtc:/dev/rtc" mosquitto: image: "eclipse-mosquitto" ports: - "1883:1883" network_mode: "host"