rc.main 695 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. mkdir -p /var/lib/dbus /var/run/dbus
  15. # Validate or generate unique ID file (/var/lib/dbus/machine-id)
  16. /usr/bin/dbus-uuidgen --ensure
  17. exec /usr/bin/dbus-daemon --nofork --system --nopidfile
  18. }
  19. reset()
  20. {
  21. case $3 in
  22. exit)
  23. echo "*** ${SVNAME}: Exited status $4"
  24. ;;
  25. signal)
  26. echo "*** ${SVNAME}: Killed on signal $5"
  27. ;;
  28. *)
  29. echo "*** ${SVNAME}: Stopped (${3})"
  30. ;;
  31. esac
  32. }
  33. # Branch to target
  34. eval ${TARGET} "$@"