From nobody Mon Sep 26 12:36:14 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Mbj0v0snXz4WSgH; Mon, 26 Sep 2022 12:36:15 +0000 (UTC) (envelope-from rene@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Mbj0v0NQGz3k7S; Mon, 26 Sep 2022 12:36:15 +0000 (UTC) (envelope-from rene@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664195775; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ELuQMaqaFwK95xZPx6+krzdpHjCY77vpDxvPJISQe18=; b=jGA8j76zU07EWWLe2iqNn5ShpcPug1SnFLwYYbQSScyl6PuoFEAibJAmQDwZLvSEsYErOu wY1aZrfm1EpRleAo/rs/88ucTceIFyv2bfdwcf0J/HRV9beGfcBhfSJDJK0VDmNhfZv8ie 9foxNSK1BbehviN/677kkVrRUwrA1MXI/SlCF12fxNiceFnxZd5Un+NdusDZDcdNmNfvt3 GcUOW5CpVNFYC0iQbGEQpXDBph8XAoTmGNuVzD23PFjjlPdBhDZAM+iad9dMM3aAyt/DoT WQ36/tAUBsA05yrQdRp6IfBxZjQ591yTjFtfAStZ+UOvFV9MSj1G5iulrpYXSg== Received: by freefall.freebsd.org (Postfix, from userid 1185) id D01F2AE6D; Mon, 26 Sep 2022 12:36:14 +0000 (UTC) Date: Mon, 26 Sep 2022 12:36:14 +0000 From: Rene Ladan To: Carlo Strub Cc: ports-committers@freebsd.org, dev-commits-ports-all@freebsd.org, dev-commits-ports-main@freebsd.org Subject: Re: git: 918612d6fe2e - main - security/arti: Fix rc.d service using daemon, update URL Message-ID: References: <202209251622.28PGM06A017195@gitrepo.freebsd.org> List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202209251622.28PGM06A017195@gitrepo.freebsd.org> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664195775; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ELuQMaqaFwK95xZPx6+krzdpHjCY77vpDxvPJISQe18=; b=HBMZzpSgG11a3WrUdzdzM2nPs3LftgCLDXkLgWZa6vOSghcNGJvAp3WpaLFUXJ7DAtaws9 622TLSkMVR7UGImv+GVC2W3CP6FcOlREXtXKTTSNqru1PaLvEuWXei+QCrpuwbyonz7yQ8 hoqM3uSbdXdUKGNv+4m7G5bwFvrxywsn/JUWWDcjBBbsAmksC9TqD5z/POyUP3H53hEvfx Xszmsj2DqGJaihnFn6ZVwumZeyh+eGoXHAZwhgAg7RAnEp+L2oiie3PiIlSQ/80qZL6KWO fuH8Qfvi2n1MFgZbhrVjRzxdieORUyH4i7DgZ7raDmSp+FPvwjZgAv/C/rLdlA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1664195775; a=rsa-sha256; cv=none; b=yDFJZKGs5ifEUU2+8nMvwPitik2YomGX4tHNzmYxbmUTPDmnAyMHZQxESnZgfau25CIJCn Bbn2lyV8Ol1No3UsNrKoPyzhKc8WikFhSxLwBLk+UR40o03k+wQV6l74+/+G5WvLuqnDL6 B7gHRohhV466zprthSRiIuvVNzM5eM/xHSJXhGQbm1ceodPVPgaDlQ5XUgXKSM6rg7Fi0G 0wdoquMB0BHL0+ObZ1uqybKdoSxOK0MXf3xf+mJSbQG3i+UE84iFlvXPV88VW1TYUGffl+ I/S26aj+sz0q5MFYVaMSzL3FFqapWQjcO5mth+L7toEk88NU5PVF6kNzUVDzMg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On Sun, Sep 25, 2022 at 04:22:00PM +0000, Carlo Strub wrote: > The branch main has been updated by cs: > > URL: https://cgit.FreeBSD.org/ports/commit/?id=918612d6fe2e312a1a57446d1c8f9c72df400e9e > > commit 918612d6fe2e312a1a57446d1c8f9c72df400e9e > Author: Carlo Strub > AuthorDate: 2022-09-25 16:21:15 +0000 > Commit: Carlo Strub > CommitDate: 2022-09-25 16:21:15 +0000 > > security/arti: Fix rc.d service using daemon, update URL > --- > GIDs | 2 +- > UIDs | 2 +- > security/arti/Makefile | 11 ++--- > security/arti/files/arti.in | 51 ++++++++++++++-------- > .../patch-crates_arti_src_arti-example-config.toml | 10 +++-- > 5 files changed, 48 insertions(+), 28 deletions(-) > [...] > diff --git a/security/arti/files/arti.in b/security/arti/files/arti.in > index b7226c5ebe14..8cb8d4a48513 100644 > --- a/security/arti/files/arti.in > +++ b/security/arti/files/arti.in > @@ -1,37 +1,54 @@ [...] > # by default. > -# arti_user (str): Arti daemon user. Default: %%USER%% > -# arti_pidfile (str): Arti pid file. Default: /var/run/arti/arti.pid > - > +# arti_user (str): Arti daemon user. Default: %%USERS%% > +# arti_group (str): Arti daemon group. Default: %%GROUPS%% > [...] > -command_args="-f -o $arti_logfile -P $arti_pidfile $arti proxy -c $arti_config" > +: ${arti_user="%%USERS%%"} > +: ${arti_group="%%GROUPS%%"} > + > +pidfiledir="/var/run/${name}" > +pidfile="${pidfiledir}/${name}.pid" > +logfiledir="/var/log/${name}" > +logfile="${logfiledir}/${name}.log" > +dbfiledir="/var/db/${name}" > +command="/usr/sbin/daemon" > +procname="%%PREFIX%%/bin/${name}" > + > +command_args="-f -o $logfile -p $pidfile $procname proxy --config $arti_config" > + > +start_precmd="${name}_prestart" > + > +arti_prestart() > +{ > + if [ ! -d ${pidfiledir} ]; then > + install -d -o ${arti_user} -g ${arti_group} ${pidfiledir} > + fi > + if [ ! -d ${logfiledir} ]; then > + install -d -o ${arti_user} -g ${arti_group} ${logfiledir} > + fi > + if [ ! -d ${dbfiledir} ]; then > + install -d -o ${arti_user} -g ${arti_group} ${dbfiledir} > + fi > +} > Somehow arti_prestart() fails to set the correct owner and group, causing arti to not start as a service. Wouldn't it be easier to handle this in pkg-plist instead? diff --git a/security/arti/pkg-plist b/security/arti/pkg-plist index 4b90f62f5..b70161d58 100644 --- a/security/arti/pkg-plist +++ b/security/arti/pkg-plist @@ -1,5 +1,7 @@ bin/arti @sample %%ETCDIR%%/arti.toml.sample +@owner %%USERS%% +@group %%GROUPS%% @dir /var/db/arti @dir /var/log/arti @dir /var/run/arti That also simplifies the rc.d script a bit by not having to declare the *filedir, arti_user and arti_group variables. Regards, René