diff options
author | Przemyslaw Pawelczyk <przemoc@zoho.com> | 2016-06-17 03:47:30 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2016-06-20 13:35:25 +0000 |
commit | 071c1400c272c0f381651a0dc9b181ab0abfc1fc (patch) | |
tree | 0a4bfda4a910a0cce3d59bbff34bce1880c0eeea /testing/clapf/clapf.initd | |
parent | 94e0b0631f3760e6ba47edf9dbb2637a575a8019 (diff) | |
download | aports-071c1400c272c0f381651a0dc9b181ab0abfc1fc.tar.bz2 aports-071c1400c272c0f381651a0dc9b181ab0abfc1fc.tar.xz |
testing/clapf: Fix a lot of problems.
* APKBUILD: Leverage default_prepare and use builddir (no _).
* APKBUILD: Update url and source url.
Original tar seems not available anymore and there are no
tags in clapf's bitbucket repository, so use commit marked
as release of version that was shipped before.
* APKBUILD: Introduce some constants for better DRY-ness,
reformat package() function, create there a workdir
(otherwise clapf won't start) and fix permissions.
* APKBUILD: make -j1 is deliberate, as it fails with more jobs,
but I am not willing to spend any more time on this package.
* ldflags.patch: Set soname (otherwise -dev subpkg will haunt you).
* clapf.confd: Make it somewhat usable. TMPDIR seemed useless.
* clapf.initd: Rewrite using openrc-run default ssd functions.
* clapf.pre-install: Change user and group to clapf.
It has not been tested with mta, but at least it starts now if you have
virus databases present. Run freshclam if you don't have them yet.
Diffstat (limited to 'testing/clapf/clapf.initd')
-rw-r--r-- | testing/clapf/clapf.initd | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/testing/clapf/clapf.initd b/testing/clapf/clapf.initd index eaf2aa49e3..b3e6c6dd90 100644 --- a/testing/clapf/clapf.initd +++ b/testing/clapf/clapf.initd @@ -1,23 +1,27 @@ -#!/sbin/runscript -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: +#!/sbin/openrc-run + +description="Email content filter" +extra_started_commands="reload" + +command="/usr/sbin/clapf" +pidfile="/var/run/clapf/clapf.pid" +CLAPF_CONF="${CLAPF_CONF:-/etc/clapf.conf}" +CLAPF_USER="${CLAPF_USER:-clapf}" +CLAPF_GROUP="${CLAPF_GROUP:-clapf}" +command_user="$CLAPF_USER${CLAPF_GROUP:+:}$CLAPF_GROUP" +command_args="${CLAPF_OPTS:--c $CLAPF_CONF}" +command_background="YES" depend() { need net - use logger + use logger before mta } -start() { - ebegin "Starting clapf" - start-stop-daemon --start --quiet --user clapf --background \ - --exec /usr/sbin/clapf --make-pidfile --pid /var/run/clapf/clapf.pid -- -c /etc/clapf.conf - eend $? -} - -stop() { - ebegin "Stopping clapf" - start-stop-daemon --stop --quiet --pidfile /var/run/clapf/clapf.pid +reload() { + ebegin "Reloading ${name:-$RC_SVCNAME}" + start-stop-daemon --signal HUP \ + ${command:+--exec} $command \ + ${pidfile:+--pidfile} $pidfile eend $? } |