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.
1 #!@l_prefix@/bin/openpkg rc
2 ##
3 ## rc.joomla -- Run-Commands
4 ##
6 %config
7 joomla_enable="$openpkg_rc_def"
9 %common
10 joomla_cfgfile="@l_prefix@/etc/joomla/joomla-apache.conf"
11 joomla_pidfile="@l_prefix@/var/joomla/run/apache.pid"
12 joomla_signal () {
13 [ -f $joomla_pidfile ] && kill -$1 `cat $joomla_pidfile`
14 }
16 %status -u @l_susr@ -o
17 joomla_usable="no"
18 joomla_active="no"
19 @l_prefix@/sbin/apache -t -f $joomla_cfgfile 2>/dev/null && \
20 joomla_usable="yes"
21 joomla_signal 0 && \
22 joomla_active="yes"
23 echo "joomla_enable=\"$joomla_enable\""
24 echo "joomla_usable=\"$joomla_usable\""
25 echo "joomla_active=\"$joomla_active\""
27 %start -u @l_susr@
28 rcService joomla enable yes || exit 0
29 rcService joomla active yes && exit 0
30 ( export PATH="@l_path@"
31 @l_prefix@/sbin/apache -f $joomla_cfgfile
32 ) || exit $?
34 %stop -u @l_susr@
35 rcService joomla enable yes || exit 0
36 rcService joomla active no && exit 0
37 joomla_signal TERM
38 sleep 2
39 rm -f $joomla_pidfile >/dev/null 2>&1 || true
41 %restart -u @l_susr@
42 rcService joomla enable yes || exit 0
43 rcService joomla active no && exit 0
44 rc joomla stop start