Daemon and command line utilities to set system timezone based on geographical coordinates

Zoltan Gyarmati authored on 24 Aug 2016
data properly install data and config files 3 years ago
man add gettz utility man page generation, fix (well, hack) paralel build of man/pdf files 3 years ago
src gettz: add system tz setting calls, make independent from configuration 3 years ago
.gitignore add gpsd connection and action command execution 3 years ago
LICENSE add license files and headers 3 years ago
Makefile.am properly install data and config files 3 years ago
README.md readme.. 3 years ago
autogen.sh inital dir structure and source files 3 years ago
configure.ac hunting down some warnings 3 years ago
ogrinfo.sh inital version with experimenting tz id lookup logic 3 years ago
timezoned.ini gettz: add system tz setting calls, make independent from configuration 3 years ago


The timezoned package contains a daemon (timezoned) which connects to GPSd, regularly requests the current position of the system, and based on the GPS coordinates looks up the timezone assigned to the current location (using the TZ shapefiles created by Eric Muller) and sets the system's timezone accordingly. The goal is to always set the current timezone on ever-moving embededd systems (like digital signage systems on vehicles), so they can always display the correct local time. The package also contains a command line utility which accepts coordinates as command line arguments, looks up and prints the corresponding timezone name, and optionally sets the system's timezone to it.


Timezoned has 2 mandatory and 1 optional dependencies: shapelib, libgps, and optionally (if the system uses systemd and systemd-timedated) libdbus, and obviosly running systemd-timedated as runtime dependency.

To check out the code and compile on a recent Debian based system:

# get dependencies:
apt-get install libdbus-1-dev libshp-dev libgps-dev
# get the source
git clone https://github.com/zgyarmati/timezoned.git
cd timezoned
# create configure and co. not needed when building from release tarball
# but needed when checked out from git
# to disable dbus (and in turn systemd), just don't add '-enable-systemd'
./configure  -enable-systemd --enable-silent-rules --prefix=/usr
# if you also want to install it:
sudo make install
#running gettz from the source dir:
GETTZ_SHP_FILE="data/tz_world/tz_world.shp" GETTZ_DBF_FILE="data/tz_world/tz_world.dbf" ./src/gettz 20.3821615  47.891469167
# ^ should yield Europe/Budapest