Skip to content

Commit 72c9814

Browse files
authored
Revert "Tee output so we can see it in journald logs (#346)" for dataproc (#354)
This partially reverts commit 9bd46a1. Root Cause: 1. The exec > >(tee -a "${POST_STARTUP_OUTPUT_FILE}") creates a tee subprocess that remains alive 2. The background process that waits for Jupyter inherits file descriptors from tee 3. When the main startup script exits, tee subprocess stays alive because the background process still has the pipes open 4. google-startup-scripts.service remains stuck in "activating" state indefinitely, waiting for all child processes 5. google-dataproc-agent.service has After=google-startup-scripts.service, so it never starts 6. This creates a race condition where the background Jupyter configuration runs while Dataproc is still writing its config Symptoms: - google-startup-scripts.service stuck in "activating" for hours - google-dataproc-agent.service never starts (ConditionResult=no)
1 parent b7bf009 commit 72c9814

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

startupscript/dataproc/startup.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,11 @@ readonly GIT_IGNORE="${USER_HOME_DIR}/gitignore_global"
149149
cd /tmp || exit
150150

151151
# Send stdout and stderr from this script to a file for debugging.
152-
# Use tee to also send output to journald logs.
153152
# Make the .wb directory as the user so that they own it and have correct linux permissions.
154153
${RUN_AS_LOGIN_USER} "mkdir -p '${USER_WORKBENCH_CONFIG_DIR}'"
155154
${RUN_AS_LOGIN_USER} "ln -sf '${USER_WORKBENCH_CONFIG_DIR}' '${USER_WORKBENCH_LEGACY_CONFIG_DIR}'"
156-
exec > >(tee -a "${POST_STARTUP_OUTPUT_FILE}") 2>&1
155+
exec >> "${POST_STARTUP_OUTPUT_FILE}"
156+
exec 2>&1
157157

158158
#######################################
159159
# Emit a message with a timestamp
@@ -917,8 +917,8 @@ cat << EOF >"${WORKBENCH_BOOT_SCRIPT}"
917917
# This script is run on instance boot to configure the instance for Workbench.
918918
919919
# Send stdout and stderr from this script to a file for debugging.
920-
# Use tee to also send output to journald logs.
921-
exec > >(tee -a "${WORKBENCH_BOOT_SERVICE_OUTPUT_FILE}") 2>&1
920+
exec >> "${WORKBENCH_BOOT_SERVICE_OUTPUT_FILE}"
921+
exec 2>&1
922922
923923
# Pick up environment from the ~/.bashrc
924924
source "${USER_BASHRC}"

0 commit comments

Comments
 (0)