summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
author杨威 <[email protected]>2020-09-29 16:47:37 +0800
committer杨威 <[email protected]>2020-09-29 16:47:37 +0800
commit5ff9d21794c2a0db9918cc0a59065004416c22a6 (patch)
treed24f0c1883051dba9714d32237e66204b7d12818 /service
parentbf91eed2ad792199f670c59f8f2f39bd2ac7c61c (diff)
✨feat(service/): 增加根据install路径生成tmpfile配置并安装
Diffstat (limited to 'service')
-rw-r--r--service/CMakeLists.txt3
-rw-r--r--service/sapp_tmpfile.sh4
2 files changed, 7 insertions, 0 deletions
diff --git a/service/CMakeLists.txt b/service/CMakeLists.txt
index aea69ea..aa81611 100644
--- a/service/CMakeLists.txt
+++ b/service/CMakeLists.txt
@@ -6,3 +6,6 @@ endif()
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)
+install(FILES ${CMAKE_BINARY_DIR}/sapp_tmpfile.conf DESTINATION /usr/lib/tmpfiles.d/ COMPONENT PROFILE)
+
diff --git a/service/sapp_tmpfile.sh b/service/sapp_tmpfile.sh
new file mode 100644
index 0000000..e6d4486
--- /dev/null
+++ b/service/sapp_tmpfile.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+install_path=$1
+conf_path=$2
+echo "d ${install_path}/log 0755 - - 30d -" >>${conf_path}/sapp_tmpfile.conf \ No newline at end of file