diff options
author | Diego Elio Pettenò <flameeyes@gentoo.org> | 2011-11-18 15:22:35 +0000 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@gentoo.org> | 2011-11-18 15:22:35 +0000 |
commit | 51df2da4b7595195e9f57c4290418a16576680d2 (patch) | |
tree | 9a55f520eb99723e9e4fb2798bddad7d4e4b0972 /www-apps/rt/files | |
parent | Stable for HPPA (bug #388475). (diff) | |
download | historical-51df2da4b7595195e9f57c4290418a16576680d2.tar.gz historical-51df2da4b7595195e9f57c4290418a16576680d2.tar.bz2 historical-51df2da4b7595195e9f57c4290418a16576680d2.zip |
Add a new revision with revised (no pun intended) init script, so that it actually seem to work and won't get stuck in an infinite loop if it fails to start.
Package-Manager: portage-2.2.0_alpha75/cvs/Linux x86_64
Diffstat (limited to 'www-apps/rt/files')
-rw-r--r-- | www-apps/rt/files/rt.conf.d.2 | 11 | ||||
-rw-r--r-- | www-apps/rt/files/rt.init.d.2 | 51 |
2 files changed, 62 insertions, 0 deletions
diff --git a/www-apps/rt/files/rt.conf.d.2 b/www-apps/rt/files/rt.conf.d.2 new file mode 100644 index 000000000000..bab6f071d64c --- /dev/null +++ b/www-apps/rt/files/rt.conf.d.2 @@ -0,0 +1,11 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/www-apps/rt/files/rt.conf.d.2,v 1.1 2011/11/18 15:22:35 flameeyes Exp $ + +# Config file for /etc/init.d/rt + +RTUSER=rt +RTGROUP=lighttpd + +# set RTPATH to rt's root +RTPATH=/var/www/localhost/@@PF@@ diff --git a/www-apps/rt/files/rt.init.d.2 b/www-apps/rt/files/rt.init.d.2 new file mode 100644 index 000000000000..a900ddc66de1 --- /dev/null +++ b/www-apps/rt/files/rt.init.d.2 @@ -0,0 +1,51 @@ +#!/sbin/runscript +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/www-apps/rt/files/rt.init.d.2,v 1.1 2011/11/18 15:22:35 flameeyes Exp $ + +depend() { + use mysql postgresql lighttpd +} + +FCGI_SOCKET_PATH=${RTPATH}/var/appSocket +PIDFILE=${RTPATH}/var/pid + +start() { + checkpath -d "${RTPATH}/var" -m 0755 -o "${RTUSER}:${RTGROUP}" + + ebegin "Starting RT" + rm -f ${FCGI_SOCKET_PATH} + start-stop-daemon --start \ + --exec ${RTPATH}/bin/mason_handler.fcgi \ + --pidfile ${PIDFILE} --user "${RTUSER}:${RTGROUP}" \ + --background --make-pidfile --chdir ${RTPATH} \ + --stdout "${RTPATH}/var/service.log" \ + --stderr "${RTPATH}/var/service.log" \ + --env "PATH=$PATH" --env "FCGI_SOCKET_PATH=${FCGI_SOCKET_PATH}" \ + --wait 1500 + + if [ "$?" != "0" ]; then + eerror "${SVCNAME} failed to start. Please see ${RTPATH}/var/service.log for the reason." + eend 1 + return 1 + fi + + # make sure lighttpd can use the socket + for i in {0..10}; do + [ -a ${FCGI_SOCKET_PATH} ] && break + sleep 1 + done + + if [ -a ${FCGI_SOCKET_PATH} ]; then + chmod g+rwx ${FCGI_SOCKET_PATH} + eend 0 + else + eend 1 + fi +} + +stop() { + ebegin "Stopping RT" + start-stop-daemon --stop --pidfile ${PIDFILE} + eend $? +} |