aboutsummaryrefslogtreecommitdiffstats
path: root/main/dbus/dbus.initd
blob: c5a518214bf06b8238d3ebaf1a44c25b2d6bb94f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/sbin/openrc-run
name="System Message Bus"
description="D-Bus System Message Bus"

extra_started_commands="reload"

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

depend() {
	need localmount
	after bootmisc
}

start_pre() {
	checkpath -d -m750 -o root:messagebus /run/dbus || return 1

	/usr/bin/dbus-uuidgen --ensure=/etc/machine-id
}

stop_post() {
	[ ! -S /run/dbus/system_bus_socket ] || rm -f /run/dbus/system_bus_socket
}

reload() {
	ebegin "Reloading $name configuration"
	/usr/bin/dbus-send --print-reply --system --type=method_call \
			--dest=org.freedesktop.DBus \
			/ org.freedesktop.DBus.ReloadConfig > /dev/null
	eend $?
}