meson: added support OpenRC init system

Main repo: https://github.com/OpenRC/openrc
More info about OpenRC: https://en.wikipedia.org/wiki/OpenRC
This commit is contained in:
Herman Semenoff 2026-02-03 20:45:10 +03:00
parent 4f5796a37d
commit 03037a47b6
No known key found for this signature in database
GPG key ID: 1D2DC7BDC7225EF7
5 changed files with 76 additions and 0 deletions

View file

@ -84,6 +84,21 @@ if use_systemd
endif
endif
if use_openrc
configure_file(
input: 'openrc/dbus.init.in',
output: 'dbus',
configuration: data_config,
install_dir: openrc_init_dir,
)
configure_file(
input: 'openrc/dbus.conf.in',
output: 'dbus.conf',
configuration: data_config,
install_dir: openrc_conf_dir,
)
endif
subdir('legacy-config')

21
bus/openrc/dbus.conf.in Normal file
View file

@ -0,0 +1,21 @@
# This file is part of the D-Bus library.
#
# The D-Bus library is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# The D-Bus library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with the D-Bus library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# Start the D-Bus daemon
DBUS_DAEMON_ENABLE="yes"
# Arguments to pass to the D-Bus daemon
DBUS_DAEMON_ARGS="--system"

26
bus/openrc/dbus.init.in Normal file
View file

@ -0,0 +1,26 @@
#!/sbin/openrc-run
description="D-Bus System Message Bus"
depend() {
need localmount
after bootmisc
}
start() {
ebegin "Starting D-Bus System Message Bus"
start-stop-daemon --start --quiet --pidfile /run/dbus/pid --exec @EXPANDED_BINDIR@/dbus-daemon -- --system
eend $?
}
stop() {
ebegin "Stopping D-Bus System Message Bus"
start-stop-daemon --stop --quiet --pidfile /run/dbus/pid
eend $?
}
reload() {
ebegin "Reloading D-Bus System Message Bus"
@EXPANDED_BINDIR@/dbus-send --print-reply --system --type=method_call --dest=org.freedesktop.DBus / org.freedesktop.DBus.ReloadConfig
eend $?
}

View file

@ -554,6 +554,12 @@ else
endif
data_config.set('SYSTEMCTL', systemctl)
use_openrc = get_option('openrc').enabled()
if use_openrc
openrc_init_dir = get_option('sysconfdir') / 'init.d'
openrc_conf_dir = get_option('sysconfdir') / 'conf.d'
endif
elogind_opt = get_option('elogind')
if use_systemd
if elogind_opt.enabled()
@ -1432,6 +1438,7 @@ summary_dict += {
'Building inotify support': use_inotify,
'Building kqueue support': use_kqueue,
'Building systemd support': use_systemd,
'Building OpenRC support': use_openrc,
'Building elogind support': use_elogind,
'Traditional activation': use_traditional_activation,
'Building X11 code': config.get('DBUS_BUILD_X11'),

View file

@ -251,6 +251,13 @@ option(
description: 'Systemd at_console support'
)
option(
'openrc',
type: 'feature',
value: 'auto',
description: 'OpenRC init script support'
)
option(
'test_socket_dir',
type: 'string',