rc.main 653 B

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