From f42cfb1ab74da97d1d49157f79d85f88ca5591ef Mon Sep 17 00:00:00 2001 From: "Seonghyun, Oh" Date: Wed, 13 Jan 2021 18:30:47 +0900 Subject: [PATCH] Copy jmx files instead of moving to support k8s --- common/scala/copyJMXFiles.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/scala/copyJMXFiles.sh b/common/scala/copyJMXFiles.sh index 85265b7f1ab..97364bbf800 100644 --- a/common/scala/copyJMXFiles.sh +++ b/common/scala/copyJMXFiles.sh @@ -18,6 +18,11 @@ if [[ $( ls /conf/jmxremote.* 2> /dev/null ) ]] then - mv /conf/jmxremote.* /home/owuser + # JMX auth files would be mounted as a symbolic link (read-only mode) + # with `root` privileges by the k8s secret. + cp -rL /conf/jmxremote.* /home/owuser + rm -f /conf/jmxremote.* 2>/dev/null || true + + # The owner must be `owuser` and the file only have read permission. chmod 600 /home/owuser/jmxremote.* fi