diff options
author | Robert Adam <dev@robert-adam.de> | 2022-09-07 20:59:55 +0300 |
---|---|---|
committer | Robert Adam <dev@robert-adam.de> | 2022-09-10 18:28:34 +0300 |
commit | ef3ee9546a3199978b882f87d646ee46e7e64b37 (patch) | |
tree | 4e9930476fa857296240343ff45e64ad3eae81a5 | |
parent | 671524715c3442e93c80ac59a00880c6938715b2 (diff) |
MAINT: Add systemd-sysusers config file
-rw-r--r-- | auxiliary_files/CMakeLists.txt | 14 | ||||
-rw-r--r-- | auxiliary_files/config_files/mumble-server.sysusers | 5 |
2 files changed, 19 insertions, 0 deletions
diff --git a/auxiliary_files/CMakeLists.txt b/auxiliary_files/CMakeLists.txt index 2059b09ae..14f6e70a7 100644 --- a/auxiliary_files/CMakeLists.txt +++ b/auxiliary_files/CMakeLists.txt @@ -4,6 +4,7 @@ # Mumble source tree or at <https://www.mumble.info/LICENSE>. include(delayed_configure_files) +include(pkg-utils) if(NOT BUILD_RELEASE_DATE) # If BUILD_RELEASE_DATE has not been set, default to time of build @@ -43,6 +44,17 @@ if(server) file(COPY "config_files/mumble-server.conf" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) if(UNIX AND NOT APPLE) + get_pkgconf_variable( + OUTPUT_VARIABLE SYSUSERS_DIR + MODULE systemd + VARIABLE_NAME sysusersdir + QUIET + ) + if(NOT SYSUSERS_DIR) + # Fallback value, in case it could not be fetched via pkg-config + set(SYSUSERS_DIR "${CMAKE_INSTALL_SYSCONFDIR}/sysconfig.d") + endif() + delayed_configure_files( TARGET mumble-server FILES @@ -63,6 +75,8 @@ if(server) install(FILES "man_files/mumble-server-user-wrapper.1" DESTINATION "${MUMBLE_INSTALL_MANDIR}" COMPONENT doc) install(FILES "mumble-server.ini" DESTINATION "${MUMBLE_INSTALL_SYSCONFDIR}" COMPONENT mumble_server) + + install(FILES "config_files/mumble-server.sysusers" DESTINATION "${SYSUSERS_DIR}" COMPONENT mumble_server RENAME "mumble-server.conf") endif() endif() diff --git a/auxiliary_files/config_files/mumble-server.sysusers b/auxiliary_files/config_files/mumble-server.sysusers new file mode 100644 index 000000000..6c4933429 --- /dev/null +++ b/auxiliary_files/config_files/mumble-server.sysusers @@ -0,0 +1,5 @@ +# When this file is processed by systemd-sysusers, it will create the user and group that the Mumble server +# is intended to run under (e.g. when started via systemd) + +# Type # Name # ID # GECOS # Home # Shell +u _mumble-server - "Mumble server user" - - |