dbus.initd-r1 852 B

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