Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ target_link_libraries(urm PUBLIC ${SERVER_LIBS})
# Install bin
install(TARGETS urm RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})

# Install service
pkg_check_modules(PC_SYSTEMD QUIET systemd)
if(PC_SYSTEMD_FOUND)
# Install slice file
install(FILES ${CMAKE_SOURCE_DIR}/focused.slice DESTINATION ${CMAKE_INSTALL_LIBDIR}/systemd/system/ PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE WORLD_READ WORLD_WRITE)
# Install service
install(FILES ${CMAKE_SOURCE_DIR}/urm.service DESTINATION ${CMAKE_INSTALL_LIBDIR}/systemd/system/)
endif()
9 changes: 9 additions & 0 deletions focused.slice
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Unit]
Description=Custom Cgroup for URM

[Slice]
CPUQuota=100%
MemoryMax=500M
CPUWeight=100 # max weight for CPU
IOWeight=100 # max weight for IO
TasksMax=100 # maximum number of concurrent tasks (processes + threads) allowed in that cgroup
2 changes: 2 additions & 0 deletions urm.service
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Description=URM Service
Restart=on-failure
ExecStart=/usr/bin/urm
TimeoutStopSec=2
Slice=focused.slice
Delegate=yes

[Install]
WantedBy=multi-user.target
Loading