From 0125754f2706de6d7218e0e78308389e9be9fb50 Mon Sep 17 00:00:00 2001 From: c00448856 Date: Mon, 21 Dec 2020 20:18:13 +0800 Subject: [PATCH] systemd --- .../package/installer/common/sgx-ra-service/Makefile | 6 +++--- .../installer/rpm/sgx-ra-service/sgx-ra-service.spec | 4 ++-- linux/installer/common/psw/install.sh | 8 ++++---- linux/installer/common/sgx-aesm-service/Makefile | 6 +++--- linux/installer/common/sgx-aesm-service/cleanup.sh | 2 +- linux/installer/common/sgx-aesm-service/startup.sh | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/external/dcap_source/SGXDataCenterAttestationPrimitives-DCAP_1.12.1/tools/SGXPlatformRegistration/package/installer/common/sgx-ra-service/Makefile b/external/dcap_source/SGXDataCenterAttestationPrimitives-DCAP_1.12.1/tools/SGXPlatformRegistration/package/installer/common/sgx-ra-service/Makefile index 1f3efdb..81592b1 100644 --- a/external/dcap_source/SGXDataCenterAttestationPrimitives-DCAP_1.12.1/tools/SGXPlatformRegistration/package/installer/common/sgx-ra-service/Makefile +++ b/external/dcap_source/SGXDataCenterAttestationPrimitives-DCAP_1.12.1/tools/SGXPlatformRegistration/package/installer/common/sgx-ra-service/Makefile @@ -37,9 +37,9 @@ PACKAGES=$(notdir $(wildcard $(PACKAGE_ROOT_FOLDER)/*)) VAR_OPT_PATH=/var/opt/sgxra USR_LIB_PATH=/usr/$(notdir $(shell gcc -print-multi-os-directory))/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH 2> /dev/null) -RAD_CONF_NAME=$(if $(wildcard /run/systemd/system/.*),mpa_registration_tool.service,$(if $(wildcard /etc/init/.*),mpa_registration_tool.conf,)) -RAD_CONF_DEL=$(if $(wildcard /run/systemd/system/.*),mpa_registration_tool.conf,$(if $(wildcard /etc/init/.*),mpa_registration_tool.service,)) -RAD_CONF_PATH=$(if $(wildcard /run/systemd/system/.*),$(if $(wildcard /lib/systemd/system/.*),/lib/systemd/system,/usr/lib/systemd/system),$(if $(wildcard /etc/init/.*),/etc/init/)) +RAD_CONF_NAME=$(if $(wildcard /run/systemd/users/.*),mpa_registration_tool.service,$(if $(wildcard /etc/init/.*),mpa_registration_tool.conf,)) +RAD_CONF_DEL=$(if $(wildcard /run/systemd/users/.*),mpa_registration_tool.conf,$(if $(wildcard /etc/init/.*),mpa_registration_tool.service,)) +RAD_CONF_PATH=$(if $(wildcard /run/systemd/users/.*),$(if $(wildcard /lib/systemd/system/.*),/lib/systemd/system,/usr/lib/systemd/system),$(if $(wildcard /etc/init/.*),/etc/init/)) ifeq ($(RAD_CONF_NAME),) ifneq ($(shell awk -F/ '$$2 == "docker"' /proc/self/cgroup),) diff --git a/external/dcap_source/SGXDataCenterAttestationPrimitives-DCAP_1.12.1/tools/SGXPlatformRegistration/package/installer/rpm/sgx-ra-service/sgx-ra-service.spec b/external/dcap_source/SGXDataCenterAttestationPrimitives-DCAP_1.12.1/tools/SGXPlatformRegistration/package/installer/rpm/sgx-ra-service/sgx-ra-service.spec index 89c1d8d..5c10e80 100644 --- a/external/dcap_source/SGXDataCenterAttestationPrimitives-DCAP_1.12.1/tools/SGXPlatformRegistration/package/installer/rpm/sgx-ra-service/sgx-ra-service.spec +++ b/external/dcap_source/SGXDataCenterAttestationPrimitives-DCAP_1.12.1/tools/SGXPlatformRegistration/package/installer/rpm/sgx-ra-service/sgx-ra-service.spec @@ -72,7 +72,7 @@ MPA_DST_PATH=%{_instal_path} # Install the MPA service -if [ -d /run/systemd/system ]; then +if [ -d /run/systemd/users ]; then MPA_NAME=mpa_registration_tool.service MPA_TEMP=$MPA_DST_PATH/$MPA_NAME if [ -d /lib/systemd/system ]; then @@ -122,7 +122,7 @@ systemctl start mpa_registration_tool.service MPA_DST_PATH=%{_install_path} # Disable service -if [ -d /run/systemd/system ]; then +if [ -d /run/systemd/users ]; then systemctl disable mpa_registration_tool.service fi diff --git a/linux/installer/common/psw/install.sh b/linux/installer/common/psw/install.sh index 042f83c..1ab1e5b 100755 --- a/linux/installer/common/psw/install.sh +++ b/linux/installer/common/psw/install.sh @@ -56,7 +56,7 @@ chmod 0750 /var/opt/aesmd mkdir -p /var/run/aesmd chmod 0755 /var/run/aesmd -if [ -d /run/systemd/system ]; then +if [ -d /run/systemd/users ]; then systemctl stop aesmd &> /dev/null || echo AESMD_NAME=aesmd.service AESMD_TEMP=$AESM_PATH/$AESMD_NAME @@ -114,7 +114,7 @@ fi cp -rf $PSW_DST_PATH/udev /etc rm -rf $PSW_DST_PATH/udev -if [ -d /run/systemd/system ]; then +if [ -d /run/systemd/users ]; then systemctl stop remount-dev-exec &> /dev/null || echo REMOUNT_DEV_EXEC_NAME=remount-dev-exec.service if [ -d /lib/systemd/system ]; then @@ -168,7 +168,7 @@ fi $PSW_DST_PATH/cleanup.sh # Stop and disable remount-dev-exec service -if [ -d /run/systemd/system ]; then +if [ -d /run/systemd/users ]; then systemctl stop remount-dev-exec systemctl disable remount-dev-exec fi @@ -215,7 +215,7 @@ chmod +x $PSW_DST_PATH/startup.sh $PSW_DST_PATH/startup.sh # Enable and start remount-dev-exec service -if [ -d /run/systemd/system ]; then +if [ -d /run/systemd/users ]; then systemctl enable remount-dev-exec systemctl start remount-dev-exec fi diff --git a/linux/installer/common/sgx-aesm-service/Makefile b/linux/installer/common/sgx-aesm-service/Makefile index 89c5b21..fd4c9b6 100644 --- a/linux/installer/common/sgx-aesm-service/Makefile +++ b/linux/installer/common/sgx-aesm-service/Makefile @@ -37,9 +37,9 @@ PACKAGES=$(notdir $(wildcard $(PACKAGE_ROOT_FOLDER)/*)) VAR_OPT_PATH=/var/opt/aesmd USR_LIB_PATH=/usr/$(notdir $(shell gcc -print-multi-os-directory))/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH 2> /dev/null) -AESMD_CONF_NAME=$(if $(wildcard /run/systemd/system/.*),aesmd.service,$(if $(wildcard /etc/init/.*),aesmd.conf,)) -AESMD_CONF_DEL=$(if $(wildcard /run/systemd/system/.*),aesmd.conf,$(if $(wildcard /etc/init/.*),aesmd.service,)) -AESMD_CONF_PATH=$(if $(wildcard /run/systemd/system/.*),$(if $(wildcard /lib/systemd/system/.*),/lib/systemd/system,/usr/lib/systemd/system),$(if $(wildcard /etc/init/.*),/etc/init/)) +AESMD_CONF_NAME=$(if $(wildcard /run/systemd/users/.*),aesmd.service,$(if $(wildcard /etc/init/.*),aesmd.conf,)) +AESMD_CONF_DEL=$(if $(wildcard /run/systemd/users/.*),aesmd.conf,$(if $(wildcard /etc/init/.*),aesmd.service,)) +AESMD_CONF_PATH=$(if $(wildcard /run/systemd/users/.*),$(if $(wildcard /lib/systemd/system/.*),/lib/systemd/system,/usr/lib/systemd/system),$(if $(wildcard /etc/init/.*),/etc/init/)) ifeq ($(AESMD_CONF_NAME),) ifneq ($(shell awk -F/ '$$2 == "docker"' /proc/self/cgroup),) diff --git a/linux/installer/common/sgx-aesm-service/cleanup.sh b/linux/installer/common/sgx-aesm-service/cleanup.sh index 30f5fbe..95c9f7a 100755 --- a/linux/installer/common/sgx-aesm-service/cleanup.sh +++ b/linux/installer/common/sgx-aesm-service/cleanup.sh @@ -39,7 +39,7 @@ if test $(id -u) -ne 0; then fi # Kill AESM service -if [ -d /run/systemd/system ]; then +if [ -d /run/systemd/users ]; then systemctl daemon-reload systemctl stop aesmd systemctl disable aesmd 2> /dev/null diff --git a/linux/installer/common/sgx-aesm-service/startup.sh b/linux/installer/common/sgx-aesm-service/startup.sh index e73c435..9170d7c 100755 --- a/linux/installer/common/sgx-aesm-service/startup.sh +++ b/linux/installer/common/sgx-aesm-service/startup.sh @@ -44,7 +44,7 @@ id -u aesmd &> /dev/null || \ -d /var/opt/aesmd -s /sbin/nologin aesmd # Start the AESMD service -if [ -d /run/systemd/system ]; then +if [ -d /run/systemd/users ]; then systemctl enable aesmd systemctl start aesmd elif [ -d /etc/init/ ]; then -- 2.23.0