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@12 | 1 | #!@l_prefix@/bin/openpkg rc |
michael@12 | 2 | ## |
michael@12 | 3 | ## rc.dbus -- Run-Commands |
michael@12 | 4 | ## |
michael@12 | 5 | |
michael@12 | 6 | %config |
michael@12 | 7 | dbus_enable="$openpkg_rc_def" |
michael@12 | 8 | dbus_flags="--system --fork" |
michael@12 | 9 | |
michael@12 | 10 | %common |
michael@12 | 11 | dbus_pidfile="@l_prefix@/var/dbus/run/dbus.pid" |
michael@12 | 12 | dbus_cfgfile="@l_prefix@/etc/dbus/system.conf" |
michael@12 | 13 | dbus_signal () { |
michael@12 | 14 | [ -f $dbus_pidfile ] && kill -$1 `cat $dbus_pidfile` |
michael@12 | 15 | } |
michael@12 | 16 | |
michael@12 | 17 | %status -u @l_susr@ -o |
michael@12 | 18 | dbus_usable="unknown" |
michael@12 | 19 | dbus_active="no" |
michael@12 | 20 | rcService dbus enable yes && \ |
michael@12 | 21 | dbus_signal 0 && dbus_active="yes" |
michael@12 | 22 | echo "dbus_enable=\"$dbus_enable\"" |
michael@12 | 23 | echo "dbus_usable=\"$dbus_usable\"" |
michael@12 | 24 | echo "dbus_active=\"$dbus_active\"" |
michael@12 | 25 | |
michael@12 | 26 | %start -u @l_susr@ |
michael@12 | 27 | rcService dbus enable yes || exit 0 |
michael@12 | 28 | rcService dbus active yes && exit 0 |
michael@12 | 29 | @l_prefix@/lib/dbus/bin/dbus-daemon $dbus_flags >/dev/null 2>&1 |
michael@12 | 30 | |
michael@12 | 31 | %stop -u @l_susr@ |
michael@12 | 32 | rcService dbus enable yes || exit 0 |
michael@12 | 33 | rcService dbus active no && exit 0 |
michael@12 | 34 | dbus_signal TERM |
michael@12 | 35 | sleep 2 |
michael@12 | 36 | rm -f $dbus_pidfile 2>/dev/null || true |
michael@12 | 37 | |
michael@12 | 38 | %restart -u @l_susr@ |
michael@12 | 39 | rcService dbus enable yes || exit 0 |
michael@12 | 40 | rcService dbus active no && exit 0 |
michael@12 | 41 | rc dbus stop start |
michael@12 | 42 |