rc.main 716 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #! /bin/sh -
  2. #
  3. # dbus/rc.main
  4. #
  5. # D-Bus daemon.
  6. #
  7. # Redirects the standard error to the standard output
  8. exec 2>&1
  9. TARGET="$1"
  10. SVNAME="${2:-dbus}"
  11. start()
  12. {
  13. echo "*** ${SVNAME}: Starting dbus ..."
  14. if test ! -e /var/run/dbus
  15. then
  16. mkdir -p /var/run/dbus || exit $?
  17. fi
  18. # Validate or generate unique ID file
  19. /usr/bin/dbus-uuidgen --ensure
  20. exec /usr/bin/dbus-daemon --nofork --system --nopidfile
  21. }
  22. reset()
  23. {
  24. case $3 in
  25. exit)
  26. echo "*** ${SVNAME}: Exited status $4"
  27. ;;
  28. signal)
  29. echo "*** ${SVNAME}: Killed on signal $5"
  30. ;;
  31. *)
  32. echo "*** ${SVNAME}: Stopped (${3})"
  33. ;;
  34. esac
  35. }
  36. # Branch to target
  37. eval ${TARGET} "$@"