From patchwork Thu May 27 10:37:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 1484545 X-Patchwork-Delegate: daniel@makrotopia.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=vIJBEwF5; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FrPV85CVgz9sRK for ; Thu, 27 May 2021 20:40:32 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From :Date:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=usRlEwme3Ex2ySd9jEjNbggWNjjuqA9cEhfGtxlz/nc=; b=vIJBEwF5JBNOxa jYelDPYRWFR7KWc7lj8fjvkETKN/MWqiJsswC6vDPxUwdzVxcmn5q7Tttx/XLE8Z1CpnlGicXRZ0E payUXNcqFZvn7tEmM4F9cgE37yANIRoEiMjA+CVDh1/whkFnovYmCvzKRBlpGfJ2T9xFsPAJJZJoZ aFjuji75ijG2g4wcZ1EH3V9I8HTRiawrjSRuk5eDQ45SLQEUSczfJnZG3XrL22m64t21H7Ph1IS1j ZJJUKr2X6+1bjxaGvUS155SheIHN8II7wffT+jx3gWFsQyCgnqpIj0klmBbvMjXCIlr/TNx5FccMY Kh9BFY88Ml+7QGKfDLeg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmDPC-004t7K-By; Thu, 27 May 2021 10:38:22 +0000 Received: from fudo.makrotopia.org ([2a07:2ec0:3002::71]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmDP9-004t4g-6X for openwrt-devel@lists.openwrt.org; Thu, 27 May 2021 10:38:20 +0000 Received: from local by fudo.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.94.2) (envelope-from ) id 1lmDP6-0001sx-SB for openwrt-devel@lists.openwrt.org; Thu, 27 May 2021 12:38:17 +0200 Date: Thu, 27 May 2021 12:37:41 +0200 From: Daniel Golle To: openwrt-devel@lists.openwrt.org Subject: [PATCH] ugps: start also in case device is absent Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210527_033819_261254_DDC5105A X-CRM114-Status: UNSURE ( 9.21 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Don't bail out from init script in case the GPS device is missing. Some modems take time to come up, and some people may use things like 'kplex' to feed ugpsd. Hence it is better to always start ugpsd [...] Content analysis details: (0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Don't bail out from init script in case the GPS device is missing. Some modems take time to come up, and some people may use things like 'kplex' to feed ugpsd. Hence it is better to always start ugpsd unconditionally and let procd's respawn take care of retrying. Signed-off-by: Daniel Golle --- package/utils/ugps/Makefile | 2 +- package/utils/ugps/files/ugps.init | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/package/utils/ugps/Makefile b/package/utils/ugps/Makefile index 4ce64d9631..16cdbc41b9 100644 --- a/package/utils/ugps/Makefile +++ b/package/utils/ugps/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ugps -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_URL=$(PROJECT_GIT)/project/ugps.git PKG_SOURCE_PROTO:=git diff --git a/package/utils/ugps/files/ugps.init b/package/utils/ugps/files/ugps.init index 3cd1ca1b8d..f52b19cc27 100644 --- a/package/utils/ugps/files/ugps.init +++ b/package/utils/ugps/files/ugps.init @@ -17,10 +17,14 @@ start_service() { [ "$disabled" == "0" ] || return - [ -c "$tty" ] || { - tty="/dev/$tty" - [ -c "$tty" ] || return - } + case "$tty" in + "/"*) + true + ;; + *) + tty="/dev/$tty" + ;; + esac procd_open_instance procd_set_param command "$PROG"