roundcube/rc.roundcube

Thu, 18 Oct 2012 12:53:06 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 18 Oct 2012 12:53:06 +0200
changeset 746
75275e2bcfd7
permissions
-rw-r--r--

Refine specification, using other PHP dependent web packages as reference.

michael@746 1 #!@l_prefix@/bin/openpkg rc
michael@746 2 ##
michael@746 3 ## rc.roundcube -- Run-Commands
michael@746 4 ##
michael@746 5
michael@746 6 %config
michael@746 7 roundcube_enable="$openpkg_rc_def"
michael@746 8 roundcube_log_prolog="true"
michael@746 9 roundcube_log_epilog="true"
michael@746 10 roundcube_log_numfiles="10"
michael@746 11 roundcube_log_minsize="1M"
michael@746 12 roundcube_log_complevel="9"
michael@746 13
michael@746 14 %status -u @l_susr@ -o
michael@746 15 roundcube_usable="no"
michael@746 16 roundcube_active="no"
michael@746 17 @l_prefix@/sbin/apache -t \
michael@746 18 -f @l_prefix@/etc/roundcube/roundcube-apache.conf 2>/dev/null && \
michael@746 19 roundcube_usable="yes"
michael@746 20 [ -f @l_prefix@/var/roundcube/run/apache.pid ] && \
michael@746 21 kill -0 `cat @l_prefix@/var/roundcube/run/apache.pid` && \
michael@746 22 roundcube_active="yes"
michael@746 23 echo "roundcube_enable=\"$roundcube_enable\""
michael@746 24 echo "roundcube_usable=\"$roundcube_usable\""
michael@746 25 echo "roundcube_active=\"$roundcube_active\""
michael@746 26
michael@746 27 %start -u @l_susr@
michael@746 28 rcService roundcube enable yes || exit 0
michael@746 29 rcService roundcube active yes && exit 0
michael@746 30 @l_prefix@/sbin/apache \
michael@746 31 -f @l_prefix@/etc/roundcube/roundcube-apache.conf
michael@746 32
michael@746 33 %stop -u @l_susr@
michael@746 34 rcService roundcube enable yes || exit 0
michael@746 35 rcService roundcube active no && exit 0
michael@746 36 [ -f @l_prefix@/var/roundcube/run/apache.pid ] && \
michael@746 37 kill -TERM `cat @l_prefix@/var/roundcube/run/apache.pid`
michael@746 38 sleep 2
michael@746 39
michael@746 40 %restart -u @l_susr@
michael@746 41 rcService roundcube enable yes || exit 0
michael@746 42 rcService roundcube active no && exit 0
michael@746 43 rc roundcube stop start
michael@746 44
michael@746 45 %daily -u @l_nusr@
michael@746 46 rcService roundcube enable yes || exit 0
michael@746 47 shtool rotate -f \
michael@746 48 -n ${roundcube_log_numfiles} -s ${roundcube_log_minsize} -d \
michael@746 49 -z ${roundcube_log_complevel} -m 644 -o @l_nusr@ -g @l_ngrp@ \
michael@746 50 -P "${roundcube_log_prolog}" \
michael@746 51 -E "${roundcube_log_epilog}" \
michael@746 52 @l_prefix@/share/roundcube/logs/errors
michael@746 53

mercurial