# aesm - Intel(R) SGX Application Enclave Service Managerment server
#
# The AESM provides Application Enclave Service to SGX user.

description	"Intel(R) Architectural Enclave Service Manager"

start on runlevel [2345]
stop on runlevel [!2345]

respawn
respawn limit 10 5
normal exit 0
umask 022

expect fork
console none
setuid "aesmd"

env NAME="aesm_service"
env AESM_PATH=@aesm_folder@
env DAEMON="$AESM_PATH/$NAME"


pre-start script
    test -x $AESM_PATH/$NAME || { stop; exit 0; }
end script


exec $AESM_PATH/$NAME
