From 7fca49bbfd71e36912fe33249c9d9054812c33d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Fri, 8 Apr 2011 08:31:45 +0300 Subject: testing/lsyncd: fix init.d * default to root user (we are backing up files and need to open all of the files regardless of permissions) * use pidfile * depend on rsync as it's almost always required --- testing/lsyncd/APKBUILD | 6 +++--- testing/lsyncd/lsyncd.initd | 32 +++++++++++++++++++------------- 2 files changed, 22 insertions(+), 16 deletions(-) (limited to 'testing') diff --git a/testing/lsyncd/APKBUILD b/testing/lsyncd/APKBUILD index 7e79dbbc6d..14225e2a69 100644 --- a/testing/lsyncd/APKBUILD +++ b/testing/lsyncd/APKBUILD @@ -2,12 +2,12 @@ # Maintainer: Natanael Copa pkgname=lsyncd pkgver=2.0.4 -pkgrel=1 +pkgrel=2 pkgdesc="Live Syncing (Mirror) Daemon" url="http://code.google.com/p/lsyncd/" arch="all" license="GPLv2+" -depends= +depends="rsync" depends_dev= makedepends="$depends_dev lua-dev" install="" @@ -49,4 +49,4 @@ package() { } md5sums="0b4557dd3d87a02ae0cbd7b5fc16cd0c lsyncd-2.0.4.tar.gz -95ca2fe43eb6be8d1f58d5239d4df6a5 lsyncd.initd" +1224bbf02c2de6144b63cc5f3decfbf0 lsyncd.initd" diff --git a/testing/lsyncd/lsyncd.initd b/testing/lsyncd/lsyncd.initd index 9dfddd405d..5578b1a2af 100644 --- a/testing/lsyncd/lsyncd.initd +++ b/testing/lsyncd/lsyncd.initd @@ -2,25 +2,31 @@ NAME=lsyncd DAEMON=/usr/bin/$NAME -USER=daemon -CONF=/etc/lsyncd/lrsync.lua +PIDFILE=/var/run/$NAME.pid +USER=root +GROUP=root +CONF=/etc/lsyncd/lsyncd.lua depend() { - need net + need net } start() { - ebegin "Starting $NAME" - start-stop-daemon --start --quiet \ - --user $USER \ - --exec $DAEMON -- \ - $CONF - eend $? + touch "$PIDFILE" + chown $USER:$GROUP "$PIDFILE" + ebegin "Starting $NAME" + start-stop-daemon --start --quiet \ + --pidfile "$PIDFILE" \ + --user "$USER" --group "$GROUP" \ + --chdir /etc/lsyncd \ + --exec "$DAEMON" -- \ + "$CONF" -pidfile "$PIDFILE" + eend $? } stop() { - ebegin "Stopping $NAME" - start-stop-daemon --stop --quiet \ - --exec $DAEMON - eend $? + ebegin "Stopping $NAME" + start-stop-daemon --stop --quiet \ + --pidfile "$PIDFILE" + eend $? } -- cgit v1.2.3