1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/joomla/rc.joomla Tue Aug 28 18:29:40 2012 +0200 1.3 @@ -0,0 +1,45 @@ 1.4 +#!@l_prefix@/bin/openpkg rc 1.5 +## 1.6 +## rc.joomla -- Run-Commands 1.7 +## 1.8 + 1.9 +%config 1.10 + joomla_enable="$openpkg_rc_def" 1.11 + 1.12 +%common 1.13 + joomla_cfgfile="@l_prefix@/etc/joomla/joomla-apache.conf" 1.14 + joomla_pidfile="@l_prefix@/var/joomla/run/apache.pid" 1.15 + joomla_signal () { 1.16 + [ -f $joomla_pidfile ] && kill -$1 `cat $joomla_pidfile` 1.17 + } 1.18 + 1.19 +%status -u @l_susr@ -o 1.20 + joomla_usable="no" 1.21 + joomla_active="no" 1.22 + @l_prefix@/sbin/apache -t -f $joomla_cfgfile 2>/dev/null && \ 1.23 + joomla_usable="yes" 1.24 + joomla_signal 0 && \ 1.25 + joomla_active="yes" 1.26 + echo "joomla_enable=\"$joomla_enable\"" 1.27 + echo "joomla_usable=\"$joomla_usable\"" 1.28 + echo "joomla_active=\"$joomla_active\"" 1.29 + 1.30 +%start -u @l_susr@ 1.31 + rcService joomla enable yes || exit 0 1.32 + rcService joomla active yes && exit 0 1.33 + ( export PATH="@l_path@" 1.34 + @l_prefix@/sbin/apache -f $joomla_cfgfile 1.35 + ) || exit $? 1.36 + 1.37 +%stop -u @l_susr@ 1.38 + rcService joomla enable yes || exit 0 1.39 + rcService joomla active no && exit 0 1.40 + joomla_signal TERM 1.41 + sleep 2 1.42 + rm -f $joomla_pidfile >/dev/null 2>&1 || true 1.43 + 1.44 +%restart -u @l_susr@ 1.45 + rcService joomla enable yes || exit 0 1.46 + rcService joomla active no && exit 0 1.47 + rc joomla stop start 1.48 +