Skip to content

Commit

Permalink
improve readme, rename lockfile
Browse files Browse the repository at this point in the history
  • Loading branch information
maurerle committed Aug 23, 2024
1 parent 61af535 commit b7ba830
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions ffac-update-location-gps/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ It seems to work without coreutils-stty installed, which did fail the installati
The location is only updated in memory - and only if a valid GPS fix is available.
After a reboot, the old location from the config is set.

## hotplug limitation
## behvario and lockfiles

This creates a lockfile `/var/lock/hotplug-update-location-gps_$DEVNAME.lock` per found TTY device and sets up a cron job which runs every 5 minutes to check if coordinates are available from the stream.
If the TTY is not in use, the open stream waits for the first line to be read (never) and is stuck.
A lockfile `/var/lock/update-location-gps_$TTYDEVICE` is used to check if the cron is already running/stuck and does not start another reading terminal in that case.

On creation and removal of the micron.d job, the micron.d service is restarted

After a sysupgrade/autoupdate - the USB dongle has to be unplugged and plugged in once for the detection to work again.
For reboots, this works fine as is.

## further information

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
TTYPATH="/sys${DEVPATH}/tty"
lockpath="/var/lock/update-location-gps_${DEVNAME}.lock"
lockpath="/var/lock/hotplug-update-location-gps_${DEVNAME}.lock"

if [ "${ACTION}" = "add" ]; then
enabled=$(uci get update-location-gps.settings.enabled)
Expand Down

0 comments on commit b7ba830

Please sign in to comment.