From 44677b7e949ff748b4a0443ba85d621cbf033803 Mon Sep 17 00:00:00 2001 From: Jeroen Ooms Date: Sat, 21 Mar 2020 23:40:50 +0100 Subject: [PATCH] Allow disabling apparmor via environment variable. Fixes https://github.com/opencpu/opencpu/issues/353 --- opencpu-server/rapache/onstartup.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/opencpu-server/rapache/onstartup.R b/opencpu-server/rapache/onstartup.R index 8c663422..f457346c 100644 --- a/opencpu-server/rapache/onstartup.R +++ b/opencpu-server/rapache/onstartup.R @@ -38,7 +38,9 @@ unix:::set_interactive(FALSE) options(rapache = TRUE) #Check if AppArmor is available -if(identical(unix::aa_config()$con, "unconfined")){ +if(nchar(Sys.getenv("OCPU_DISABLE_APPARMOR"))){ + cat("AppArmor has been disabled!\n") +} else if(identical(unix::aa_config()$con, "unconfined")){ options(apparmor = TRUE) cat("AppArmor available! Running OpenCPU with security profile and rlimits.\n") } else {