Skip to content

Commit

Permalink
Add RS_SETID option
Browse files Browse the repository at this point in the history
  • Loading branch information
matanui159 committed Dec 22, 2020
1 parent 61b5929 commit 84761c0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
22 changes: 15 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,23 @@ add_custom_target(clang-format
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
)

# Installation
set(service replay-sorcery.service)
set(RS_SYSTEMD_DIR /usr/lib/systemd/user CACHE STRING "Where to install the systemd service")
configure_file(sys/${service}.in ${service})
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${service}" DESTINATION "${RS_SYSTEMD_DIR}")
install(TARGETS ${binary} DESTINATION bin PERMISSIONS
# Install binary
option(RS_SETID "Enable the SETUID and SETGID permissions" ON)
set(permissions
OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
SETUID SETGID
)
if (RS_SETID)
set(permissions ${permissions} SETUID SETGID)
endif()
install(TARGETS ${binary} DESTINATION bin PERMISSIONS ${permissions})

# Install config
install(FILES sys/replay-sorcery.conf DESTINATION etc)

# Install service
set(RS_SYSTEMD_DIR /usr/lib/systemd/user CACHE STRING "Where to install the systemd service")
set(service replay-sorcery.service)
configure_file(sys/${service}.in ${service})
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${service}" DESTINATION "${RS_SYSTEMD_DIR}")
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ You can also use systemd to look at the output:
$ journalctl --user -fu replay-sorcery
```

The service runs as root using `SETUID` and `SETGID` permissions since this is needed if you enable hardware acceleration. If this causes issues, you can disable it with `-DRS_SETID=OFF` in CMake:
```
$ cmake -B bin -DRS_SETID=OFF
```

## Configuration
The config file location and options has completely changed since version 0.3.x

Expand Down

0 comments on commit 84761c0

Please sign in to comment.