23 Commits

Author SHA1 Message Date
Kira Bruneau
5e366bd55d Fix loading shipped config when using a prefix other than /usr
Also remove recommendation to modify `/usr/share/gamemode/gamemode.ini`.
`/usr/share` is intended to contain read-only data files.

See https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s11.html.
2022-02-03 16:02:18 +00:00
Rémi Verschelde
832f9ab7e0 Fix installation of man pages in proper man dirs
See https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s11.html#usrsharemanManualPages
2020-09-14 10:18:53 +01:00
Stephan Lachnit
7a68a178ac simplify libgamemodeauto preloading
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
2020-07-09 08:13:17 +01:00
Stephan Lachnit
3033867fc9 add man page for example game
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
2020-05-27 10:49:36 +01:00
Stephan Lachnit
d27f8caecc improve path names for man pages and metainfo
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
2020-05-26 12:53:21 +01:00
Stephan Lachnit
3d49f87308 configure version in man pages
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
2020-05-26 12:53:21 +01:00
Stephan Lachnit
ce6485ef97 combine no-daemon, elogind and systemd option
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
2020-05-19 16:27:51 +01:00
Stephan Lachnit
1e8312f7e3 Add option to change lib dir in gamemoderun
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
2020-05-13 10:27:15 +01:00
Stephan Lachnit
6453a123ab add metainfo test
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
2020-05-12 19:25:57 +01:00
Stephan Lachnit
c755f7e539 fix wrong prefix variable in data
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
2020-05-12 19:25:57 +01:00
Stephan Lachnit
329f7b4cee give gamemoderun an own man page
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
2020-05-11 09:41:17 +01:00
Stephan Lachnit
e3c24f34f1 provide metainfo
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
2020-05-06 12:34:06 +01:00
Alex Smith
c6d1b45bfb Use the appropriate library path for whether the app is 32- or 64-bit in gamemoderun (#156) 2019-07-13 09:50:25 +01:00
Timo Gurr
85d75c303c Use path_bindir for installing gamemoderun
Honor prefix for installing gamemoderun to properly work in cross
environment so it can be installed in e.g. /usr/x86_64-pc-linux-gnu/bin
instead of /usr/bin like it's already done for gamemoded.
2019-03-29 18:18:23 +01:00
Marc Di Luzio
440400c2d4 Set up some man page generation
Start with the example config file
2019-02-06 16:35:37 +00:00
Marc Di Luzio
74e26d6f63 Add "gamemoderun", a wrapper bash script like "primusrun"
This should remove a point of failure currently where users fail to set LD_PRELOAD correctly, or the path is wrong somehow.

	FWIW: The old method still works, and I've noted that in the README.
2019-02-05 21:16:02 +00:00
Alex Smith
a1e07bcdc7 Merge pull request #62 from gicmo/dbus_activation
data: make service dbus-activatable
2018-07-04 09:40:12 +01:00
Alex Smith
3a3314b43e Move man page to the correct section (8)
Daemons belong in 8, as per issue #61.
2018-07-04 09:29:05 +01:00
Christian Kellner
cd54ad42c3 data: make service dbus-activatable
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).
2018-06-28 19:23:02 +03:00
Marc Di Luzio
81cc0e9aa7 Add a man page
Possibly better to generate this with "ronn" or similar
2018-03-23 16:59:15 +00:00
Ikey Doherty
7f26122c62 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>
2018-03-05 17:32:43 +00:00
Ikey Doherty
68e326de60 Transform into a full D-BUS service with Polkit support
Primarily we convert the service into a thread safe one that isn't reliant
on signaling for control flow, eliminating data race conditions. We also
enable interleaving by separating game mode pivoting from explicit client
registration.

The static pid list is now converted into a dynamic list that is OOM safe
to store all registered clients (with a reasonable upper limit of 256 clients)
to better handle cases where LD_PRELOAD is used for a large process group.
Additionally we begin storing some metadata on the connected clients such
as their executable path, which will enable us to perform some basic
whitelisting in future.

The cpugovctl binary is now moved into the libexecdir as an explicit helper
of the D-BUS service, using the shared library to merge some code back into
the daemon. This saves having to execute a process to query the state of the
governors, as we don't need a privileged client to do this.

In order to sanely set the governors, we require that the binary is running
as euid 0, and execute this using `pkexec`. A PolKit policy definition is
provided which allows active/logged in users to execute this helper through
a path whitelist. As such we can convert the daemon into user-mode only, with
the privileged helper being dispatched exclusively via polkit. This removes
the need for a setuid helper or having a system mode daemon.

Lastly we clean up the codebase a bit to be consistent with modern C code
conventions, using pragmas where available. The library component still uses
the older ifdef approach to support older compilers, but the daemon portion
uses the directive to simplify intent and speed up compilation. Additionally
we move all comments to C style comments for consistency, instead of mixing
in C++ style single line comments, in order to establish a formal coding
style.

The net result is a more robust service which can be D-BUS activated when
clients need it, that can perform scaling automatically without harassing
the user with authentication popups.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2018-03-05 17:32:25 +00:00
Ikey Doherty
1328e07f86 Split meson up to be more modular
This also explicitly constructs reusable library components to make it
easier to extend the project over time. Notably we make less assumptions
about the host system and use pkgconfig where appropriate to give us
system details, such as the systemd system unit directory for packaging.
This can be overriden with the meson option.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2018-03-05 17:32:01 +00:00