Sören Tempel: 1 main/nsd: copy new version of the OpenRC service from Gentoo 2 files changed, 18 insertions(+), 18 deletions(-)
if use the power and defaults of openrc-run, init-script with the same functionality will looks like: --- nsd.initd --- #!/sbin/openrc-run description="NSD is an authoritative-only, high performance, open source name server" checkconf="{NSD_CHECKCONF:-/usr/sbin/nsd-checkconf} cfgfile=${NSD_CONFIG:-/etc/nsd/nsd.conf} pidfile=$($checkconf -o pidfile $cfgfile) command=${NSD_BINARY:-/usr/sbin/nsd} command_args="-c $cfgfile" required_files="$cfgfile" depend() { need net use logger } start_pre() { ebegin checkpath --directory --owner nsd:nsd ${pidfile%/*} $checkconf $cfgfile eend $? }
Sören Tempel <soeren@soeren-tempel.net>I know I was just too lazy to write it. I will close this request, would you mind submitting a new patch which uses your service instead? --- Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org Help: alpine-aports+help@lists.alpinelinux.org ---
2015-12-17 23:06 GMT+02:00 Valery Kartel <valery.kartel@gmail.com>:
I made a sample script for 30 seconds and did not test it. Yes, I'll made a commit after testing it. 19 груд. 2015 17:21 "Sören Tempel" <soeren@soeren-tempel.net> пише:
Copy & paste the following snippet into your terminal to import this patchset into git:
curl -s https://lists.alpinelinux.org/~alpine/aports/patches/1944/mbox | git am -3Learn more about email & git
--- 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 <ncopa@alpinelinux.org> pkgname=nsd pkgver=4.1.6 -pkgrel=0 +pkgrel=1 pkgdesc="NSD is an authoritative only, high performance, simple and open source name server." url="http://www.nlnetlabs.nl/projects/nsd/" arch="all" @@ -32,7 +32,6 @@ prepare() { build() { cd "$_builddir" - ./configure \ --build=$CBUILD \ --host=$CHOST \ @@ -67,8 +66,8 @@ doc() { } md5sums="607e0a2afa9365c96d981f2fd36942dc nsd-4.1.6.tar.gz -62301a021d2b2e1972625e56ea8138d1 nsd.initd" +b3af3579bdccf072183f7311b5307011 nsd.initd" sha256sums="88f622055c95d38b9ef3723a240d1d0da35a28d09fe23b601015181a61d7775f nsd-4.1.6.tar.gz -8f9ca311a60e2a3db3fcc64b66cce2d6ff84b5600f47d5ece349d90926e90f27 nsd.initd" +15e96b6738f51587ff9512b5d4bafd312ef77ccd1124009f7e7270558351935b nsd.initd" sha512sums="c9bd4901e49a718ef435862d55a9c351586ecd4349c52d39ee18acf6ca33e3488eb581115fe6a99d0a1fd975117168d2756866429fc517ebe4713a211811333d nsd-4.1.6.tar.gz -402142ad1bb422a9a29ee8c7606bd513defa41563d47fb547812d4682862da5646022aa8c4577ed2d2a151388a12ec2f7b472e6a6091406859c0eb1f7f00c5b6 nsd.initd" +080d30c18d4cc3077a7e2d773b7abedff454f6b5a9dd4994418eaab615587676f26e4e518f21a59b9cc95923a0d98611ce54a605c5638cea99d33d32f9395fc8 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="NSD" description="NSD is an authoritative-only, high performance, open source name server" extra_commands="configtest" # these can be overridden in /etc/conf.d/nsd if necessary NSD_CONFIG="${NSD_CONFIG:-/etc/nsd/nsd.conf}" -command="${NSD_BINARY:-/usr/sbin/nsd}" +NSD_BINARY="${NSD_BINARY:-/usr/sbin/nsd}" NSD_CHECKCONF="${NSD_CHECKCONF:-/usr/sbin/nsd-checkconf}" -command_args="-c ${NSD_CONFIG}" - depend() { need net use logger @@ -37,15 +33,20 @@ checkconfig() { return 0 } -start_pre() { +start() { + ebegin "Starting NSD" checkconfig || return $? - pidfile=$("${NSD_CHECKCONF}" -o pidfile "${NSD_CONFIG}") - checkpath --directory --owner nsd:nsd "${pidfile%/*}" + local pidfile=$("${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=$("${NSD_CHECKCONF}" -o pidfile "${NSD_CONFIG}") + local pidfile=$("${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 ---
Valery Kartel <valery.kartel@gmail.com>Is it really new rc-script? Looks like legacy runscript-based. 17 груд. 2015 22:33 "Sören Tempel" <soeren+git@soeren-tempel.net> пише: