dbus.initd 759 Bytes
Newer Older
1
#!/sbin/openrc-run
2
3
name="System Message Bus"
description="D-Bus System Message Bus"
Natanael Copa's avatar
Natanael Copa committed
4

5
extra_started_commands="reload"
6

7
8
9
10
11
command="/usr/bin/dbus-daemon"
command_args="--system --nofork --nopidfile --syslog-only ${command_args:-}"
command_background="yes"
pidfile="/run/$RC_SVCNAME.pid"

Natanael Copa's avatar
Natanael Copa committed
12
13
14
15
16
depend() {
	need localmount
	after bootmisc
}

17
start_pre() {
18
	checkpath -d -m750 -o root:messagebus /run/dbus || return 1
Natanael Copa's avatar
Natanael Copa committed
19

20
	/usr/bin/dbus-uuidgen --ensure=/etc/machine-id
Natanael Copa's avatar
Natanael Copa committed
21
22
}

23
stop_post() {
24
	[ ! -S /run/dbus/system_bus_socket ] || rm -f /run/dbus/system_bus_socket
Natanael Copa's avatar
Natanael Copa committed
25
26
27
}

reload() {
28
	ebegin "Reloading $name configuration"
Natanael Copa's avatar
Natanael Copa committed
29
30
31
	/usr/bin/dbus-send --print-reply --system --type=method_call \
			--dest=org.freedesktop.DBus \
			/ org.freedesktop.DBus.ReloadConfig > /dev/null
32
	eend $?
Natanael Copa's avatar
Natanael Copa committed
33
}