aboutsummaryrefslogtreecommitdiffstats
path: root/main/lsyncd
diff options
context:
space:
mode:
authorLeonardo Arena <rnalrd@alpinelinux.org>2014-09-17 13:02:51 +0000
committerLeonardo Arena <rnalrd@alpinelinux.org>2014-09-17 13:03:46 +0000
commit9c138165d75022d1f3fafb35b927e9e394a9c6df (patch)
tree348a82f8acfa695da62aa50e4c286d306a0c59dd /main/lsyncd
parentf46d41633171ddb32976d7f47727c35dbefe34e7 (diff)
downloadaports-9c138165d75022d1f3fafb35b927e9e394a9c6df.tar.bz2
aports-9c138165d75022d1f3fafb35b927e9e394a9c6df.tar.xz
main/lsyncd: rewrite initd to add support for command_args
Diffstat (limited to 'main/lsyncd')
-rw-r--r--main/lsyncd/APKBUILD8
-rw-r--r--main/lsyncd/lsyncd.initd37
2 files changed, 17 insertions, 28 deletions
diff --git a/main/lsyncd/APKBUILD b/main/lsyncd/APKBUILD
index 0f03484db7..f30ba857f0 100644
--- a/main/lsyncd/APKBUILD
+++ b/main/lsyncd/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=lsyncd
pkgver=2.0.7
-pkgrel=1
+pkgrel=2
pkgdesc="Live Syncing (Mirror) Daemon"
url="http://code.google.com/p/lsyncd/"
arch="all"
@@ -56,12 +56,12 @@ package() {
md5sums="4ef8787f6e3a402a9a2bcb84c123fb17 lsyncd-2.0.7.tar.gz
a8ad7a0a5faddd8b19f45b1c3086eee3 fix-realpath.patch
a70439e6b21b15cc62ea0fa9f2e95a9b lpostcmd.patch
-b3d38982ef1a6e09a76586418ec6c35d lsyncd.initd"
+e03912ab46fe82de650ef22759740327 lsyncd.initd"
sha256sums="3c76a6e8acfceea742154afd21f74b220277e54b1ffdb71ee1dc2eb104b0bbde lsyncd-2.0.7.tar.gz
f956ed6243675018ac646e0789f4ddf37a60ad7526cdfdf59f633fd86efb9a68 fix-realpath.patch
7aba1c30ac079ea13ddd362021413d8d9ec027f3b38889b236a7c1efbd72c9ce lpostcmd.patch
-2797d06c74154290ec183cbe5ba22dde818c384bee1434c6d95923626890cfe0 lsyncd.initd"
+97eda5182b28cfb501466a54b36779c113783fa19f5d3ae4d81899e0c29ed35f lsyncd.initd"
sha512sums="4ba99853b7962f40bd6a7cd2b51eebf33b37a9536511d39f5650da04465c67080cc89568537981165c357c76841221c1fcc83b42ee0d8ab4713619f8c008af40 lsyncd-2.0.7.tar.gz
b3cedf4c0a456a7eb1b43c63faf40c7a77d1d6435d8980c15a30139a999d8e2f471f2f2758542408574f99079eb1ea5fa087cfa19e3e38a21bb6f06d69815a06 fix-realpath.patch
c606e915de80b52786ac3368b837632db9fce3297bb7f7abfc2fe6b2b259730e54194c08509d1d00d9851247038ef492591bc7cc75e98c4466518b84fc961ee3 lpostcmd.patch
-db9b65817b25e9853e5e6fab479eb54e19bcbd37cb8682cbe5549b539866a85db94969deed0b311f92af81f91af31efc638acd5bec05e7722f74b2fc314d7922 lsyncd.initd"
+94af861eb434a2ba51befc5a39d8f15d3370ab15bb27534db29e8f74594164503ef1ec83571d4308e7a0017c30338fd652a6bab830d5bbe59bf625bd91dc8142 lsyncd.initd"
diff --git a/main/lsyncd/lsyncd.initd b/main/lsyncd/lsyncd.initd
index 5578b1a2af..6299c36978 100644
--- a/main/lsyncd/lsyncd.initd
+++ b/main/lsyncd/lsyncd.initd
@@ -1,32 +1,21 @@
#!/sbin/runscript
-NAME=lsyncd
-DAEMON=/usr/bin/$NAME
-PIDFILE=/var/run/$NAME.pid
-USER=root
-GROUP=root
-CONF=/etc/lsyncd/lsyncd.lua
+command=/usr/bin/lsyncd
+pidfile=/var/run/lsyncd/${SVCNAME}.pid
+conf=/etc/lsyncd/${SVCNAME}.lua
+
+: ${exec_user:=root}
+: ${exec_group:=root}
+
+start_stop_daemon_args="--user $exec_user --group $exec_group --chdir /etc/lsyncd"
depend() {
need net
+ after firewall
}
-start() {
- 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 \
- --pidfile "$PIDFILE"
- eend $?
+start_pre() {
+ command_args="$conf -pidfile $pidfile $command_args"
+ checkpath --directory ${pidfile%/*} --owner ${exec_user}:${exec_group}
+ command_args="$conf -pidfile $pidfile $command_args"
}