dbus.initd 923 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/usr/bin/openrc-run
  2. # Copyright 1999-2019 Gentoo Authors
  3. # Distributed under the terms of the GNU General Public License, v2 or later
  4. supervisor=supervise-daemon
  5. description="An IPC message bus daemon"
  6. command="/usr/bin/dbus-daemon"
  7. command_args="--system"
  8. command_args_foreground="--nofork --nopidfile"
  9. extra_started_commands="reload"
  10. dbus_socket="/run/dbus/system_bus_socket"
  11. depend() {
  12. need localmount
  13. after bootmisc
  14. }
  15. start_pre() {
  16. /usr/bin/dbus-uuidgen --ensure=/etc/machine-id
  17. # We need to test if /run/dbus exists, since script will fail if it does not
  18. checkpath -q -d "/run/dbus"
  19. }
  20. stop_post() {
  21. [ ! -S "${dbus_socket}" ] || rm -f "${dbus_socket}"
  22. }
  23. reload() {
  24. ebegin "Reloading D-BUS messagebus config"
  25. dbus-send --print-reply --system --type=method_call \
  26. --dest=org.freedesktop.DBus \
  27. / org.freedesktop.DBus.ReloadConfig > /dev/null
  28. eend $?
  29. }