From de3cb36ce052a93308b44ea0a2b454f0246f1574 Mon Sep 17 00:00:00 2001 From: Brandon Bagwell Date: Tue, 19 Mar 2024 20:20:04 +0000 Subject: [PATCH] Adds the ability to modify 'rdc' options Modifying the /opt/rocm/etc/rdc file modifies RDC launch options. If the file doesn't exist, the service should still launch (though a new file should likely be included with the next released package of 'rdc'. Change-Id: I1a1891e9c5c3e6048754eb555779a97a170754c0 --- server/CMakeLists.txt | 7 ++++++- server/rdc.service.in | 3 ++- server/rdc_options | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 server/rdc_options diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt index f08b0d912f..ec8aadf458 100755 --- a/server/CMakeLists.txt +++ b/server/CMakeLists.txt @@ -72,8 +72,10 @@ set(SERVER_SRC_LIST message("SERVER_SRC_LIST=${SERVER_SRC_LIST}") set(SERVER_DAEMON_EXE "rdcd") -configure_file("rdc.service.in" "${PROJECT_BINARY_DIR}/rdc.service" @ONLY) set(SERVICE_FILE_NAME "rdc.service") +configure_file("rdc.service.in" "${PROJECT_BINARY_DIR}/${SERVICE_FILE_NAME}" @ONLY) +set(SERVER_CONFIG_FILE "rdc_options") +configure_file("${SERVER_CONFIG_FILE}" "${PROJECT_BINARY_DIR}/${SERVER_CONFIG_FILE}" COPYONLY) link_directories(${SMI_LIB_DIR}) @@ -94,6 +96,9 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SERVER_DAEMON_EXE} install(FILES ${PROJECT_BINARY_DIR}/${SERVICE_FILE_NAME} DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/${RDC} COMPONENT ${SERVER_COMPONENT}) +install(FILES ${PROJECT_BINARY_DIR}/${SERVER_CONFIG_FILE} + DESTINATION ${CMAKE_INSTALL_SYSCONFDIR} + COMPONENT ${SERVER_COMPONENT}) message("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&") message(" Finished Cmake Server ") diff --git a/server/rdc.service.in b/server/rdc.service.in index b63d44b76a..9f6a610b66 100755 --- a/server/rdc.service.in +++ b/server/rdc.service.in @@ -13,6 +13,7 @@ After=network.target #Requires= [Service] +EnvironmentFile=-/@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_SYSCONFDIR@/rdc_options User=rdc Group=rdc @@ -25,7 +26,7 @@ AmbientCapabilities=CAP_DAC_OVERRIDE # ExecStartPre= # update-alternative has been run for rdcd and # soft link will be available in usr/bin -ExecStart=rdcd +ExecStart=rdcd $RDC_OPTS # If we need to start anything after rdcd use this # ExecStartPost= diff --git a/server/rdc_options b/server/rdc_options new file mode 100644 index 0000000000..10ff31fa11 --- /dev/null +++ b/server/rdc_options @@ -0,0 +1,3 @@ +# Append 'rdc' daemon parameters here +RDC_OPTS="" +#RDC_OPTS="-p 50051 -u -d"