Commit 0ef12d48 authored by Carlo Landmeter's avatar Carlo Landmeter

testing/gross-svn: run as user gross

parent 53daaab1
......@@ -2,16 +2,18 @@
# Maintainer: Carlo Landmeter <clandmeter@gmail.com>
pkgname=gross-svn
pkgver=511
pkgrel=0
pkgrel=1
pkgdesc="Greylisting of suspicious sources"
url="http://code.google.com/p/gross/"
license="BSD"
depends=""
depends="uclibc"
makedepends="c-ares"
install="$pkgname.post-install $pkgname.pre-install"
subpackages="$pkgname-doc $pkgname-dev"
source="http://alpine.nethq.org/clandmeter/src/${pkgname}-${pkgver}.tar.bz2
$pkgname.initd
$pkgname.confd"
$pkgname.confd
$install"
build() {
cd "$srcdir/$pkgname-$pkgver"
......@@ -23,11 +25,13 @@ build() {
make || return 1
make -j1 DESTDIR="$pkgdir" install
install -dD -onobody -gnobody "$pkgdir"/var/run/grossd
install -dD "$pkgdir"/var/run/gross
install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/gross
install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/gross
}
md5sums="f2488ced5b47f359c3a1127d9ba3453c gross-svn-511.tar.bz2
c5fbd3396e901c5e35e3961deb0b36b6 gross-svn.initd
b95f2fba652bc93022ad87cffd096f84 gross-svn.confd"
f553899b62bea50c25baf6f88afe69af gross-svn.initd
5ca1c6e51c3243236e6564480b20279b gross-svn.confd
4b55d1c5534167946cc11376d1b05c34 gross-svn.post-install
8f6e45b98888dbb9971f7681bf431f6f gross-svn.pre-install"
......@@ -3,6 +3,4 @@
#
OPTS=""
USER="nobody"
GROUP="nobody"
#!/sbin/runscript
NAME=grossd
DAEMON=/usr/sbin/$NAME
NAME="grossd"
DAEMON="/usr/sbin/$NAME"
USER="gross"
GROUP="gross"
depend() {
need net
need net
}
check_config() {
if [ ! -e /var/db/gross/ ] ; then
einfo "Generating Gross database..."
install -dD -o${USER} -g${GROUP} /var/db/gross
${DAEMON} -Cf /etc/grossd.conf > /dev/null
fi
if [ ! -f /var/db/gross/state ] ; then
einfo "Generating Gross database..."
install -dD -o${USER} -g${GROUP} /var/db/gross
${DAEMON} -Cu ${USER} > /dev/null
fi
}
start() {
check_config || return 1
ebegin "Starting ${NAME}"
start-stop-daemon --start --quiet --background \
--exec ${DAEMON} -- ${OPTS}
eend $?
check_config || return 1
ebegin "Starting ${NAME}"
start-stop-daemon --start --quiet --background \
--exec ${DAEMON} -- \
-p /var/run/gross/grossd.pid \
-u ${USER} ${OPTS}
eend $?
}
stop() {
ebegin "Stopping ${NAME}"
start-stop-daemon --stop --pidfile /var/run/grossd/grossd.pid
eend $?
ebegin "Stopping ${NAME}"
start-stop-daemon --stop --pidfile /var/run/gross/grossd.pid
eend $?
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment