Add a trivial gamemode.conf file, which creates the gamemode group.
v2: git add gamemode.conf (d'oh)
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Before it was installed to /etc, but according the daemon/gamemode-config.c line 381 the shipped config should be in /usr/share/gamemode
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
Add functions to open pidfds, i.e. file descriptors representing
processes, for process ids and vice versa. Both functions work
an array of fds/pids, stop on error and return the number of
successfully handled items.
Switch the dbus implementation for the client from systemd to
libdbus. The main reason is that, in flatpaks systemd is not easily
available. No phenomenological change for users of the library,
hopefully.
This adds 10-gamemode.conf as a limits.d configuration file and with-pam-group meson option to allow renicing as an unpriviledged user being part of the specified group.
Signed-off-by: Térence Clastres <t.clastres@gmail.com>
Signed-off-by: Kai Krakow <kai@kaishome.de>
Always install the dbus service file and specify the systemd
unit file in it. This makes the service dbus-activatable and
thus we don't need to explicitly enable it (also we have one
less daemon running, if it is not needed).
Updating the README.md to bring it ready for wider release:
* Removed some points that were more implementation details
* Added Contributions section
* Simplified the usage section
* Expanded initial explanation
* Fixed steam launch command to allow the overlay to still work
Others:
* Mark as 1.0
* Update the license file for 2018
Checks for a gamemode.ini in /usr/share/gamemode/ (or in the cwd for debugging)
Currently allows for blacklisting and whitelisting clients based on rudimentary needle-haystack executable name checks
See the example/gamemode.ini file for expected syntax
Using the BSD licensed inih library (with additional meson.build file)
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 exposed a bunch of issues that needed dealing with to ensure the
code is clean and sane. Notably the dlopen/dlsym routine has been altered
to closer match the LSI approach of safe symbol binding, by not attempting
to directly cast the result of a dlsym operation. Instead, if we succeed
in getting the dlsym() pointer, we memcpy this to the target and ensure
we have the correct constraints.
Note that in sanitizing the log helpers, I opted to remove the varargs
ability from FATAL_ERRNO given this is used exactly like perror() and
there are no examples currently using varargs with this in the tree.
This allowed me to keep the log helpers as macros and not have to implement
wrapper functions.
Signed-off-by: Ikey Doherty <ikey@solus-project.com>