X-Original-To: alpine-aports@lists.alpinelinux.org Received: from mail-ua0-f177.google.com (mail-ua0-f177.google.com [209.85.217.177]) by lists.alpinelinux.org (Postfix) with ESMTP id 093815C5007 for ; Wed, 1 Mar 2017 08:56:58 +0000 (GMT) Received: by mail-ua0-f177.google.com with SMTP id q7so6031346uaf.2 for ; Wed, 01 Mar 2017 00:56:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=HnZhiDfJWsjNr4xbxWlHCDytiSBBeijbf3JeHPpuDrg=; b=fB3Qb1D3tftAhig7Tt/iiJ617k3xUxDGjbb24ekh4wfRtN1WFHfH/MFiJ/iwB3C9k9 qe8+Mz66jXjvrOmFIO+m/PBOjNxOTqTWAunntcCUvI3hxKJZsYgH72NbyBvZtmfNLoqj kLImbWGMrVPg2ZQCePby1BwOIUSn82Jf8XXpYTRvTRb+eYQNDgU8U4O0uGKA+eW/MTuP O0QpJ6FON32+DeUzoQt++lVzSzdIQodURIEmFmDwNZcNJesnzRmKRBpHVQ9faChDS8rX 5/STJPI5FzuvO0895tGnHyCddcVWbHKQDa+SinsF1+z+i5tKjYRJwAu8XtW7hUckurl6 WhyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=HnZhiDfJWsjNr4xbxWlHCDytiSBBeijbf3JeHPpuDrg=; b=t4aToNCFhXIsHQs+5sgm6i7grpxVOBm7hRQaiw1UNG0lLoPY0S4UYK2BpwMWFc3sga D2IBm31W6uOyrKUd70jRLqqDDFIxWrJ8VqzWoT4VQrlG7wjkVgYhlbA1nNoDy7ftBdwj OJ5YB3/KqJLlAQ53CWPcjJo65qNkJ3KTu+k1XU/j4qat++kzkgRpotZxXXILAJCtTgnF XxXpygR9vt/Fgv7VW5+TCBjekU0K4JqYqstyBuEsG3HT7RmOz2wpG0ElCewD18uprXNy 2kdUqv4rExgRohSLHf7I/kDHvTVdhgEpfR+ve/mdWhfNch2LCaoPFfiI5NDFSJ3qzMsR w53w== X-Gm-Message-State: AMke39mQO+bsVqJAJilUaqw0hxCyS0YXEUrgIm/EJw/c8Q1NWOt5hi42oerNK3AusgBHsXiaIL/4ozZWzgIMXw== X-Received: by 10.159.32.78 with SMTP id 72mr2878576uam.59.1488358617462; Wed, 01 Mar 2017 00:56:57 -0800 (PST) X-Mailinglist: alpine-aports Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Received: by 10.103.104.66 with HTTP; Wed, 1 Mar 2017 00:56:57 -0800 (PST) In-Reply-To: <20170227185419.2e7c62fb@ncopa-desktop.copa.dup.pw> References: <20170227123945.22063-1-valery.kartel@gmail.com> <20170227173932.457b9156@ncopa-desktop.copa.dup.pw> <20170227185419.2e7c62fb@ncopa-desktop.copa.dup.pw> From: Valery Kartel Date: Wed, 1 Mar 2017 10:56:57 +0200 Message-ID: Subject: Re: [alpine-aports] [PATCH v5] testing/rspamd: upgrade to 1.4.4 To: Natanael Copa Cc: alpine-aports Content-Type: multipart/alternative; boundary=94eb2c03e792b13d350549a77e8e --94eb2c03e792b13d350549a77e8e Content-Type: text/plain; charset=UTF-8 You right. I made it complicated... 2017-02-27 19:54 GMT+02:00 Natanael Copa : > On Mon, 27 Feb 2017 18:42:22 +0200 > Valery Kartel wrote: > > > start_pre also calls on restart. But we don't need to check/create > pidfile > > directory in this case. > > I think we need to check/create pidfile if you modify RSPAMD_PIDFILE > and restart? > > And the redirections, Why can't we do the redirection in start_pre? > > checkconfig() { > $command $command_args -t > } > > start_pre() { > ... > checkconfig >/dev/null 2>>${startuplog:=${RSPAMD_ > STARTUPLOG:-/dev/null}} > } > > -nc > > > > > 27 ****. 2017 *. 18:39 ************ "Natanael Copa" < > ncopa@alpinelinux.org> > > *******: > > > > > On Mon, 27 Feb 2017 14:39:45 +0200 > > > Valery Kartel wrote: > > > > > > > --- > > > > v1 -> v2: add checkconfig command to init script > > > > > > > > v2 -> v3: fix checksums > > > > > > > > v3 -> v4: remade init-script with checkconfig sub > > > > > > > > v4 -> v5: remade init.d and conf.d to use unique RSPAMD_* vars > > > > remade checkconfig to be a user-called command > > > > --- > > > > testing/rspamd/APKBUILD | 22 +++++----------------- > > > > testing/rspamd/rspamd.confd | 15 ++++++++------- > > > > testing/rspamd/rspamd.initd | 36 +++++++++++++++++++++++++----- > ------ > > > > 3 files changed, 38 insertions(+), 35 deletions(-) > > > > > > > > diff --git a/testing/rspamd/APKBUILD b/testing/rspamd/APKBUILD > > > > index 85fc20a1b8..69c35c1707 100644 > > > > --- a/testing/rspamd/APKBUILD > > > > +++ b/testing/rspamd/APKBUILD > > > > @@ -2,8 +2,8 @@ > > > > # Contributor: Valery Kartel > > > > # Contributor: Nathan Angelacos > > > > pkgname=rspamd > > > > -pkgver=1.4.3 > > > > -pkgrel=1 > > > > +pkgver=1.4.4 > > > > +pkgrel=0 > > > > pkgdesc="Fast, free and open-source spam filtering system" > > > > url="https://rspamd.com" > > > > arch="x86_64 x86 armhf" > > > > @@ -106,21 +106,9 @@ utils() { > > > > mv "$pkgdir"/usr/bin/${pkgname}-redirector > "$subpkgdir"/usr/bin > > > > } > > > > > > > > -md5sums="a64e00b906b7f3590e855be50106f99f rspamd-1.4.3.tar.xz > > > > -c152c6a90f6ae9e5a7a1d137dfbc0305 rspamd.logrotated > > > > -0656acc12dcce7cba232857a848d0390 rspamd.initd > > > > -ab12f33ad8e12a7437fb5ea4a9c92eef rspamd.confd > > > > -ff0bf4f1b1447ca401865369f91418f1 config.patch > > > > -83f76787389649af63ea921f81cf35b3 cmakelists.patch" > > > > -sha256sums="144cddc25ce8d8519b289d2c00d34b > > > 37c931f3c7293e2b0d16c408680021a1bf rspamd-1.4.3.tar.xz > > > > -6c5e79e9052d957f3d0d634b2ae7a56bbc0901a5d6946dc991c92f19a72fce97 > > > rspamd.logrotated > > > > -5bcf68a72e0582859799cd335a14d48914e5291f4087327b3b42562ef64e2958 > > > rspamd.initd > > > > -fceba39a20755d48ef3838f7daa92ed9686a118c0a26f06bfe72cc7c15b2e384 > > > rspamd.confd > > > > -7e0adb4a2e7e8f806fc5fdae0c37e6948ed56e9d46d4eed0c681806decb90e49 > > > config.patch > > > > -d4bc7851bb32b49be98e3964aa9195033b586da27f7f3afa5ce12dfbeadd96b0 > > > cmakelists.patch" > > > > -sha512sums="bae86953d881be446f049384cc8bf8 > > > 451b04619b461a7e2d571407d5af5f2547af8bc9db578e84190e8c55d01f > > > 9e32ea1d29e998daa2bbb2fac431ed50df27ca rspamd-1.4.3.tar.xz > > > > +sha512sums="df2260de6585699a5b6692aa210647 > > > 270b7132372ae6a2437f8532265018fe4db8270a8989ce0c0664cad17cbc > > > 281ae92f935c4f0974dc2f8da309e54c234b14 rspamd-1.4.4.tar.xz > > > > 2efe28575c40d1fba84b189bb872860e744400db80dce2f6330be6c6287f > > > b3f46e6511284729b957488bf40bcb9b0952e26df9934f5f138334bd2766075c45cb > > > rspamd.logrotated > > > > -e240983c2fd91d8061b17e35e83a75c56ac2c3625dbe07b83a2e89e3dbf6 > > > 9b57c675d01772b93968aa6b22d150d54d366f2fb4a0c6551b3cfdedc77d82e28652 > > > rspamd.initd > > > > -1320a752cbefe021079b3ed23e312231c39fc600baba7d8440c3e8bdd33e > > > d673c8831b44a0c76788a8d905469e81088adf26cf245c09b4c2c4fdce7ff4219ee7 > > > rspamd.confd > > > > +3ffe0b57a0f62a1d4e6dbc701e68480a91bf161b337e63a8dc25e1b69695 > > > 1f1510f6f03d1d986875b73ba33db76f86504895b69bcaed7b32b026e6e6e4559df6 > > > rspamd.initd > > > > +e417dd825d1b4d03d115db037b2fdf2f48a35420ee7a9010d97167b6c31e > > > 88d6c0a15dd33b21d7d76856db0fdc5097c922fcdf1d8164d1e92ae377f7c5303947 > > > rspamd.confd > > > > 2089429e6f44f8204f31c87c565cdd7abcd51b3146397ba1b2fb23b1be6f > > > af46fd8ec36718f194a3fc38ac1d38d7be9010a84ac4b49d7e1597706699538c607a > > > config.patch > > > > 99593c10ffb04c71a4c83c7522b41f12465a9862283685bbc2fff464fd84 > > > fcf8b4bc4a892419d31332c01f805c69dd7730f537c60248b92fee35acdc6633a644 > > > cmakelists.patch" > > > > diff --git a/testing/rspamd/rspamd.confd > b/testing/rspamd/rspamd.confd > > > > index 9b2cc4b34f..e804b2b642 100644 > > > > --- a/testing/rspamd/rspamd.confd > > > > +++ b/testing/rspamd/rspamd.confd > > > > @@ -1,15 +1,16 @@ > > > > # User and group to run rspamd workers > > > > -#user=rspamd > > > > -#group=rspamd > > > > +#RSPAMD_USER=rspamd > > > > +#RSPAMD_GROUP=rspamd > > > > > > > > -# Main config file > > > > -#cfgfile=/etc/rspamd/rspamd.conf > > > > +# Main config dir or file > > > > +#RSPAMD_CONFDIR=/etc/rspamd > > > > +#RSPAMD_CONFIG=/etc/rspamd/rspamd.conf > > > > > > > > # PID file. Settings from config files are ignored > > > > -#pidfile=/run/rspamd/rspamd.pid > > > > +#RSPAMD_PIDFILE=/run/$RC_SVCNAME/rspamd.pid > > > > > > > > # Where to log startup configuration checking > > > > # - /dev/null - silent (default) > > > > -# - /dev/tty - show output on curent terminal > > > > +# - /dev/stdout - show output on curent terminal > > > > # - /path/filename - append to specified logfile > > > > -#startuplog=/var/log/rspamd/startup.log > > > > +#RSPAMD_STARTUPLOG=/var/log/rspamd/startup.log > > > > diff --git a/testing/rspamd/rspamd.initd > b/testing/rspamd/rspamd.initd > > > > index 93148ccb4b..0bffd00c26 100644 > > > > --- a/testing/rspamd/rspamd.initd > > > > +++ b/testing/rspamd/rspamd.initd > > > > @@ -1,14 +1,19 @@ > > > > #!/sbin/openrc-run > > > > > > > > description="Rapid spam filtering system" > > > > -user=${user:-rspamd} > > > > -group=${group:-rspamd} > > > > -cfgfile=${cfgfile:-/etc/rspamd/rspamd.conf} > > > > -pidfile=${pidfile:-/run/rspamd/rspamd.pid} > > > > + > > > > +: ${user:=${RSPAMD_USER:-rspamd}} > > > > +: ${group:=${RSPAMD_GROUP:-rspamd}} > > > > +: ${cfgdir:=${RSPAMD_CONFDIR:-/etc/rspamd}} > > > > +: ${cfgfile:=${RSPAMD_CONFIG:-$cfgdir/rspamd.conf}} > > > > +: ${pidfile:=${RSPAMD_PIDFILE:-/run/$RC_SVCNAME/rspamd.pid}} > > > > + > > > > command=/usr/sbin/rspamd > > > > command_args="-u $user -g $group -c $cfgfile -p $pidfile" > > > > required_files="$cfgfile" > > > > +extra_commands="checkconfig" > > > > extra_started_commands="reload reopen" > > > > +description_checkconfig="Verify configuration" > > > > description_reload="Reload configuration" > > > > description_reopen="Reopen log files" > > > > > > > > @@ -17,21 +22,30 @@ depend() { > > > > before mta > > > > } > > > > > > > > +checkconfig() { > > > > + if [ "$RC_CMD" = "checkconfig" ]; then > > > > + startuplog=/dev/stderr > > > > + ebegin "Checking $RC_SVCNAME config" > > > > + fi > > > > + $command $command_args -t >/dev/null 2>>${startuplog:=${RSPAMD_ > > > STARTUPLOG:-/dev/null}} > > > > + local result=$? > > > > + [ "$RC_CMD" = "checkconfig" ] || return $result > > > > + eend $result > > > > +} > > > > > > I don't like the "$RC_CMD" conditionals. Why can't we do the > redirection > > > in start_pre? > > > > > > checkconfig() { > > > $command $command_args -t > > > } > > > > > > start_pre() { > > > ... > > > checkconfig >/dev/null 2>>${startuplog:=${RSPAMD_ > > > STARTUPLOG:-/dev/null}} > > > } > > > > > > > > > > + > > > > start_pre() { > > > > - ebegin > > > > - checkpath --directory --mode 750 --owner $user:$group > ${pidfile%/*} > > > > - $command $command_args -t >/dev/null > 2>>${startuplog:-/dev/null} > > > > - eend $? > > > > + [ "$RC_CMD" = "start" ] && checkpath -d -m 750 -o $user:$group > > > ${pidfile%/*} > > > > > > Why do you need to check if RC_CMD is "start"? Will this function ever > > > run when its not "start"? > > > > > > -nc > > > > > > > > > > + checkconfig > > > > } > > > > > > > > reload() { > > > > - ebegin "Reloading ${SVCNAME}" > > > > - start-stop-daemon --signal HUP --pidfile $pidfile > > > > + ebegin "Reloading $RC_SVCNAME config" > > > > + checkconfig && start-stop-daemon --signal HUP --pidfile > $pidfile > > > > eend $? > > > > } > > > > > > > > reopen() { > > > > - ebegin "Reopening ${SVCNAME} log files" > > > > + ebegin "Reopening $RC_SVCNAME log files" > > > > start-stop-daemon --signal USR1 --pidfile $pidfile > > > > eend $? > > > > } > > > > > > > > --94eb2c03e792b13d350549a77e8e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

You right. I made it=C2=A0 complicated...

2017-02-27 19:54 GM= T+02:00 Natanael Copa <ncopa@alpinelinux.org>:
On Mon, 27 Feb 2017 18:42:22 +020= 0
Valery Kartel <valery.kartel@= gmail.com> wrote:

> start_pre also calls on restart. But we don't need to check/create= pidfile
> directory in this case.

I think we need to check/create pidfile if you modify RSPAMD_PIDFILE=
and restart?

And the redirections, Why can't we do the redirection in start_pre?

checkconfig() {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $command $command_args -t
}

start_pre() {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ...
=C2=A0 =C2=A0 =C2=A0 =C2=A0 checkconfig >/dev/null 2>>${startuplog= :=3D${RSPAMD_STARTUPLOG:-/dev/null}}
}

-nc

>
> 27 ****. 2017 *. 18:39 ************ "Natanael Copa" <ncopa@alpinelinux.org>
> *******:
>
> > On Mon, 27 Feb 2017 14:39:45 +0200
> > Valery Kartel <vale= ry.kartel@gmail.com> wrote:
> >
> > > ---
> > > v1 -> v2: add checkconfig command to init script
> > >
> > > v2 -> v3: fix checksums
> > >
> > > v3 -> v4: remade init-script with checkconfig sub
> > >
> > > v4 -> v5: remade init.d and conf.d to use unique RSPAMD_*= vars
> > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0remade checkconfig t= o be a user-called command
> > > ---
> > >=C2=A0 testing/rspamd/APKBUILD=C2=A0 =C2=A0 =C2=A0| 22 +++++-= ----------------
> > >=C2=A0 testing/rspamd/rspamd.confd | 15 ++++++++-------
> > >=C2=A0 testing/rspamd/rspamd.initd | 36 +++++++++++++++++++++= ++++-----------
> > >=C2=A0 3 files changed, 38 insertions(+), 35 deletions(-)
> > >
> > > diff --git a/testing/rspamd/APKBUILD b/testing/rspamd/APKBUI= LD
> > > index 85fc20a1b8..69c35c1707 100644
> > > --- a/testing/rspamd/APKBUILD
> > > +++ b/testing/rspamd/APKBUILD
> > > @@ -2,8 +2,8 @@
> > >=C2=A0 # Contributor: Valery Kartel <valery.kartel@gmail.com>
> > >=C2=A0 # Contributor: Nathan Angelacos <nangel@alpinelinux.org>
> > >=C2=A0 pkgname=3Drspamd
> > > -pkgver=3D1.4.3
> > > -pkgrel=3D1
> > > +pkgver=3D1.4.4
> > > +pkgrel=3D0
> > >=C2=A0 pkgdesc=3D"Fast, free and open-source spam filter= ing system"
> > >=C2=A0 url=3D"https://rspamd.com"
> > >=C2=A0 arch=3D"x86_64 x86 armhf"
> > > @@ -106,21 +106,9 @@ utils() {
> > >=C2=A0 =C2=A0 =C2=A0 =C2=A0mv "$pkgdir"/usr/bin/${p= kgname}-redirector "$subpkgdir"/usr/bin
> > >=C2=A0 }
> > >
> > > -md5sums=3D"a64e00b906b7f3590e855be50106f99f= =C2=A0 rspamd-1.4.3.tar.xz
> > > -c152c6a90f6ae9e5a7a1d137dfbc0305=C2=A0 rspamd.log= rotated
> > > -0656acc12dcce7cba232857a848d0390=C2=A0 rspamd.ini= td
> > > -ab12f33ad8e12a7437fb5ea4a9c92eef=C2=A0 rspamd.con= fd
> > > -ff0bf4f1b1447ca401865369f91418f1=C2=A0 config.pat= ch
> > > -83f76787389649af63ea921f81cf35b3=C2=A0 cmakelists= .patch"
> > > -sha256sums=3D"144cddc25ce8d8519b289d2c00d34b
> > 37c931f3c7293e2b0d16c408680021a1bf=C2=A0 rspamd-= 1.4.3.tar.xz
> > > -6c5e79e9052d95= 7f3d0d634b2ae7a56bbc0901a5d6946dc991c92f19a72fce97
> > rspamd.logrotated
> > > -5bcf68a72e0582859799cd335a14d48914e5291f4087327b3= b42562ef64e2958
> > rspamd.initd
> > > -fceba39a20755d48ef3838f7daa92ed9686a118c0a26f06bf= e72cc7c15b2e384
> > rspamd.confd
> > > -7e0adb4a2e7e8f806fc5fdae0c37e6948ed56e9d46d4eed0c= 681806decb90e49
> > config.patch
> > > -d4bc7851bb32b49be98e3964aa9195033b586da27f7f3afa5= ce12dfbeadd96b0
> > cmakelists.patch"
> > > -sha512sums=3D"bae86953d881be446f049384cc8bf8
> > 451b04619b461a7e2d571407d5af5f2547af8bc9db578e84190e8c55d01f=
> > 9e32ea1d29e998daa2bbb2fac431ed50df27ca=C2=A0 rspamd-1.4.3.ta= r.xz
> > > +sha512sums=3D"df2260de6585699a5b6692aa210647
> > 270b7132372ae6a2437f8532265018fe4db8270a8989ce0c0664cad17cbc=
> > 281ae92f935c4f0974dc2f8da309e54c234b14=C2=A0 rspamd-1.4.4.ta= r.xz
> > >=C2=A0 2efe28575c40d1fba84b189bb872860e744400db80dce2f63= 30be6c6287f
> > b3f46e6511284729b957488bf40bcb9b0952e26df9934f5f138334bd2766= 075c45cb
> > rspamd.logrotated
> > > -e240983c2fd91d8061b17e35e83a75c56ac2c3625dbe07b83= a2e89e3dbf6
> > 9b57c675d01772b93968aa6b22d150d54d366f2fb4a0c6551b3cfdedc77d= 82e28652
> > rspamd.initd
> > > -1320a752cbefe021079b3ed23e312231c39fc600baba7d844= 0c3e8bdd33e
> > d673c8831b44a0c76788a8d905469e81088adf26cf245c09b4c2c4fdce7f= f4219ee7
> > rspamd.confd
> > > +3ffe0b57a0f62a1d4e6dbc701e68480a91bf161b337e63a8d= c25e1b69695
> > 1f1510f6f03d1d986875b73ba33db76f86504895b69bcaed7b32b026e6e6= e4559df6
> > rspamd.initd
> > > +e417dd825d1b4d03d115db037b2fdf2f48a35420ee7a9010d= 97167b6c31e
> > 88d6c0a15dd33b21d7d76856db0fdc5097c922fcdf1d8164d1e92ae377f7= c5303947
> > rspamd.confd
> > >=C2=A0 2089429e6f44f8204f31c87c565cdd7abcd51b3146397ba1b= 2fb23b1be6f
> > af46fd8ec36718f194a3fc38ac1d38d7be9010a84ac4b49d7e1597706699= 538c607a
> > config.patch
> > >=C2=A0 99593c10ffb04c71a4c83c7522b41f12465a9862283685bbc= 2fff464fd84
> > fcf8b4bc4a892419d31332c01f805c69dd7730f537c60248b92fee35acdc= 6633a644
> > cmakelists.patch"
> > > diff --git a/testing/rspamd/rspamd.confd b/testing/rspamd/rs= pamd.confd
> > > index 9b2cc4b34f..e804b2b642 100644
> > > --- a/testing/rspamd/rspamd.confd
> > > +++ b/testing/rspamd/rspamd.confd
> > > @@ -1,15 +1,16 @@
> > >=C2=A0 # User and group to run rspamd workers
> > > -#user=3Drspamd
> > > -#group=3Drspamd
> > > +#RSPAMD_USER=3Drspamd
> > > +#RSPAMD_GROUP=3Drspamd
> > >
> > > -# Main config file
> > > -#cfgfile=3D/etc/rspamd/rspamd.conf
> > > +# Main config dir or file
> > > +#RSPAMD_CONFDIR=3D/etc/rspamd
> > > +#RSPAMD_CONFIG=3D/etc/rspamd/rspamd.conf
> > >
> > >=C2=A0 # PID file. Settings from config files are ignored
> > > -#pidfile=3D/run/rspamd/rspamd.pid
> > > +#RSPAMD_PIDFILE=3D/run/$RC_SVCNAME/rspamd.pid
> > >
> > >=C2=A0 # Where to log startup configuration checking
> > >=C2=A0 # - /dev/null - silent (default)
> > > -# - /dev/tty - show output on curent terminal
> > > +# - /dev/stdout - show output on curent terminal
> > >=C2=A0 # - /path/filename - append to specified logfile
> > > -#startuplog=3D/var/log/rspamd/startup.log
> > > +#RSPAMD_STARTUPLOG=3D/var/log/rspamd/startup.log
> > > diff --git a/testing/rspamd/rspamd.initd b/testing/rspamd/rs= pamd.initd
> > > index 93148ccb4b..0bffd00c26 100644
> > > --- a/testing/rspamd/rspamd.initd
> > > +++ b/testing/rspamd/rspamd.initd
> > > @@ -1,14 +1,19 @@
> > >=C2=A0 #!/sbin/openrc-run
> > >
> > >=C2=A0 description=3D"Rapid spam filtering system"<= br> > > > -user=3D${user:-rspamd}
> > > -group=3D${group:-rspamd}
> > > -cfgfile=3D${cfgfile:-/etc/rspamd/rspamd.conf}
> > > -pidfile=3D${pidfile:-/run/rspamd/rspamd.pid}
> > > +
> > > +: ${user:=3D${RSPAMD_USER:-rspamd}}
> > > +: ${group:=3D${RSPAMD_GROUP:-rspamd}}
> > > +: ${cfgdir:=3D${RSPAMD_CONFDIR:-/etc/rspamd}}
> > > +: ${cfgfile:=3D${RSPAMD_CONFIG:-$cfgdir/rspamd.conf}}<= br> > > > +: ${pidfile:=3D${RSPAMD_PIDFILE:-/run/$RC_SVCNAME/rspa= md.pid}}
> > > +
> > >=C2=A0 command=3D/usr/sbin/rspamd
> > >=C2=A0 command_args=3D"-u $user -g $group -c $cfgfile -p= $pidfile"
> > >=C2=A0 required_files=3D"$cfgfile"
> > > +extra_commands=3D"checkconfig"
> > >=C2=A0 extra_started_commands=3D"reload reopen"
> > > +description_checkconfig=3D"Verify configuration&q= uot;
> > >=C2=A0 description_reload=3D"Reload configuration"<= br> > > >=C2=A0 description_reopen=3D"Reopen log files"
> > >
> > > @@ -17,21 +22,30 @@ depend() {
> > >=C2=A0 =C2=A0 =C2=A0 =C2=A0before mta
> > >=C2=A0 }
> > >
> > > +checkconfig() {
> > > +=C2=A0 =C2=A0 =C2=A0if [ "$RC_CMD" =3D "chec= kconfig" ]; then
> > > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0startuplog= =3D/dev/stderr
> > > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ebegin &quo= t;Checking $RC_SVCNAME config"
> > > +=C2=A0 =C2=A0 =C2=A0fi
> > > +=C2=A0 =C2=A0 =C2=A0$command $command_args -t >/dev/null= 2>>${startuplog:=3D${RSPAMD_
> > STARTUPLOG:-/dev/null}}
> > > +=C2=A0 =C2=A0 =C2=A0local result=3D$?
> > > +=C2=A0 =C2=A0 =C2=A0[ "$RC_CMD" =3D "checkco= nfig" ] || return $result
> > > +=C2=A0 =C2=A0 =C2=A0eend $result
> > > +}
> >
> > I don't like the "$RC_CMD" conditionals. Why can= 9;t we do the redirection
> > in start_pre?
> >
> > checkconfig() {
> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$command $command_args -t
> > }
> >
> > start_pre() {
> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0...
> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0checkconfig >/dev/null 2>&= gt;${startuplog:=3D${RSPAMD_
> > STARTUPLOG:-/dev/null}}
> > }
> >
> >
> > > +
> > >=C2=A0 start_pre() {
> > > -=C2=A0 =C2=A0 =C2=A0ebegin
> > > -=C2=A0 =C2=A0 =C2=A0checkpath --directory --mode 750 --owne= r $user:$group ${pidfile%/*}
> > > -=C2=A0 =C2=A0 =C2=A0$command $command_args -t >/dev/null= 2>>${startuplog:-/dev/null}
> > > -=C2=A0 =C2=A0 =C2=A0eend $?
> > > +=C2=A0 =C2=A0 =C2=A0[ "$RC_CMD" =3D "start&q= uot; ] && checkpath -d -m 750 -o $user:$group
> > ${pidfile%/*}
> >
> > Why do you need to check if RC_CMD is "start"? Will thi= s function ever
> > run when its not "start"?
> >
> > -nc
> >
> >
> > > +=C2=A0 =C2=A0 =C2=A0checkconfig
> > >=C2=A0 }
> > >
> > >=C2=A0 reload() {
> > > -=C2=A0 =C2=A0 =C2=A0ebegin "Reloading ${SVCNAME}"=
> > > -=C2=A0 =C2=A0 =C2=A0start-stop-daemon --signal HUP --pidfil= e $pidfile
> > > +=C2=A0 =C2=A0 =C2=A0ebegin "Reloading $RC_SVCNAME conf= ig"
> > > +=C2=A0 =C2=A0 =C2=A0checkconfig && start-stop-daemo= n --signal HUP --pidfile $pidfile
> > >=C2=A0 =C2=A0 =C2=A0 =C2=A0eend $?
> > >=C2=A0 }
> > >
> > >=C2=A0 reopen() {
> > > -=C2=A0 =C2=A0 =C2=A0ebegin "Reopening ${SVCNAME} log f= iles"
> > > +=C2=A0 =C2=A0 =C2=A0ebegin "Reopening $RC_SVCNAME log = files"
> > >=C2=A0 =C2=A0 =C2=A0 =C2=A0start-stop-daemon --signal USR1 --= pidfile $pidfile
> > >=C2=A0 =C2=A0 =C2=A0 =C2=A0eend $?
> > >=C2=A0 }
> >
> >


--94eb2c03e792b13d350549a77e8e-- --- Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org Help: alpine-aports+help@lists.alpinelinux.org ---