mirror of
https://github.com/FeralInteractive/gamemode.git
synced 2025-08-10 23:27:52 +02:00
Allow controlling whether systemd is used or not
Currently this will switch the build system between using a plain D-BUS service file, or a user controllable systemd unit that can be actively stopped/started. In most cases it is more desirable to use the systemd unit approach, as plain D-BUS services cannot be controlled and are more difficult to introspect via the log. For fallback cases we'll have the plain D-BUS unit, and in future we can use this to allow untying from systemd specifics. Signed-off-by: Ikey Doherty <ikey@solus-project.com>
This commit is contained in:

committed by
Marc Di Luzio

parent
e90bd98d64
commit
7f26122c62
10
data/gamemoded.service.in
Normal file
10
data/gamemoded.service.in
Normal file
@@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=gamemoded
|
||||
|
||||
[Service]
|
||||
Type=dbus
|
||||
BusName=com.feralinteractive.GameMode
|
||||
ExecStart=@BINDIR@/gamemoded -l
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
@@ -2,15 +2,25 @@ data_conf = configuration_data()
|
||||
data_conf.set('BINDIR', path_bindir)
|
||||
data_conf.set('LIBEXECDIR', path_libexecdir)
|
||||
|
||||
# Install the D-BUS service file
|
||||
configure_file(
|
||||
input: 'com.feralinteractive.GameMode.service.in',
|
||||
output: 'com.feralinteractive.GameMode.service',
|
||||
configuration: data_conf,
|
||||
install_dir: path_dbus_service_dir,
|
||||
)
|
||||
if with_systemd == true
|
||||
# Install systemd user unit
|
||||
configure_file(
|
||||
input: 'gamemoded.service.in',
|
||||
output: 'gamemoded.service',
|
||||
configuration: data_conf,
|
||||
install_dir: path_systemd_unit_dir,
|
||||
)
|
||||
else
|
||||
# Install the D-BUS service file
|
||||
configure_file(
|
||||
input: 'com.feralinteractive.GameMode.service.in',
|
||||
output: 'com.feralinteractive.GameMode.service',
|
||||
configuration: data_conf,
|
||||
install_dir: path_dbus_service_dir,
|
||||
)
|
||||
endif
|
||||
|
||||
# Install the Polkit action file
|
||||
# Install the Polkit action file in all cases
|
||||
configure_file(
|
||||
input: 'com.feralinteractive.GameMode.policy.in',
|
||||
output: 'com.feralinteractive.GameMode.policy',
|
||||
|
Reference in New Issue
Block a user