travelmate: bugfix 1.3.7
* fix a possible 'reload' race condition Signed-off-by: Dirk Brenken <dev@brenken.org>
This commit is contained in:
parent
a423fd57bb
commit
feca82971a
3 changed files with 5 additions and 5 deletions
|
@ -6,7 +6,7 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=travelmate
|
PKG_NAME:=travelmate
|
||||||
PKG_VERSION:=1.3.6
|
PKG_VERSION:=1.3.7
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
PKG_LICENSE:=GPL-3.0+
|
PKG_LICENSE:=GPL-3.0+
|
||||||
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
|
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
|
||||||
|
|
|
@ -31,14 +31,14 @@ start_service()
|
||||||
|
|
||||||
reload_service()
|
reload_service()
|
||||||
{
|
{
|
||||||
local ppid pid
|
local ppid pid timeout="$(uci_get travelmate global trm_timeout)"
|
||||||
|
|
||||||
if [ -s "${trm_pidfile}" ]
|
if [ -s "${trm_pidfile}" ]
|
||||||
then
|
then
|
||||||
ppid="$(cat "${trm_pidfile}" 2>/dev/null)"
|
ppid="$(cat "${trm_pidfile}" 2>/dev/null)"
|
||||||
if [ -n "${ppid}" ]
|
if [ -n "${ppid}" ]
|
||||||
then
|
then
|
||||||
pid="$(pgrep sleep -P ${ppid} 2>/dev/null)"
|
pid="$(pgrep -xnf "sleep ${timeout:-60} 0" -P ${ppid} 2>/dev/null)"
|
||||||
if [ -n "${pid}" ]
|
if [ -n "${pid}" ]
|
||||||
then
|
then
|
||||||
kill -INT ${pid} 2>/dev/null
|
kill -INT ${pid} 2>/dev/null
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#
|
#
|
||||||
LC_ALL=C
|
LC_ALL=C
|
||||||
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
|
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
|
||||||
trm_ver="1.3.6"
|
trm_ver="1.3.7"
|
||||||
trm_sysver="unknown"
|
trm_sysver="unknown"
|
||||||
trm_enabled=0
|
trm_enabled=0
|
||||||
trm_debug=0
|
trm_debug=0
|
||||||
|
@ -474,7 +474,7 @@ do
|
||||||
f_check "initial"
|
f_check "initial"
|
||||||
if [ "${trm_ifstatus}" = "true" ]
|
if [ "${trm_ifstatus}" = "true" ]
|
||||||
then
|
then
|
||||||
sleep ${trm_timeout}
|
sleep ${trm_timeout} 0
|
||||||
fi
|
fi
|
||||||
if [ $? -eq 0 ] || [ "${trm_ifstatus}" = "false" ]
|
if [ $? -eq 0 ] || [ "${trm_ifstatus}" = "false" ]
|
||||||
then
|
then
|
||||||
|
|
Loading…
Reference in a new issue