From 597d27196c6aae7959dc97df124466225231c2c8 Mon Sep 17 00:00:00 2001 From: Matthew McClaskey Date: Mon, 13 Nov 2023 16:30:11 +0000 Subject: [PATCH 1/5] enable verbose logging on profile sync --- src/common/scripts/kasm_hook_scripts/kasm_pre_shutdown_user.sh | 2 +- src/common/startup_scripts/vnc_startup.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/scripts/kasm_hook_scripts/kasm_pre_shutdown_user.sh b/src/common/scripts/kasm_hook_scripts/kasm_pre_shutdown_user.sh index 5253404..05c7811 100644 --- a/src/common/scripts/kasm_hook_scripts/kasm_pre_shutdown_user.sh +++ b/src/common/scripts/kasm_hook_scripts/kasm_pre_shutdown_user.sh @@ -62,7 +62,7 @@ if [ ! -z "$KASM_PROFILE_LDR" ]; then echo >&2 "Profile sync not available" else echo "Packing and uploading user profile to object storage." - http_proxy="" https_proxy="" /usr/bin/kasm-profile-sync --upload /home/kasm-user --insecure --filter "${KASM_PROFILE_FILTER}" --remote ${KASM_API_HOST} --port ${KASM_API_PORT} -c ${KASM_PROFILE_CHUNK_SIZE} --token ${KASM_API_JWT} + http_proxy="" https_proxy="" /usr/bin/kasm-profile-sync --upload /home/kasm-user --insecure --filter "${KASM_PROFILE_FILTER}" --remote ${KASM_API_HOST} --port ${KASM_API_PORT} -c ${KASM_PROFILE_CHUNK_SIZE} --token ${KASM_API_JWT} --verbose echo "Profile upload complete." fi fi diff --git a/src/common/startup_scripts/vnc_startup.sh b/src/common/startup_scripts/vnc_startup.sh index ae1a14b..a6744ac 100755 --- a/src/common/startup_scripts/vnc_startup.sh +++ b/src/common/startup_scripts/vnc_startup.sh @@ -70,7 +70,7 @@ function pull_profile (){ echo "Downloading and unpacking user profile from object storage." set +e - http_proxy="" https_proxy="" /usr/bin/kasm-profile-sync --download /home/kasm-user --insecure --remote ${KASM_API_HOST} --port ${KASM_API_PORT} -c ${KASM_PROFILE_CHUNK_SIZE} --token ${KASM_API_JWT} + http_proxy="" https_proxy="" /usr/bin/kasm-profile-sync --download /home/kasm-user --insecure --remote ${KASM_API_HOST} --port ${KASM_API_PORT} -c ${KASM_PROFILE_CHUNK_SIZE} --token ${KASM_API_JWT} --verbose PROCESS_SYNC_EXIT_CODE=$? set -e if (( PROCESS_SYNC_EXIT_CODE > 1 )); then From c2977f499e645db7c5f05bcd6bd017d9d9b3c22a Mon Sep 17 00:00:00 2001 From: Matthew McClaskey Date: Mon, 13 Nov 2023 18:46:13 +0000 Subject: [PATCH 2/5] use debug env var instead --- .../scripts/kasm_hook_scripts/kasm_pre_shutdown_user.sh | 6 +++++- src/common/startup_scripts/vnc_startup.sh | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/common/scripts/kasm_hook_scripts/kasm_pre_shutdown_user.sh b/src/common/scripts/kasm_hook_scripts/kasm_pre_shutdown_user.sh index 05c7811..1fa44f0 100644 --- a/src/common/scripts/kasm_hook_scripts/kasm_pre_shutdown_user.sh +++ b/src/common/scripts/kasm_hook_scripts/kasm_pre_shutdown_user.sh @@ -62,7 +62,11 @@ if [ ! -z "$KASM_PROFILE_LDR" ]; then echo >&2 "Profile sync not available" else echo "Packing and uploading user profile to object storage." - http_proxy="" https_proxy="" /usr/bin/kasm-profile-sync --upload /home/kasm-user --insecure --filter "${KASM_PROFILE_FILTER}" --remote ${KASM_API_HOST} --port ${KASM_API_PORT} -c ${KASM_PROFILE_CHUNK_SIZE} --token ${KASM_API_JWT} --verbose + if [[ $DEBUG == true ]]; then + http_proxy="" https_proxy="" /usr/bin/kasm-profile-sync --upload /home/kasm-user --insecure --filter "${KASM_PROFILE_FILTER}" --remote ${KASM_API_HOST} --port ${KASM_API_PORT} -c ${KASM_PROFILE_CHUNK_SIZE} --token ${KASM_API_JWT} --verbose + else + http_proxy="" https_proxy="" /usr/bin/kasm-profile-sync --upload /home/kasm-user --insecure --filter "${KASM_PROFILE_FILTER}" --remote ${KASM_API_HOST} --port ${KASM_API_PORT} -c ${KASM_PROFILE_CHUNK_SIZE} --token ${KASM_API_JWT} + fi echo "Profile upload complete." fi fi diff --git a/src/common/startup_scripts/vnc_startup.sh b/src/common/startup_scripts/vnc_startup.sh index a6744ac..df5e763 100755 --- a/src/common/startup_scripts/vnc_startup.sh +++ b/src/common/startup_scripts/vnc_startup.sh @@ -70,7 +70,11 @@ function pull_profile (){ echo "Downloading and unpacking user profile from object storage." set +e - http_proxy="" https_proxy="" /usr/bin/kasm-profile-sync --download /home/kasm-user --insecure --remote ${KASM_API_HOST} --port ${KASM_API_PORT} -c ${KASM_PROFILE_CHUNK_SIZE} --token ${KASM_API_JWT} --verbose + if [[ $DEBUG == true ]]; then + http_proxy="" https_proxy="" /usr/bin/kasm-profile-sync --download /home/kasm-user --insecure --remote ${KASM_API_HOST} --port ${KASM_API_PORT} -c ${KASM_PROFILE_CHUNK_SIZE} --token ${KASM_API_JWT} --verbose + else + http_proxy="" https_proxy="" /usr/bin/kasm-profile-sync --download /home/kasm-user --insecure --remote ${KASM_API_HOST} --port ${KASM_API_PORT} -c ${KASM_PROFILE_CHUNK_SIZE} --token ${KASM_API_JWT} + fi PROCESS_SYNC_EXIT_CODE=$? set -e if (( PROCESS_SYNC_EXIT_CODE > 1 )); then From 65fc05052cf77e655034cc878c742f46995187eb Mon Sep 17 00:00:00 2001 From: Matthew McClaskey Date: Mon, 4 Dec 2023 20:47:37 +0000 Subject: [PATCH 3/5] Changed order of debug export --- src/common/startup_scripts/vnc_startup.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/common/startup_scripts/vnc_startup.sh b/src/common/startup_scripts/vnc_startup.sh index df5e763..b2402cb 100755 --- a/src/common/startup_scripts/vnc_startup.sh +++ b/src/common/startup_scripts/vnc_startup.sh @@ -322,6 +322,12 @@ if [[ $1 =~ -h|--help ]]; then exit 0 fi +if [[ ${KASM_DEBUG:-0} == 1 ]]; then + echo -e "\n\n------------------ DEBUG KASM STARTUP -----------------" + export DEBUG=true + set -x +fi + # Syncronize user-space loaded persistent profiles pull_profile @@ -330,12 +336,6 @@ if [ -f $HOME/.bashrc ]; then source $HOME/.bashrc fi -if [[ ${KASM_DEBUG:-0} == 1 ]]; then - echo -e "\n\n------------------ DEBUG KASM STARTUP -----------------" - export DEBUG=true - set -x -fi - ## resolve_vnc_connection VNC_IP=$(hostname -i) if [[ $DEBUG == true ]]; then From 7c3f872f27fbcb00bbc32802e86c5db1c16274d7 Mon Sep 17 00:00:00 2001 From: Matthew McClaskey Date: Mon, 4 Dec 2023 20:50:32 +0000 Subject: [PATCH 4/5] remove outdated comment --- src/common/startup_scripts/vnc_startup.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/common/startup_scripts/vnc_startup.sh b/src/common/startup_scripts/vnc_startup.sh index b2402cb..93a77ba 100755 --- a/src/common/startup_scripts/vnc_startup.sh +++ b/src/common/startup_scripts/vnc_startup.sh @@ -52,8 +52,6 @@ function help (){ -d, --debug enables more detailed startup output e.g. 'docker run kasmweb/core --debug bash' -h, --help print out this help - - Fore more information see: https://github.com/ConSol/docker-headless-vnc-container " } From 2c09c62cfb088c46c41f6d55f719f522aeabdded Mon Sep 17 00:00:00 2001 From: Matthew McClaskey Date: Mon, 4 Dec 2023 20:54:11 +0000 Subject: [PATCH 5/5] add startup scripts to change monitoring --- ci-scripts/template-vars.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/ci-scripts/template-vars.yaml b/ci-scripts/template-vars.yaml index e89a78e..157e6ee 100644 --- a/ci-scripts/template-vars.yaml +++ b/ci-scripts/template-vars.yaml @@ -1,5 +1,6 @@ files: &UNIVERSAL_CHANGE_FILES - src/common/** + - src/common/startup_scripts/** - src/ubuntu/install/audio/** - src/ubuntu/install/audio_input/** - src/ubuntu/install/cleanup/**