X-Original-To: alpine-aports@mail.alpinelinux.org Delivered-To: alpine-aports@mail.alpinelinux.org Received: from mail.alpinelinux.org (dallas-a1.alpinelinux.org [127.0.0.1]) by mail.alpinelinux.org (Postfix) with ESMTP id 2555CDC56F7 for ; Fri, 18 Dec 2015 10:05:41 +0000 (UTC) Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id 9C4B8DC476C for ; Fri, 18 Dec 2015 10:05:40 +0000 (UTC) Received: by mail-wm0-f49.google.com with SMTP id p187so56544216wmp.1 for ; Fri, 18 Dec 2015 02:05:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Q+CPrWOOeOmQL+NhtyE8IhOTxrBLshQkPttMZPOwhMQ=; b=QwpA9r2YETBhxVkbkeHuUGXvtgoQZKArtS3n2/WzITVFS7+8KQfmOyvKCYgsycpQ1K MBXFOsN6qbsCNw72+0xfLWHBwPvgSALBN3snNe9mbnpIz1b8ZbTgzoqM4yXqnk3GOWSk DORUwpn0luqIEY6GsV62uU5gta2EQ3MWW7jwpNi7IEUYArTKCeX44K+tb1pgb1AdMebk HiQzaZUfdt1AJtWGV3Z75caWdWpel2gHrHr/su41Vz/rILvO0YUre8gE3kp8gcASKto3 RLPaQ11qsntlpUXYZNmaFZ6MQZ4d/XwhvdOK8RGSTPDkQ2zPNkCG6/Bj2O261YsbAqnc F2Tw== X-Mailinglist: alpine-aports Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 X-Received: by 10.28.1.5 with SMTP id 5mr2003179wmb.61.1450433138832; Fri, 18 Dec 2015 02:05:38 -0800 (PST) Received: by 10.28.90.132 with HTTP; Fri, 18 Dec 2015 02:05:38 -0800 (PST) In-Reply-To: References: <1450384389-29157-1-git-send-email-soeren+git@soeren-tempel.net> Date: Fri, 18 Dec 2015 12:05:38 +0200 Message-ID: Subject: Re: [alpine-aports] [PATCH] main/nsd: copy new version of the OpenRC service from Gentoo From: Valery Kartel To: =?UTF-8?Q?S=C3=B6ren_Tempel?= Cc: alpine-aports@lists.alpinelinux.org Content-Type: multipart/alternative; boundary=001a113d77ea02dcff0527294883 X-Virus-Scanned: ClamAV using ClamSMTP --001a113d77ea02dcff0527294883 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable if use the power and defaults of openrc-run, init-script with the same functionality will looks like: --- nsd.initd --- #!/sbin/openrc-run description=3D"NSD is an authoritative-only, high performance, open source name server" checkconf=3D"{NSD_CHECKCONF:-/usr/sbin/nsd-checkconf} cfgfile=3D${NSD_CONFIG:-/etc/nsd/nsd.conf} pidfile=3D$($checkconf -o pidfile $cfgfile) command=3D${NSD_BINARY:-/usr/sbin/nsd} command_args=3D"-c $cfgfile" required_files=3D"$cfgfile" depend() { need net use logger } start_pre() { ebegin checkpath --directory --owner nsd:nsd ${pidfile%/*} $checkconf $cfgfile eend $? } 2015-12-17 23:06 GMT+02:00 Valery Kartel : > Is it really new rc-script? Looks like legacy runscript-based. > 17 =D0=B3=D1=80=D1=83=D0=B4. 2015 22:33 "S=C3=B6ren Tempel" =D0=BF=D0=B8=D1=88=D0=B5: > > --- >> main/nsd/APKBUILD | 9 ++++----- >> main/nsd/nsd.initd | 27 ++++++++++++++------------- >> 2 files changed, 18 insertions(+), 18 deletions(-) >> >> diff --git a/main/nsd/APKBUILD b/main/nsd/APKBUILD >> index c53aebb..657d8cf 100644 >> --- a/main/nsd/APKBUILD >> +++ b/main/nsd/APKBUILD >> @@ -3,7 +3,7 @@ >> # Maintainer: Natanael Copa >> pkgname=3Dnsd >> pkgver=3D4.1.6 >> -pkgrel=3D0 >> +pkgrel=3D1 >> pkgdesc=3D"NSD is an authoritative only, high performance, simple and o= pen >> source name server." >> url=3D"http://www.nlnetlabs.nl/projects/nsd/" >> arch=3D"all" >> @@ -32,7 +32,6 @@ prepare() { >> >> build() { >> cd "$_builddir" >> - >> ./configure \ >> --build=3D$CBUILD \ >> --host=3D$CHOST \ >> @@ -67,8 +66,8 @@ doc() { >> } >> >> md5sums=3D"607e0a2afa9365c96d981f2fd36942dc nsd-4.1.6.tar.gz >> -62301a021d2b2e1972625e56ea8138d1 nsd.initd" >> +b3af3579bdccf072183f7311b5307011 nsd.initd" >> sha256sums=3D"88f622055c95d38b9ef3723a240d1d0da35a28d09fe23b601015181a6= 1d7775f >> nsd-4.1.6.tar.gz >> -8f9ca311a60e2a3db3fcc64b66cce2d6ff84b5600f47d5ece349d90926e90f27 >> nsd.initd" >> +15e96b6738f51587ff9512b5d4bafd312ef77ccd1124009f7e7270558351935b >> nsd.initd" >> sha512sums=3D"c9bd4901e49a718ef435862d55a9c351586ecd4349c52d39ee18acf6c= a33e3488eb581115fe6a99d0a1fd975117168d2756866429fc517ebe4713a211811333d >> nsd-4.1.6.tar.gz >> -402142ad1bb422a9a29ee8c7606bd513defa41563d47fb547812d4682862da5646022aa= 8c4577ed2d2a151388a12ec2f7b472e6a6091406859c0eb1f7f00c5b6 >> nsd.initd" >> +080d30c18d4cc3077a7e2d773b7abedff454f6b5a9dd4994418eaab615587676f26e4e5= 18f21a59b9cc95923a0d98611ce54a605c5638cea99d33d32f9395fc8 >> nsd.initd" >> diff --git a/main/nsd/nsd.initd b/main/nsd/nsd.initd >> index 6318204..2d3769b 100644 >> --- a/main/nsd/nsd.initd >> +++ b/main/nsd/nsd.initd >> @@ -1,19 +1,15 @@ >> -#!/sbin/openrc-run >> +#!/sbin/runscript >> # Copyright 1999-2013 Gentoo Foundation >> # Distributed under the terms of the GNU General Public License v2 >> -# $Header: /var/cvsroot/gentoo-x86/net-dns/nsd/files/nsd.initd,v 1.2 >> 2013/04/03 19:10:39 wschlich Exp $ >> >> -name=3D"NSD" >> description=3D"NSD is an authoritative-only, high performance, open sou= rce >> name server" >> extra_commands=3D"configtest" >> >> # these can be overridden in /etc/conf.d/nsd if necessary >> NSD_CONFIG=3D"${NSD_CONFIG:-/etc/nsd/nsd.conf}" >> -command=3D"${NSD_BINARY:-/usr/sbin/nsd}" >> +NSD_BINARY=3D"${NSD_BINARY:-/usr/sbin/nsd}" >> NSD_CHECKCONF=3D"${NSD_CHECKCONF:-/usr/sbin/nsd-checkconf}" >> >> -command_args=3D"-c ${NSD_CONFIG}" >> - >> depend() { >> need net >> use logger >> @@ -37,15 +33,20 @@ checkconfig() { >> return 0 >> } >> >> -start_pre() { >> +start() { >> + ebegin "Starting NSD" >> checkconfig || return $? >> - pidfile=3D$("${NSD_CHECKCONF}" -o pidfile "${NSD_CONFIG}") >> - checkpath --directory --owner nsd:nsd "${pidfile%/*}" >> + local pidfile=3D$("${NSD_CHECKCONF}" -o pidfile "${NSD_CONFIG}") >> + checkpath --directory --owner nsd:nsd $(dirname "${pidfile}") >> + start-stop-daemon --start --pidfile "${pidfile}" \ >> + --exec "${NSD_BINARY}" -- -c "${NSD_CONFIG}" >> + eend $? >> } >> >> - >> -stop_pre() { >> +stop() { >> + ebegin "Stopping NSD" >> checkconfig || return $? >> - pidfile=3D$("${NSD_CHECKCONF}" -o pidfile "${NSD_CONFIG}") >> + local pidfile=3D$("${NSD_CHECKCONF}" -o pidfile "${NSD_CONFIG}") >> + start-stop-daemon --stop --pidfile "${pidfile}" >> + eend $? >> } >> - >> -- >> 2.6.4 >> >> >> >> --- >> Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org >> Help: alpine-aports+help@lists.alpinelinux.org >> --- >> >> --001a113d77ea02dcff0527294883 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
if use the power and defaults of = openrc-run, init-scri= pt with the same functionality will looks like:
--- nsd.initd ---
#!/sbin/openrc-run

description=3D"NS= D is an authoritative-only, high performance, open source name server"=
checkconf=3D"{NSD_CHECKCONF:-/usr/sbin/nsd-checkconf}
cfgfile= =3D${NSD_CONFIG:-/etc/nsd/nsd.conf}
pidfile=3D$($checkconf -o pidfile $c= fgfile)
command=3D${NSD_BINARY:-/usr/sbin/nsd}
command_args=3D"-= c $cfgfile"
required_files=3D"$cfgfile"

depend() {=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 need net
=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 use logger
}

start_pre() {
=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ebegin
=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 checkpath --directory --owner nsd:nsd ${pidfile%/*}
=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $checkconf $cfgfile
=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 eend $?
}

2015-12-17 23:06 GMT+02:0= 0 Valery Kartel <valery.kartel@gmail.com>:

Is it really new rc-script? Looks lik= e legacy runscript-based.

17 =D0=B3=D1=80=D1=83=D0=B4. 2015 22:33 "S= =C3=B6ren Tempel" <soeren+git@soeren-tempel.net> =D0=BF=D0=B8=D1=88= =D0=B5:

---
=C2=A0main/nsd/APKBUILD=C2=A0 |=C2=A0 9 ++++-----
=C2=A0main/nsd/nsd.initd | 27 ++++++++++++++-------------
=C2=A02 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/main/nsd/APKBUILD b/main/nsd/APKBUILD
index c53aebb..657d8cf 100644
--- a/main/nsd/APKBUILD
+++ b/main/nsd/APKBUILD
@@ -3,7 +3,7 @@
=C2=A0# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
=C2=A0pkgname=3Dnsd
=C2=A0pkgver=3D4.1.6
-pkgrel=3D0
+pkgrel=3D1
=C2=A0pkgdesc=3D"NSD is an authoritative only, high performance, simpl= e and open source name server."
=C2=A0url=3D"http://www.nlnetlabs.nl/projects/nsd/&quo= t;
=C2=A0arch=3D"all"
@@ -32,7 +32,6 @@ prepare() {

=C2=A0build() {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 cd "$_builddir"
-
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ./configure \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 --build=3D$CBUILD \=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 --host=3D$CHOST \ @@ -67,8 +66,8 @@ doc() {
=C2=A0}

=C2=A0md5sums=3D"607e0a2afa9365c96d981f2fd36942dc=C2=A0 nsd-4.1.6.tar.= gz
-62301a021d2b2e1972625e56ea8138d1=C2=A0 nsd.initd"
+b3af3579bdccf072183f7311b5307011=C2=A0 nsd.initd"
=C2=A0sha256sums=3D"88f622055c95d38b9ef3723a240d1d0da35a28d09fe23b6010= 15181a61d7775f=C2=A0 nsd-4.1.6.tar.gz
-8f9ca311a60e2a3db3fcc64b66cce2d6ff84b5600f47d5ece349d90926e90f27=C2=A0 nsd= .initd"
+15e96b6738f51587ff9512b5d4bafd312ef77ccd1124009f7e7270558351935b=C2=A0 nsd= .initd"
=C2=A0sha512sums=3D"c9bd4901e49a718ef435862d55a9c351586ecd4349c52d39ee= 18acf6ca33e3488eb581115fe6a99d0a1fd975117168d2756866429fc517ebe4713a2118113= 33d=C2=A0 nsd-4.1.6.tar.gz
-402142ad1bb422a9a29ee8c7606bd513defa41563d47fb547812d4682862da5646022aa8c4= 577ed2d2a151388a12ec2f7b472e6a6091406859c0eb1f7f00c5b6=C2=A0 nsd.initd"= ;
+080d30c18d4cc3077a7e2d773b7abedff454f6b5a9dd4994418eaab615587676f26e4e518f= 21a59b9cc95923a0d98611ce54a605c5638cea99d33d32f9395fc8=C2=A0 nsd.initd"= ;
diff --git a/main/nsd/nsd.initd b/main/nsd/nsd.initd
index 6318204..2d3769b 100644
--- a/main/nsd/nsd.initd
+++ b/main/nsd/nsd.initd
@@ -1,19 +1,15 @@
-#!/sbin/openrc-run
+#!/sbin/runscript
=C2=A0# Copyright 1999-2013 Gentoo Foundation
=C2=A0# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-dns/nsd/files/nsd.initd,v 1.2 2013/= 04/03 19:10:39 wschlich Exp $

-name=3D"NSD"
=C2=A0description=3D"NSD is an authoritative-only, high performance, o= pen source name server"
=C2=A0extra_commands=3D"configtest"

=C2=A0# these can be overridden in /etc/conf.d/nsd if necessary
=C2=A0NSD_CONFIG=3D"${NSD_CONFIG:-/etc/nsd/nsd.conf}"
-command=3D"${NSD_BINARY:-/usr/sbin/nsd}"
+NSD_BINARY=3D"${NSD_BINARY:-/usr/sbin/nsd}"
=C2=A0NSD_CHECKCONF=3D"${NSD_CHECKCONF:-/usr/sbin/nsd-checkconf}"=

-command_args=3D"-c ${NSD_CONFIG}"
-
=C2=A0depend() {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 need net
=C2=A0 =C2=A0 =C2=A0 =C2=A0 use logger
@@ -37,15 +33,20 @@ checkconfig() {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 return 0
=C2=A0}

-start_pre() {
+start() {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0ebegin "Starting NSD"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 checkconfig || return $?
-=C2=A0 =C2=A0 =C2=A0 =C2=A0pidfile=3D$("${NSD_CHECKCONF}" -o pid= file "${NSD_CONFIG}")
-=C2=A0 =C2=A0 =C2=A0 =C2=A0checkpath --directory --owner nsd:nsd "${p= idfile%/*}"
+=C2=A0 =C2=A0 =C2=A0 =C2=A0local pidfile=3D$("${NSD_CHECKCONF}" = -o pidfile "${NSD_CONFIG}")
+=C2=A0 =C2=A0 =C2=A0 =C2=A0checkpath --directory --owner nsd:nsd $(dirname= "${pidfile}")
+=C2=A0 =C2=A0 =C2=A0 =C2=A0start-stop-daemon --start --pidfile "${pid= file}" \
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0--exec "${NSD_= BINARY}" -- -c "${NSD_CONFIG}"
+=C2=A0 =C2=A0 =C2=A0 =C2=A0eend $?
=C2=A0}

-
-stop_pre() {
+stop() {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0ebegin "Stopping NSD"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 checkconfig || return $?
-=C2=A0 =C2=A0 =C2=A0 =C2=A0pidfile=3D$("${NSD_CHECKCONF}" -o pid= file "${NSD_CONFIG}")
+=C2=A0 =C2=A0 =C2=A0 =C2=A0local pidfile=3D$("${NSD_CHECKCONF}" = -o pidfile "${NSD_CONFIG}")
+=C2=A0 =C2=A0 =C2=A0 =C2=A0start-stop-daemon --stop --pidfile "${pidf= ile}"
+=C2=A0 =C2=A0 =C2=A0 =C2=A0eend $?
=C2=A0}
-
--
2.6.4



---
Unsubscribe:=C2=A0 alpine-aports+unsubscribe@lists.alpinelinux.= org
Help:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0alpine-aports+help@lists.alpine= linux.org
---


--001a113d77ea02dcff0527294883-- --- Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org Help: alpine-aports+help@lists.alpinelinux.org ---