diff options
author | Tomas Chvatal <scarabeus@gentoo.org> | 2013-03-24 10:22:25 +0000 |
---|---|---|
committer | Tomas Chvatal <scarabeus@gentoo.org> | 2013-03-24 10:22:25 +0000 |
commit | f4432202fdaf1ad58af4a0c2afb69d528bfd7e24 (patch) | |
tree | 84b376028ef1112f824762a0cfbeaa9d4cfc9f5a /www-apps/tt-rss/files | |
parent | Remove support for module-init-tools and Linux 2.4. Only works with kmod and ... (diff) | |
download | gentoo-2-f4432202fdaf1ad58af4a0c2afb69d528bfd7e24.tar.gz gentoo-2-f4432202fdaf1ad58af4a0c2afb69d528bfd7e24.tar.bz2 gentoo-2-f4432202fdaf1ad58af4a0c2afb69d528bfd7e24.zip |
Version bump to latest. Add required use to at-least-one db as otherwise the app does not work. Cleanup the initscript/config so it copes with my nginx instance nicely (checkconfig and obeying user/group settings defined by user).
(Portage version: 2.2.0_alpha169/cvs/Linux x86_64, signed Manifest commit with key 8EEE3BE8)
Diffstat (limited to 'www-apps/tt-rss/files')
-rw-r--r-- | www-apps/tt-rss/files/ttrssd.confd-r1 | 15 | ||||
-rw-r--r-- | www-apps/tt-rss/files/ttrssd.initd-r1 | 73 |
2 files changed, 88 insertions, 0 deletions
diff --git a/www-apps/tt-rss/files/ttrssd.confd-r1 b/www-apps/tt-rss/files/ttrssd.confd-r1 new file mode 100644 index 000000000000..68a5603ba130 --- /dev/null +++ b/www-apps/tt-rss/files/ttrssd.confd-r1 @@ -0,0 +1,15 @@ +# Copyright 1999-2013 Gentoo Foundation +# # Distributed under the terms of the GNU General Public License v2 +# # $Header: /var/cvsroot/gentoo-x86/www-apps/tt-rss/files/ttrssd.confd-r1,v 1.1 2013/03/24 10:22:25 scarabeus Exp $ + +# Path to TT-RSS instances which should have running update daemon. +# EXAMPLE: INSTANCE_DIRS="/some/webhost/htdocs/tt-rss /some/otherwebhost/htdocs/newsreader" +INSTANCE_DIRS="" + +# Path to log file. Remember to alter logrotate file if you change it here. +LOGFILE="/var/log/ttrssd.log" + +# User and group which run the update daemon. +# NOTE: you should really avoid running it as root. +TTRSSD_USER="ttrssd" +TTRSSD_GROUP="ttrssd" diff --git a/www-apps/tt-rss/files/ttrssd.initd-r1 b/www-apps/tt-rss/files/ttrssd.initd-r1 new file mode 100644 index 000000000000..4038362165ed --- /dev/null +++ b/www-apps/tt-rss/files/ttrssd.initd-r1 @@ -0,0 +1,73 @@ +#!/sbin/runscript +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/www-apps/tt-rss/files/ttrssd.initd-r1,v 1.1 2013/03/24 10:22:25 scarabeus Exp $ + +depend() { + need logger net + after postgres mysql +} + +LOGFILE=${LOGFILE:-"/var/log/ttrssd.log"} +TTRSSD_USER=${TTRSSD_USER:-"ttrssd"} +TTRSSD_GROUP=${TTRSSD_GROUP:-"ttrssd"} +INSTANCE_FOLDERS="cache cache/htmlpurifier cache/magpie cache/simplepie cache/images cache/export lock feed-icons" + +checkconfig() { + local instance dir + + # check instances + if [ -z "${INSTANCE_DIRS}" ]; then + eerror "There is no defined instance directory in /etc/conf.d/ttrssd" + return 1 + fi + + # verify log file accessibility + if [ ! -e "${LOGFILE}" ]; then + touch "${LOGFILE}" || return 1 + fi + chown "${TTRSSD_USER}":"${TTRSSD_GROUP}" "${LOGFILE}" || return 1 + + # check instances for errors + for instance in ${INSTANCE_DIRS}; do + if [ ! -f "${instance}/update_daemon2.php" ]; then + eerror "\"${instance}\" does not contain update_daemon2.php script." + eerror "Please check your installation or the INSTANCE_DIRS variable." + return 1 + fi + + # FIXME: This should be done by webapp-config during install + for dir in ${INSTANCE_FOLDERS}; do + if [ -d "${instance}/${dir}" ]; then + chgrp -R "${TTRSSD_GROUP}" "${instance}/${dir}" || return 1 + chmod -R g+w "${instance}/${dir}" || return 1 + fi + done + done +} + +start () { + local instance + + checkconfig || return 1 + + for instance in ${INSTANCE_DIRS}; do + ebegin "Starting TT-RSS update daemon in \"${instance}\"" + start-stop-daemon --start --user "${TTRSSD_USER}":"${TTRSSD_GROUP}" --background \ + --stdout "${LOGFILE}" --stderr "${LOGFILE}" \ + --exec /usr/bin/php -- -f "${instance}/update_daemon2.php" + eend $? + done +} + +stop() { + local instance + + for instance in ${INSTANCE_DIRS}; do + ebegin "Stopping TT-RSS update daemon in \"${instance}\"" + start-stop-daemon --stop \ + --exec /usr/bin/php -- -f "${instance}/update_daemon2.php" + eend $? + rm -f ${instance}/lock/*.lock + done +} |