summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluqiuwen <[email protected]>2019-09-17 10:51:31 +0800
committerluqiuwen <[email protected]>2019-09-17 10:51:31 +0800
commitfb22ab1cb6bbd45dc7b9a7383c7d37db5cf85373 (patch)
tree2c163f738af4476ca1cb9feef6dfb53cb36d4610
parent1d45bebe4fa7342818046a8d44379b1ab23576fe (diff)
#165 增加PostInstall脚本,用于创建临时文件存储的目录。
-rw-r--r--cmake/Package.cmake6
-rw-r--r--cmake/PostInstall.in6
-rw-r--r--cmake/PostUninstall.in6
-rw-r--r--cmake/PreUninstall.in4
-rw-r--r--script/service/tfe-env-config2
-rw-r--r--script/service/tfe.service1
6 files changed, 15 insertions, 10 deletions
diff --git a/cmake/Package.cmake b/cmake/Package.cmake
index 540be52..d36b3e7 100644
--- a/cmake/Package.cmake
+++ b/cmake/Package.cmake
@@ -19,9 +19,9 @@ set(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
set(CPACK_RPM_PACKAGE_AUTOREQPROV "no")
set(CPACK_RPM_PACKAGE_RELEASE_DIST on)
set(CPACK_RPM_DEBUGINFO_PACKAGE on)
-#set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/cmake/PostInstall.in)
-#set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/cmake/PostUninstall.in)
-#set(CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/cmake/PreUninstall.in)
+set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/cmake/PostInstall.in)
+set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/cmake/PostUninstall.in)
+set(CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/cmake/PreUninstall.in)
# Must uninstall the debug package before install release package
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
diff --git a/cmake/PostInstall.in b/cmake/PostInstall.in
index d52334e..3924da1 100644
--- a/cmake/PostInstall.in
+++ b/cmake/PostInstall.in
@@ -1,2 +1,4 @@
-%systemd_post mrenv.service mrzcpd.service mrtunnat.service
-/sbin/ldconfig \ No newline at end of file
+%systemd_post tfe-env.service tfe-env-tun-mode.service tfe.service
+%sysctl_apply
+%tmpfiles_create
+/sbin/ldconfig
diff --git a/cmake/PostUninstall.in b/cmake/PostUninstall.in
index d24e6f5..86b5159 100644
--- a/cmake/PostUninstall.in
+++ b/cmake/PostUninstall.in
@@ -1,2 +1,4 @@
-%systemd_postun_with_restart mrenv.service mrzcpd.service mrtunnat.service
-/sbin/ldconfig \ No newline at end of file
+%systemd_postun_with_restart tfe-env.service tfe-env-tun-mode.service tfe.service
+%sysctl_apply
+%tmpfiles_create
+/sbin/ldconfig
diff --git a/cmake/PreUninstall.in b/cmake/PreUninstall.in
index 4dbf922..0e04afa 100644
--- a/cmake/PreUninstall.in
+++ b/cmake/PreUninstall.in
@@ -1 +1,3 @@
-%systemd_preun mrenv.service mrzcpd.service mrtunnat.service \ No newline at end of file
+%systemd_preun tfe-env.service tfe-env-tun-mode.service tfe.service
+%sysctl_apply
+%tmpfiles_create
diff --git a/script/service/tfe-env-config b/script/service/tfe-env-config
index 69936e0..310b95c 100644
--- a/script/service/tfe-env-config
+++ b/script/service/tfe-env-config
@@ -1,4 +1,3 @@
-
TFE_DEVICE_DATA_INCOMING=tun_kni
TFE_LOCAL_MAC_DATA_INCOMING=fe:65:b7:00:00:01
TFE_PEER_MAC_DATA_INCOMING=aa:bb:cc:dd:ee:ff
@@ -6,4 +5,3 @@ TFE_LOCAL_IP_DATA_INCOMING=172.16.241.2
TFE_PEER_IP_DATA_INCOMING=172.16.241.1
TFE_WATCHDOG_DEVICE=enp2s0
TFE_WATCHDOG_IP=192.168.100.1
-
diff --git a/script/service/tfe.service b/script/service/tfe.service
index b5b39a0..1dc8519 100644
--- a/script/service/tfe.service
+++ b/script/service/tfe.service
@@ -6,6 +6,7 @@ After=tfe-env.service
[Service]
Type=simple
ExecStart=/opt/tsg/tfe/bin/tfe
+WorkingDirectory=/opt/tsg/tfe/
TimeoutSec=180s
RestartSec=10s
Restart=always