Skip to content
Advertisement

How can one allow python app to change system time

I am working on a project that has python software running and handling data from multiple devices and sensors on a single board computer. Since one of the devices is an INS (Inertial Navigation System) and we try to match our data with the time provided from it (which it takes from GPS satellites).

For setting the actual time from python we utilize a similar solution that is provided here: Python module to change system date and time

Our issue is that we will always get a permissions error and we are looking for answers here.

Things that are not acceptable:

  • Running the software with sudo
  • Running the software as root

Advertisement

Answer

Try setting CAP_SYS_TIME capability to your app. See http://man7.org/linux/man-pages/man7/capabilities.7.html

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement