Wed, 08 Feb 2012 20:07:00 +0200
Update version, adapt patch, correct PID writing, correct build on newer
FreeBSD releases, and most importantly introduce new patch to try to
avoid segfault caused by multiple network interfaces with the same (or
no) address. This is common when configuring bridges and tunnels.
michael@535 | 1 | #!@l_prefix@/bin/openpkg rc |
michael@535 | 2 | ## |
michael@535 | 3 | ## rc.joomla -- Run-Commands |
michael@535 | 4 | ## |
michael@535 | 5 | |
michael@535 | 6 | %config |
michael@535 | 7 | joomla_enable="$openpkg_rc_def" |
michael@535 | 8 | |
michael@535 | 9 | %common |
michael@535 | 10 | joomla_cfgfile="@l_prefix@/etc/joomla/joomla-apache.conf" |
michael@535 | 11 | joomla_pidfile="@l_prefix@/var/joomla/run/apache.pid" |
michael@535 | 12 | joomla_signal () { |
michael@535 | 13 | [ -f $joomla_pidfile ] && kill -$1 `cat $joomla_pidfile` |
michael@535 | 14 | } |
michael@535 | 15 | |
michael@535 | 16 | %status -u @l_susr@ -o |
michael@535 | 17 | joomla_usable="no" |
michael@535 | 18 | joomla_active="no" |
michael@535 | 19 | @l_prefix@/sbin/apache -t -f $joomla_cfgfile 2>/dev/null && \ |
michael@535 | 20 | joomla_usable="yes" |
michael@535 | 21 | joomla_signal 0 && \ |
michael@535 | 22 | joomla_active="yes" |
michael@535 | 23 | echo "joomla_enable=\"$joomla_enable\"" |
michael@535 | 24 | echo "joomla_usable=\"$joomla_usable\"" |
michael@535 | 25 | echo "joomla_active=\"$joomla_active\"" |
michael@535 | 26 | |
michael@535 | 27 | %start -u @l_susr@ |
michael@535 | 28 | rcService joomla enable yes || exit 0 |
michael@535 | 29 | rcService joomla active yes && exit 0 |
michael@535 | 30 | ( export PATH="@l_path@" |
michael@535 | 31 | @l_prefix@/sbin/apache -f $joomla_cfgfile |
michael@535 | 32 | ) || exit $? |
michael@535 | 33 | |
michael@535 | 34 | %stop -u @l_susr@ |
michael@535 | 35 | rcService joomla enable yes || exit 0 |
michael@535 | 36 | rcService joomla active no && exit 0 |
michael@535 | 37 | joomla_signal TERM |
michael@535 | 38 | sleep 2 |
michael@535 | 39 | rm -f $joomla_pidfile >/dev/null 2>&1 || true |
michael@535 | 40 | |
michael@535 | 41 | %restart -u @l_susr@ |
michael@535 | 42 | rcService joomla enable yes || exit 0 |
michael@535 | 43 | rcService joomla active no && exit 0 |
michael@535 | 44 | rc joomla stop start |
michael@535 | 45 |