michael@535: #!@l_prefix@/bin/openpkg rc michael@535: ## michael@535: ## rc.joomla -- Run-Commands michael@535: ## michael@535: michael@535: %config michael@535: joomla_enable="$openpkg_rc_def" michael@535: michael@535: %common michael@535: joomla_cfgfile="@l_prefix@/etc/joomla/joomla-apache.conf" michael@535: joomla_pidfile="@l_prefix@/var/joomla/run/apache.pid" michael@535: joomla_signal () { michael@535: [ -f $joomla_pidfile ] && kill -$1 `cat $joomla_pidfile` michael@535: } michael@535: michael@535: %status -u @l_susr@ -o michael@535: joomla_usable="no" michael@535: joomla_active="no" michael@535: @l_prefix@/sbin/apache -t -f $joomla_cfgfile 2>/dev/null && \ michael@535: joomla_usable="yes" michael@535: joomla_signal 0 && \ michael@535: joomla_active="yes" michael@535: echo "joomla_enable=\"$joomla_enable\"" michael@535: echo "joomla_usable=\"$joomla_usable\"" michael@535: echo "joomla_active=\"$joomla_active\"" michael@535: michael@535: %start -u @l_susr@ michael@535: rcService joomla enable yes || exit 0 michael@535: rcService joomla active yes && exit 0 michael@535: ( export PATH="@l_path@" michael@535: @l_prefix@/sbin/apache -f $joomla_cfgfile michael@535: ) || exit $? michael@535: michael@535: %stop -u @l_susr@ michael@535: rcService joomla enable yes || exit 0 michael@535: rcService joomla active no && exit 0 michael@535: joomla_signal TERM michael@535: sleep 2 michael@535: rm -f $joomla_pidfile >/dev/null 2>&1 || true michael@535: michael@535: %restart -u @l_susr@ michael@535: rcService joomla enable yes || exit 0 michael@535: rcService joomla active no && exit 0 michael@535: rc joomla stop start michael@535: