#156 增加tmpfiles描述文件,自动删除日志与临时文件。调整目录结构,默认安装到/opt/tsg/tfe下。

This commit is contained in:
luqiuwen
2019-09-16 19:11:39 +08:00
parent f1fd1d0ad3
commit 1d45bebe4f
5 changed files with 11 additions and 34 deletions

View File

@@ -14,7 +14,7 @@ if(NOT CMAKE_BUILD_TYPE)
endif()
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set (CMAKE_INSTALL_PREFIX "/home/mesasoft/tfe" CACHE PATH "default install path" FORCE )
set (CMAKE_INSTALL_PREFIX "/opt/tsg/tfe" CACHE PATH "default install path" FORCE )
endif()
# Global compile options

View File

@@ -1,7 +1,6 @@
install(PROGRAMS user/r2_tfe DESTINATION ./ COMPONENT Program)
install(PROGRAMS user/r3_tfe DESTINATION ./ COMPONENT Program)
install(FILES sysctl/80-tfe.conf DESTINATION /etc/sysctl.d/ COMPONENT Program)
install(FILES service/tfe.service DESTINATION /usr/lib/systemd/system/ COMPONENT Program)
install(FILES service/tfe-env-tun-mode.service DESTINATION /usr/lib/systemd/system/ COMPONENT Program)
install(FILES service/tfe-env.service DESTINATION /usr/lib/systemd/system/ COMPONENT Program)
install(FILES sysctl/80-tfe.conf DESTINATION /etc/sysctl.d/ COMPONENT Profile)
install(FILES tmpfiles/tfe.conf DESTINATION /usr/lib/tmpfiles.d/ COMPONENT Profile)
install(FILES service/tfe-env-config DESTINATION /etc/sysconfig/ COMPONENT Profile)

View File

@@ -1,16 +0,0 @@
[Unit]
Description=tsg kni module
Requires=tfe-env.service
After=tfe-env.service
[Service]
WorkingDirectory=/home/tsg/kni
#ExecStart=/home/tsg/kni/kni_service_scipt start
ExecStart=/home/tsg/kni/sapp
#ExecStop=/home/tsg/kni/kni_service_scipt stop
#Type=forking
Restart=always
RestartSec=5s
[Install]
WantedBy=multi-user.target

View File

@@ -1,14 +0,0 @@
[Unit]
Description=tsg tfe module
Requires=tsgkni.service
After=tsgkni.service
[Service]
WorkingDirectory=/home/tsg/tfe/
ExecStart=/home/tsg/tfe/bin/tfe
ExecStop=/bin/kill -9 $MAINPID
Restart=always
RestartSec=5s
[Install]
WantedBy=multi-user.target

8
script/tmpfiles/tfe.conf Normal file
View File

@@ -0,0 +1,8 @@
#Type Path Mode User Group Age Argument
d /var/log/tfe/ 0755 - - 7d -
d /var/tmp/tfe/crashreport 0755 - - 30d -
d /var/tmp/tfe/pangu_files 0755 - - - 30d -
d /var/tmp/tfe/rulescan_tmp 0755 - - - 30d -
L /opt/tsg/tfe/log - - - - /var/log/tfe
L /opt/tsg/tfe/pangu_files - - - - /var/tmp/tfe/pangu_files
L /opt/tsg/tfe/rulescan_tmp - - - - /var/tmp/tfe/rulescan_tmp