diff options
| author | lijia <[email protected]> | 2021-07-21 10:37:21 +0800 |
|---|---|---|
| committer | lijia <[email protected]> | 2021-07-21 10:37:21 +0800 |
| commit | 9feef0f69f9784605c88a0b04636747ef37e4218 (patch) | |
| tree | c6e240874a6585767cf44e16ba4ffa005396e151 | |
| parent | cd2dcaf6a65f5f5b38760b31bed53367adf0190c (diff) | |
TSG-7024,v4.2.42
sapp.service默认路径不支持变量, 默认使用CMAKE_INSTALL_PREFIX,
sapp.service改成%config(noreplace)文件, 升级时不覆盖已有文件.
| -rw-r--r-- | CMakeLists.txt | 2 | ||||
| -rw-r--r-- | bin/etc/sapp.toml | 3 | ||||
| -rw-r--r-- | bin/etc/sysconfig/sapp | 2 | ||||
| -rw-r--r-- | bin/etc/sysconfig/sapp.in | 2 | ||||
| -rw-r--r-- | cmake/Package.cmake | 5 | ||||
| -rw-r--r-- | service/CMakeLists.txt | 3 | ||||
| -rw-r--r-- | service/sysconfig/sapp.in | 2 |
7 files changed, 12 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 0feefb6..fc2cc66 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -268,8 +268,6 @@ install(FILES ${PROJECT_SOURCE_DIR}/include/public/stream_inc/sapp_inject.h DEST install(FILES ${PROJECT_SOURCE_DIR}/include/public/stream_inc/stream_bridge.h DESTINATION /opt/MESA/include/MESA/stream_inc COMPONENT HEADER) install(FILES ${CMAKE_BINARY_DIR}/test/libsapp_devel.a DESTINATION . COMPONENT HEADER) - -install(FILES bin/etc/sysconfig/sapp DESTINATION /etc/sysconfig COMPONENT PROFILE) install(FILES ${CMAKE_BINARY_DIR}/service/sapp.service DESTINATION /usr/lib/systemd/system/ COMPONENT PROFILE) include(Package) diff --git a/bin/etc/sapp.toml b/bin/etc/sapp.toml index 3f581a7..e949655 100644 --- a/bin/etc/sapp.toml +++ b/bin/etc/sapp.toml @@ -64,7 +64,8 @@ ### ether[0] is 0x01, dst mac first octet, ether[1] is 0x12, dst mac second octet, ### ether[6] is 0x02, src mac first octet, ether[11] is 0xFF, src mac sixth octet. ### the bit field is from 0 to 7, the 0 is least significant bit, the 7 is most significant bit. - extract_linkdir_from_mac_in_mirror_mode="ether[4]:0" + ##extract_linkdir_from_mac_in_mirror_mode="ether[4]:0" ## for Xj example + extract_linkdir_from_mac_in_mirror_mode="" ### note, depolyment.mode options: [mirror, inline, transparent] [packet_io.depolyment] diff --git a/bin/etc/sysconfig/sapp b/bin/etc/sysconfig/sapp deleted file mode 100644 index dc6253f..0000000 --- a/bin/etc/sysconfig/sapp +++ /dev/null @@ -1,2 +0,0 @@ -SAPP_ROOT=/opt/tsg/sapp -SAPP_LOG_ROOT=/var/log/sapp diff --git a/bin/etc/sysconfig/sapp.in b/bin/etc/sysconfig/sapp.in new file mode 100644 index 0000000..43a56b0 --- /dev/null +++ b/bin/etc/sysconfig/sapp.in @@ -0,0 +1,2 @@ +SAPP_ROOT=${CMAKE_INSTALL_PREFIX} +SAPP_LOG_ROOT=${CMAKE_INSTALL_PREFIX} diff --git a/cmake/Package.cmake b/cmake/Package.cmake index c5cafd3..73eca50 100644 --- a/cmake/Package.cmake +++ b/cmake/Package.cmake @@ -57,7 +57,7 @@ set(CPACK_RPM_PACKAGE_AUTOREQ "no") # setup %config(noreplace) set(CPACK_RPM_EXECUTABLE_USER_FILELIST "%config(noreplace) ${CMAKE_INSTALL_PREFIX}/etc/gdev.conf" - "%config(noreplace) ${CMAKE_INSTALL_PREFIX}/etc/sapp.toml" + "%config(noreplace) ${CMAKE_INSTALL_PREFIX}/etc/sapp.toml" "%config(noreplace) ${CMAKE_INSTALL_PREFIX}/etc/send_raw_pkt.conf" "%config(noreplace) ${CMAKE_INSTALL_PREFIX}/etc/project_list.conf" "%config(noreplace) ${CMAKE_INSTALL_PREFIX}/etc/plugin.conf" @@ -71,7 +71,8 @@ set(CPACK_RPM_EXECUTABLE_USER_FILELIST "%config(noreplace) ${CMAKE_INSTALL_PREFI "%config(noreplace) ${CMAKE_INSTALL_PREFIX}/etc/stream_compare_layer.conf" "%config(noreplace) ${CMAKE_INSTALL_PREFIX}/etc/necessary_plug_list.conf" "%config(noreplace) ${CMAKE_INSTALL_PREFIX}/etc/sapp_log.conf" - "%config(noreplace) /etc/sysconfig/sapp") + "%config(noreplace) /etc/sysconfig/sapp" + "%config(noreplace) /usr/lib/systemd/system/sapp.service") # Must uninstall the debug package before install release package set(CPACK_RPM_PACKAGE_CONFLICTS ${MY_RPM_NAME_PREFIX}) diff --git a/service/CMakeLists.txt b/service/CMakeLists.txt index f97829f..beb5bf5 100644 --- a/service/CMakeLists.txt +++ b/service/CMakeLists.txt @@ -8,6 +8,9 @@ else() #execute_process(COMMAND cp ${PROJECT_SOURCE_DIR}/service/sapp_default.service.in ${CMAKE_BINARY_DIR}/service/sapp.service) endif() +configure_file(${PROJECT_SOURCE_DIR}/service/sysconfig/sapp.in ${CMAKE_BINARY_DIR}/service/sapp) + +install(FILES ${CMAKE_BINARY_DIR}/service/sapp DESTINATION /etc/sysconfig COMPONENT PROFILE) install(FILES ${CMAKE_BINARY_DIR}/service/sapp.service DESTINATION /usr/lib/systemd/system) execute_process(COMMAND sh sapp_tmpfile.sh ${CMAKE_INSTALL_PREFIX} ${CMAKE_BINARY_DIR} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/service) diff --git a/service/sysconfig/sapp.in b/service/sysconfig/sapp.in new file mode 100644 index 0000000..46a0197 --- /dev/null +++ b/service/sysconfig/sapp.in @@ -0,0 +1,2 @@ +SAPP_ROOT=${CMAKE_INSTALL_PREFIX} +SAPP_LOG_ROOT=${CMAKE_INSTALL_PREFIX}
\ No newline at end of file |
