Mercurial > vanilla
view network/dbus/dbus @ 861:c1fc4630edd8
emulation/libretro-gambatte: initial import, closes #2145
author | David Demelier <markand@malikania.fr> |
---|---|
date | Sun, 25 Aug 2019 11:25:12 +0200 |
parents | 657ee4987f4d |
children | 3dfef64b81c1 |
line wrap: on
line source
#!/bin/sh # # /etc/rc.d/dbus -- run control script for dbus # # Copyright (c) 2019 David Demelier <markand@malikania.fr> # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # if [ -f /etc/rc.conf ]; then source /etc/rc.conf fi : ${DBUS_CMD:=/bin/dbus-daemon} : ${DBUS_ARGS:=--system} : ${DBUS_PID:=/var/run/dbus.pid} dbus_start() { echo "Starting dbus: $DBUS_CMD $DBUS_ARGS" $DBUS_CMD $DBUS_ARGS } dbus_status() { if [ -s $DBUS_PID ]; then echo "dbus is running with pid: `cat $DBUS_PID`" else echo "dbus is not running" fi } dbus_stop() { if [ -s $DBUS_PID ]; then echo "Stopping dbus." kill -QUIT `cat $DBUS_PID` rm -f $DBUS_PID fi } dbus_restart() { dbus_stop sleep 3 dbus_start } case $1 in start) dbus_start ;; status) dbus_status ;; stop) dbus_stop ;; restart) dbus_restart ;; *) echo "usage: $(basename $0) restart|start|status|stop" ;; esac