forked from gitpod-io/workspace-images
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use .runonce for rust, dotnet, mysql, postgres, vnc, yugabyte to avoi…
…d race condition
- Loading branch information
Showing
11 changed files
with
60 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
if test -e "${GITPOD_REPO_ROOT:-}"; then { | ||
export CARGO_HOME=/workspace/.cargo | ||
export PATH=$CARGO_HOME/bin:$PATH | ||
}; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
if test -e "${GITPOD_REPO_ROOT:-}"; then { | ||
CARGO_HOME="/workspace/.cargo" | ||
mkdir -p "$CARGO_HOME/bin" 2>/dev/null | ||
|
||
if test ! -e "$CARGO_HOME/bin/rustup" && rustup="$(command -v rustup)"; then { | ||
mv "${rustup}" "$CARGO_HOME/bin" | ||
}; fi | ||
}; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ -n "${GITPOD_REPO_ROOT:-}" ]; then | ||
CONTAINER_DIR=$(awk '{ print $6 }' /proc/self/maps | grep '^/run/containerd' | head -n 1 | cut -d '/' -f 1-6) | ||
if [ -n "${CONTAINER_DIR}" ] && [ ! -d "${CONTAINER_DIR}" ]; then | ||
sudo sh <<-CMD | ||
mkdir -p "${CONTAINER_DIR}" && ln -s / "${CONTAINER_DIR}/rootfs" | ||
CMD | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,26 @@ | ||
#!/usr/bin/env bash | ||
# Auto-start PostgreSQL server | ||
( | ||
if mkdir /tmp/.pgsql_lock 2>/dev/null; then { | ||
target="${PGWORKSPACE}" | ||
source="${target//\/workspace/$HOME}" | ||
target="${PGWORKSPACE}" | ||
source="${target//\/workspace/$HOME}" | ||
|
||
if test -e "$source"; then { | ||
if test -e "$source"; then { | ||
|
||
if test ! -e "$target"; then { | ||
mv "$source" "$target" | ||
}; fi | ||
if test ! -e "$target"; then { | ||
mv "$source" "$target" | ||
}; fi | ||
|
||
if ! [[ "$(pg_ctl status)" =~ PID ]]; then { | ||
printf 'INFO: %s\n' "Executing command: pg_start" | ||
pg_start | ||
trap "pg_stop" TERM EXIT | ||
exec {sfd}<> <(:) | ||
printf 'INFO: %s\n' \ | ||
"Please create another terminal" \ | ||
"this one is monitoring postgres server for gracefully shutting down when needed" | ||
until read -r -t 3600 -u $sfd; do continue; done | ||
}; fi | ||
if ! [[ "$(pg_ctl status)" =~ PID ]]; then { | ||
printf 'INFO: %s\n' "Executing command: pg_start" | ||
pg_start | ||
( | ||
trap "pg_stop" TERM EXIT | ||
exec {sfd}<> <(:) | ||
# printf 'INFO: %s\n' \ | ||
# "Please create another terminal" \ | ||
# "this one is monitoring postgres server for gracefully shutting down when needed" | ||
until read -r -t 3600 -u $sfd; do continue; done | ||
) & | ||
disown | ||
}; fi | ||
|
||
}; fi | ||
}; fi & | ||
) | ||
}; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters