Invoke on-reboot from cloud startup script to avoid racing with cron (#6579)

automerge
This commit is contained in:
Michael Vines
2019-10-27 10:56:16 -07:00
committed by Grimes
parent f3c0aa154a
commit 0c14ca58c7
2 changed files with 6 additions and 1 deletions

View File

@ -662,6 +662,7 @@ EOF
set -ex set -ex
if [[ -f /solana-scratch/.instance-startup-complete ]]; then if [[ -f /solana-scratch/.instance-startup-complete ]]; then
echo reboot
$( $(
cd "$here"/scripts/ cd "$here"/scripts/
if "$enableGpu"; then if "$enableGpu"; then
@ -672,6 +673,9 @@ if [[ -f /solana-scratch/.instance-startup-complete ]]; then
cat mount-additional-disk.sh cat mount-additional-disk.sh
fi fi
) )
if [[ -x ~solana/solana/on-reboot ]]; then
sudo -u solana ~solana/solana/on-reboot
fi
# Skip most setup on instance reboot # Skip most setup on instance reboot
exit 0 exit 0
@ -733,6 +737,8 @@ $(
) )
cat > /etc/motd <<EOM cat > /etc/motd <<EOM
See startup script log messages in /var/log/syslog for status:
$ sudo cat /var/log/syslog | egrep \\(startup-script\\|cloud-init\)
$(printNetworkInfo) $(printNetworkInfo)
$(creationInfo) $(creationInfo)
EOM EOM

View File

@ -76,7 +76,6 @@ now=\$(date -u +"%Y-%m-%dT%H:%M:%SZ")
ln -sfT validator.log.\$now validator.log ln -sfT validator.log.\$now validator.log
EOF EOF
chmod +x ~/solana/on-reboot chmod +x ~/solana/on-reboot
echo "@reboot ~/solana/on-reboot" | crontab -
GPU_CUDA_OK=false GPU_CUDA_OK=false
GPU_FAIL_IF_NONE=false GPU_FAIL_IF_NONE=false