Browse Source
travelmate: fix possible race condition
* prevent possible duplicate script execution due to
multiple ntp events in parallel
Signed-off-by: Dirk Brenken <dev@brenken.org>
lilik-openwrt-22.03
Dirk Brenken
4 years ago
No known key found for this signature in database
GPG Key ID: 9D71CD547BFAE684
2 changed files with
10 additions and
6 deletions
-
net/travelmate/Makefile
-
net/travelmate/files/travelmate_ntp.hotplug
|
@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk |
|
|
|
|
|
|
|
|
PKG_NAME:=travelmate |
|
|
PKG_NAME:=travelmate |
|
|
PKG_VERSION:=2.0.2 |
|
|
PKG_VERSION:=2.0.2 |
|
|
PKG_RELEASE:=3 |
|
|
|
|
|
|
|
|
PKG_RELEASE:=4 |
|
|
PKG_LICENSE:=GPL-3.0-or-later |
|
|
PKG_LICENSE:=GPL-3.0-or-later |
|
|
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org> |
|
|
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org> |
|
|
|
|
|
|
|
|
|
@ -22,10 +22,14 @@ f_log() |
|
|
fi |
|
|
fi |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if [ "${ACTION}" = "stratum" ] && [ ! -f "${trm_ntpfile}" ] && \ |
|
|
|
|
|
[ "$("${trm_init}" enabled; printf "%u" ${?})" = "0" ] |
|
|
|
|
|
|
|
|
if [ "${ACTION}" = "stratum" ] && [ ! -f "${trm_ntpfile}" ] && [ "$("${trm_init}" enabled; printf "%u" ${?})" = "0" ] |
|
|
then |
|
|
then |
|
|
> "${trm_ntpfile}" |
|
|
|
|
|
f_log "info" "get ntp time sync" |
|
|
|
|
|
"${trm_init}" restart |
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
flock -xn 1001 |
|
|
|
|
|
if [ "$?" = "0" ] |
|
|
|
|
|
then |
|
|
|
|
|
f_log "info" "get ntp time sync" |
|
|
|
|
|
"${trm_init}" restart |
|
|
|
|
|
fi |
|
|
|
|
|
} 1001>"${trm_ntpfile}" |
|
|
fi |
|
|
fi |