X-Original-To: alpine-aports@lists.alpinelinux.org Received: from mx1.tetrasec.net (mx1.tetrasec.net [74.117.190.25]) by lists.alpinelinux.org (Postfix) with ESMTP id 5FC4BF816F2 for ; Wed, 27 Feb 2019 07:32:24 +0000 (UTC) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id 307729E0544; Wed, 27 Feb 2019 07:32:24 +0000 (UTC) Received: from ncopa-desktop.copa.dup.pw (67.63.200.37.customer.cdi.no [37.200.63.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: alpine@tanael.org) by mx1.tetrasec.net (Postfix) with ESMTPSA id A1B929E043F; Wed, 27 Feb 2019 07:32:22 +0000 (UTC) Date: Wed, 27 Feb 2019 08:32:18 +0100 From: Natanael Copa To: "Milan P. =?ISO-8859-1?B?U3Rhbmkq?=" Cc: alpine-aports@lists.alpinelinux.org Subject: Re: [alpine-aports] [PATCH] testing/metalog: new aport Message-ID: <20190227083218.5c8c9ada@ncopa-desktop.copa.dup.pw> In-Reply-To: <20190222151334.25126-1-mps@arvanta.net> References: <20190222151334.25126-1-mps@arvanta.net> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-alpine-linux-musl) X-Mailinglist: alpine-aports Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Fri, 22 Feb 2019 16:13:34 +0100 Milan P. Stani* wrote: > --- > testing/metalog/APKBUILD | 53 +++++++++++++++++++++++++++++++++++ > testing/metalog/metalog.confd | 10 +++++++ > testing/metalog/metalog.initd | 40 ++++++++++++++++++++++++++ > 3 files changed, 103 insertions(+) > create mode 100644 testing/metalog/APKBUILD > create mode 100644 testing/metalog/metalog.confd > create mode 100644 testing/metalog/metalog.initd .... > diff --git a/testing/metalog/metalog.confd b/testing/metalog/metalog.confd > new file mode 100644 > index 0000000000..f3c7a277d1 > --- /dev/null > +++ b/testing/metalog/metalog.confd > @@ -0,0 +1,10 @@ > +# Configuration file > +CONFIGFILE=3D"/etc/metalog.conf" > + > +# PID file > +PIDFILE=3D"/var/run/metalog.pid" We should use /run instead of /var/run. http://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s15.html > + > +# Options to metalog > +# "-B" start server in background/daemon mode > +# "-s" tells metalog to run in sync mode > +METALOG_OPTS=3D"-B -s" > diff --git a/testing/metalog/metalog.initd b/testing/metalog/metalog.initd > new file mode 100644 > index 0000000000..c7f25f1d37 > --- /dev/null > +++ b/testing/metalog/metalog.initd > @@ -0,0 +1,40 @@ > +#!/sbin/openrc-run > + > +extra_started_commands=3D"reload" > + > +description=3D"syslog server" > +name=3Dmetalog > +command=3D"/usr/sbin/$name" > + > +depend() { > + need clock hostname localmount > + provide logger > +} > + > +start() { > + ebegin "Starting metalog" > + start-stop-daemon \ > + --start --quiet --exec $command \ > + -- ${METALOG_OPTS} -p "${PIDFILE}" -C "${CONFIGFILE}" > + eend $? > +} > + > +stop() { > + ebegin "Stopping metalog" > + start-stop-daemon \ > + --stop --quiet \ > + --pidfile "${PIDFILE}" > + eend $? > +} I think we can factor out start and stop functions by: change PIDFILE to pidfile use: command_args=3D"$METALOG_OPTS -p $pidfile -C $CONFIGFILE" We may want check that $CONFIGFILE exists in a start_pre function too. I guess we could also just steal the gentoo script: https://gitweb.gentoo.org/repo/gentoo.git/tree/app-admin/metalog/files/meta= log.initd-r1 > + > +reload() { > + if [ ! -f "${PIDFILE}" ]; then > + eerror "metalog not running" > + return 1 > + fi > + > + ebegin "Re-opening metalog log files" > + start-stop-daemon --stop --signal HUP \ > + --pidfile "${PIDFILE}" > + eend $? > +} --- Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org Help: alpine-aports+help@lists.alpinelinux.org ---