Commit 2779b814 authored by Jakub Jirutka's avatar Jakub Jirutka 🇺🇦
Browse files

main/dbus: fix and improve init script

- Do not force supervise-daemon! See e.g.
  49943448 for explanation.
- Set safer permissions on /run/dbus.
parent e42f0cd4
......@@ -27,6 +27,7 @@ source="https://dbus.freedesktop.org/releases/dbus/dbus-$pkgver.tar.gz
0001-_dbus_generate_random_bytes-use-getrandom-2.patch
avoid-opendir-between-fork-exec.patch
$pkgname.initd
$pkgname.confd
"
options="!check" # introduces circular dependency with xorg-server (xvfb-run -> xvfb)
......@@ -73,6 +74,7 @@ package() {
rm -rf "$pkgdir"/usr/lib/systemd
install -Dm755 "$srcdir"/dbus.initd "$pkgdir"/etc/init.d/dbus
install -Dm644 "$srcdir"/dbus.confd "$pkgdir"/etc/conf.d/dbus
}
libs() {
......@@ -93,5 +95,6 @@ sha512sums="
0964683bc6859374cc94e42e1ec0cdb542cca67971c205fcba4352500b6c0891665b0718e7d85eb060c81cb82e3346c313892bc02384da300ddd306c7eef0056 dbus-1.12.20.tar.gz
3db35499361e84d8e2469b88b033f49813b179188ac25f1841a989988c352af398a56dfd94383813626c6dfd032194f7a9fcdba001ccc3e005e7cd22dae7a7ed 0001-_dbus_generate_random_bytes-use-getrandom-2.patch
cdd01f51882be4f388515441237aa6318888db6e88a4d980bafbf9b790945e4d959c6633d6d002274c0a617ac919f9355ba628c9b502b355f73fed602f997791 avoid-opendir-between-fork-exec.patch
b457f8a2d2c7f9cd3cd32c6dd23cdf5598a6db2ec6e007471383159a775d29950016699037948c07011d7b7d49723026c1c05f627536bc88947c39e4529e8c4e dbus.initd
7c1940cdc549baad4fa21bb18cca2c85a2fd155fe68ea9e726b8a5572d088a8dda132ae9f5b574c578af7b72f88b9d96b7ed554bf6564c8fccf53fb3ce45e5f7 dbus.initd
3f063efa672a900ed04bc7224ba31b3ced91bb98ae096a3ce12552a0b6e2c38ddb445edb4876518f9be4140a5d901dc62080e95aab4346d89dbf329ebec33cb3 dbus.confd
"
# Configuration for /etc/init.d/dbus
# Additional arguments to pass to dbus-daemon.
#command_args=
# Uncomment to use process supervisor.
#supervisor=supervise-daemon
#!/sbin/openrc-run
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later
supervisor=supervise-daemon
name="System Message Bus"
description="D-Bus System Message Bus"
command="/usr/bin/dbus-daemon"
command_args="--system"
command_args_foreground="--nofork"
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() {
/usr/bin/dbus-uuidgen --ensure=/etc/machine-id
checkpath -d -m750 -o root:messagebus /run/dbus || return 1
  • @jirutka this change is breaking some DEs (e.g. Phosh):

    (phoc:3061): phoc-wlroots-CRITICAL **: 21:06:25.913: [backend/session/logind.c:805] Failed to open D-Bus connection: Permission denied

    Is your intention with this change that the user needs to be in the messagebus group now?

  • reverting this change (where mode is then 0755 on that dir) "fixes" this issue, but I'd like to understand what your intentions are here and/or if you have any suggestions on how to resolve this situation, since reverting is probably not desired.

Please register or sign in to reply
# We need to test if /var/run/dbus exists, since script will fail if it does not
[ -e /run/dbus ] || mkdir /run/dbus
/usr/bin/dbus-uuidgen --ensure=/etc/machine-id
}
stop_post() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment