Move status file to /tmp

This commit is contained in:
Taylor Helsper 2020-08-21 13:31:47 -05:00
parent ffb8bc0bae
commit 2aa224c57c
7 changed files with 14 additions and 13 deletions

View File

@ -68,13 +68,13 @@ proc createMyNodeFsOnBlockDevice {blockDevice} {
if [catch {
puts "Waiting on format confirmation..."
runCommand echo "drive_format_confirm" > /mnt/hdd/mynode/.mynode_status
runCommand echo "drive_format_confirm" > /tmp/.mynode_status
while { [file exists "/tmp/format_ok"] == 0 } {
after 500
}
puts "Creating new partition table on ${blockDevice}"
runCommand echo "drive_formatting" > /mnt/hdd/mynode/.mynode_status
runCommand echo "drive_formatting" > /tmp/.mynode_status
runCommand /usr/bin/format_drive.sh ${blockDevice}
after 5000

View File

@ -31,7 +31,7 @@ while [ -f /mnt/hdd/mynode/settings/quicksync_disabled ]; do
sync
# Give Bitcoin a couple minutes to start
sleep 120s
echo "stable" > $MYNODE_DIR/.mynode_status
echo "stable" > $MYNODE_STATUS_FILE
sync
sleep 10d
done
@ -39,7 +39,7 @@ done
# Make sure folder exists
mkdir -p $QUICKSYNC_DIR
if [ ! -f $QUICKSYNC_DIR/.quicksync_download_complete ]; then
echo "quicksync_download" > $MYNODE_DIR/.mynode_status
echo "quicksync_download" > $MYNODE_STATUS_FILE
fi
echo "Starting quicksync..."
@ -50,7 +50,7 @@ if [ ! -f $QUICKSYNC_DIR/.quicksync_complete ] && [ -f $QUICKSYNC_DIR/.quicksync
fi
# Check if quicksync was completed
if [ -f $QUICKSYNC_DIR/.quicksync_complete ]; then
echo "stable" > $MYNODE_DIR/.mynode_status
echo "stable" > $MYNODE_STATUS_FILE
fi
# Download torrent

View File

@ -14,7 +14,7 @@ touch $QUICKSYNC_DIR/.quicksync_download_complete
sync
# Copy files
echo "quicksync_copy" > $MYNODE_DIR/.mynode_status
echo "quicksync_copy" > $MYNODE_STATUS_FILE
rm -rf $MYNODE_DIR/bitcoin/blocks/
rm -rf $MYNODE_DIR/bitcoin/chainstate/
tar -xvf $QUICKSYNC_DIR/blockchain*.tar.gz -C $MYNODE_DIR/bitcoin/ --dereference 2>&1 > /tmp/tar_log_$(date +%s)
@ -27,7 +27,7 @@ sleep 30s
touch $QUICKSYNC_DIR/.quicksync_complete
sync
sleep 5m
echo "stable" > $MYNODE_DIR/.mynode_status
echo "stable" > $MYNODE_STATUS_FILE
sync
exit 0

View File

@ -97,7 +97,7 @@ set -e
while [ ! -f /mnt/hdd/.mynode ]
do
# Clear status
rm -f $MYNODE_DIR/.mynode_status
rm -f $MYNODE_STATUS_FILE
mount_drive.tcl || true
sleep 5
done
@ -131,8 +131,8 @@ mkdir -p /mnt/hdd/mynode/whirlpool
mkdir -p /mnt/hdd/mynode/lnbits
mkdir -p /mnt/hdd/mynode/specter
mkdir -p /tmp/flask_uploads
echo "drive_mounted" > $MYNODE_DIR/.mynode_status
chmod 777 $MYNODE_DIR/.mynode_status
echo "drive_mounted" > $MYNODE_STATUS_FILE
chmod 777 $MYNODE_STATUS_FILE
rm -rf $MYNODE_DIR/.mynode_bitcoind_synced
@ -488,5 +488,5 @@ torify wget $LATEST_BETA_VERSION_URL -O /usr/share/mynode/latest_beta_version ||
# Update current state
if [ -f $QUICKSYNC_DIR/.quicksync_complete ]; then
echo "stable" > $MYNODE_DIR/.mynode_status
echo "stable" > $MYNODE_STATUS_FILE
fi

View File

@ -43,6 +43,7 @@ SERIAL_NUM=$(mynode-get-device-serial)
# Set all default / standard bash config settings
MYNODE_DIR=/mnt/hdd/mynode
MYNODE_STATUS_FILE=/tmp/.mynode_status
VPN_BACKUP_DIR=/mnt/hdd/mynode/vpn
QUICKSYNC_DIR=/mnt/hdd/mynode/quicksync
QUICKSYNC_CONFIG_DIR=/mnt/hdd/mynode/.config/transmission

View File

@ -454,7 +454,7 @@ def stop_quicksync():
os.system("systemctl stop quicksync")
def restart_quicksync():
os.system('echo "quicksync_reset" > /mnt/hdd/mynode/.mynode_status')
os.system('echo "quicksync_reset" > /tmp/.mynode_status')
stop_bitcoind()
stop_quicksync()
delete_bitcoin_data()

View File

@ -99,7 +99,7 @@ threads = []
### Helper functions
def get_status():
try:
status_file = "/mnt/hdd/mynode/.mynode_status"
status_file = "/tmp/.mynode_status"
status = STATE_UNKNOWN
# If its been a while, check for error conditions