dbus/rc.dbus

Fri, 07 Sep 2012 19:08:07 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 07 Sep 2012 19:08:07 +0200
changeset 667
9dacbd1d1aa2
permissions
-rw-r--r--

Correct build configuration in Solaris subdir, correct english grammar,
remove irrelevant strip notice, introduce custom CFLAG logic, facilitate
use of Solaris Studio compiler with needed build configuration
adjustments, conditionally build 64 bit position independent code,
and accommodate tun(7) in newer Solaris releases by renaming driver
and module from conflicting 'tun' to 'vtun'. These changes include
some nonstandard 'I give up' logic causing out of tree builds by
manipulating the PATH, for example.

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

mercurial