From 61dc84a732fb835a61ae14119cb50b12be2cf448 Mon Sep 17 00:00:00 2001 From: Francesco Colista Date: Fri, 1 Mar 2013 09:22:45 +0000 Subject: testing/atheme-iris: modified initd, fixed /var/run path --- testing/atheme-iris/APKBUILD | 16 ++++++------ testing/atheme-iris/atheme-iris.confd | 4 +-- testing/atheme-iris/atheme-iris.initd | 47 ++++++++++++++++------------------- 3 files changed, 30 insertions(+), 37 deletions(-) diff --git a/testing/atheme-iris/APKBUILD b/testing/atheme-iris/APKBUILD index 4b05418dc..b4a834680 100644 --- a/testing/atheme-iris/APKBUILD +++ b/testing/atheme-iris/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Francesco Colista pkgname=atheme-iris pkgver=0_git20130227 -pkgrel=0 +pkgrel=1 pkgdesc="AJAX IRC client. It is a drop-in replacement for qwebirc." url="http://www.atheme.net/iris.html" arch="noarch" @@ -33,23 +33,21 @@ package() { mkdir -p $pkgdir/var/log/$pkgname mkdir -p $pkgdir/etc/conf.d mkdir -p $pkgdir/etc/init.d - mkdir -p $pkgdir/var/run/$pkgname cp "$srcdir"/$pkgname.confd $pkgdir/etc/conf.d/$pkgname cp "$srcdir"/$pkgname.initd $pkgdir/etc/init.d/$pkgname cp -r * $pkgdir/var/lib/$pkgname cp iris.conf.example $pkgdir/etc/$pkgname/iris.conf ln -s /etc/$pkgname/iris.conf $pkgdir/var/lib/$pkgname/iris.conf chown iris:iris $pkgdir/var/log/$pkgname - chown iris:iris $pkgdir/var/run/$pkgname chown -R iris:iris $pkgdir/var/lib/$pkgname } md5sums="b1673663f8891a69a0c746cd3fb0098e atheme-iris-0_git20130227.tar.gz -2e28fb06e4d237ae10f633185ddaf1dc atheme-iris.initd -cb92c7f09b3f8ed203aef46f1ef25a29 atheme-iris.confd" +5b2081f374dcfa4e84f0c6c0474bad45 atheme-iris.initd +be1172c2b2aa03df0af399845138c5f3 atheme-iris.confd" sha256sums="e6a61f2a50e22dfea06d4e1aef321dd2e1e320f59feb59f2c69e3a45435723e6 atheme-iris-0_git20130227.tar.gz -3f5f889df409dead4f50d5a671813d104660e61ebe840f9e00dbc8b990011408 atheme-iris.initd -708edb2a717e016882d3583b951b63a97fbc48ee769437db74b155a357ad34d7 atheme-iris.confd" +9c62c3a6750743e483dc6a62f1767a08f2d9fd48bdf203fa6ee80b1aeedf1b1a atheme-iris.initd +92bc64f0629ddc77315c35b4798952c835333d956f47101150592f96fdb8c18d atheme-iris.confd" sha512sums="6c1cc6a4faf4fae71fe1b9ac5c53cf099e842114548ba8b746d7facd31d3b9bfec0f212a9a41a1046be77857d04fc0bcdc110c115cbaa876917f861130d58b36 atheme-iris-0_git20130227.tar.gz -af08503060dfe5d66c62dc47515321140cc3920fa082e83102f40ad511977bf1dd683a79922ddb507bbca5a6dba987a5481a7e62ea02e7a94e900bb2c83f9aee atheme-iris.initd -5bd29bc0d46387d15e9f2bcdc5ac66ec6f8e1e1d821a36a5440253ad362df46728278410d1b0f172540713d63be58a92b487d226f91353cb1997e93bfb6d2d9a atheme-iris.confd" +2139610a9926fca15ecc04c9bf4354f6d950408fa7b3fc0b42ce1e707bb6eed1fb55c2c5c2b41a7c0fd35f91b5dbfedd47ff324c0eca84f8f240eb4474a7100b atheme-iris.initd +b9de65dde9f4e995ad382f3975fb4009c4a9b134466ffd5ca3d5dfab9b1b27bfa414e90679e59decad486e325f3b4328eabe6c8eae465c0c707a659499a2bbaf atheme-iris.confd" diff --git a/testing/atheme-iris/atheme-iris.confd b/testing/atheme-iris/atheme-iris.confd index 69a548e15..721fc1213 100644 --- a/testing/atheme-iris/atheme-iris.confd +++ b/testing/atheme-iris/atheme-iris.confd @@ -1,6 +1,4 @@ -SVCHOME="/var/lib/atheme-iris" -SVCPID="/var/run/atheme-iris/atheme-iris.pid" LOGFILE="/var/log/atheme-iris/atheme-iris.log" PORT="9090" IP="0.0.0.0" -ARGS="-p ${PORT} -i ${IP} -l ${LOGFILE} -P ${SVCPID}" +ARGS="-p ${PORT} -i ${IP} -l ${LOGFILE}" diff --git a/testing/atheme-iris/atheme-iris.initd b/testing/atheme-iris/atheme-iris.initd index e0b371c79..4ac170846 100755 --- a/testing/atheme-iris/atheme-iris.initd +++ b/testing/atheme-iris/atheme-iris.initd @@ -2,41 +2,38 @@ # Copyright 2013 Alpine Linux # Distributed under the terms of the GNU General Public License v2 -extra_stopped_commands="setup" +extra_stopped_commands="compile" + +: ${SVCHOME:=/var/lib/$SVCNAME} +: ${pidfile:=/var/run/${SVCNAME%%.*}/${SVCNAME#*.}.pid} depend() { use net need localmount } - -setup() { - ebegin "Setting up ${SVCNAME}" - cd /var/lib/atheme-iris - python ./clean.py - python ./compile.py - echo "atheme-iris has been compiled succesfully." - echo "Now you can start the daemon with /etc/init.d/atheme-iris start" +compile() { + ebegin "Compiling configuration for ${SVCNAME}" + cd ${SVCHOME} + ./clean.py + ./compile.py eend $? } start() { + compile || return 1 + checkpath --directory --owner iris ${pidfile%/*} ebegin "Starting ${SVCNAME}" - if [ -f /var/lib/atheme-iris/.compiled ]; then - cd ${SVCHOME} - nohup python ./run.py ${ARGS} &>/dev/null & - else - eerror "You must first run /etc/init.d/atheme-iris setup" - fi - setup() - eend $? -} + start-stop-daemon --exec ${SVCHOME}/run.py \ + --pidfile $pidfile \ + --chdir $SVCHOME \ + --user iris:iris \ + --background \ + --stdout /dev/null \ + --stderr /dev/null \ + --wait 500 \ + -- \ + -P $pidfile \ + $ARGS -stop() { - ebegin "Stopping ${SVCNAME}" - if [ -f /var/run/atheme-iris/atheme-iris.pid ]; then - kill $(cat /var/run/atheme-iris/atheme-iris.pid) - else - eerror "atheme-iris is not running." - fi eend $? } -- cgit v1.2.3