mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2025-03-01 00:59:23 +01:00
fix redis persistence and #4449
This commit is contained in:
parent
502782f5ed
commit
5022cfaf37
5 changed files with 17 additions and 12 deletions
|
@ -444,6 +444,7 @@ if [ "${baseimage}" = "raspios_arm64" ]; then
|
||||||
fi
|
fi
|
||||||
echo "max_usb_current=1" | tee -a $configFile
|
echo "max_usb_current=1" | tee -a $configFile
|
||||||
echo "dtparam=nvme" | tee -a $configFile
|
echo "dtparam=nvme" | tee -a $configFile
|
||||||
|
echo "dtparam=watchdog=off" | tee -a $configFile
|
||||||
echo 'dtoverlay=pi3-disable-bt' | tee -a $configFile
|
echo 'dtoverlay=pi3-disable-bt' | tee -a $configFile
|
||||||
echo 'dtoverlay=disable-bt' | tee -a $configFile
|
echo 'dtoverlay=disable-bt' | tee -a $configFile
|
||||||
else
|
else
|
||||||
|
|
|
@ -450,8 +450,6 @@ fi
|
||||||
# from actions above
|
# from actions above
|
||||||
|
|
||||||
if [ "${systemInitReboot}" == "1" ]; then
|
if [ "${systemInitReboot}" == "1" ]; then
|
||||||
echo "Stopping Redis server" >> $logFile
|
|
||||||
systemctl stop redis
|
|
||||||
echo "Reboot" >> $logFile
|
echo "Reboot" >> $logFile
|
||||||
cp ${logFile} /home/admin/raspiblitz.systeminit.log
|
cp ${logFile} /home/admin/raspiblitz.systeminit.log
|
||||||
/home/admin/_cache.sh set state "reboot"
|
/home/admin/_cache.sh set state "reboot"
|
||||||
|
|
|
@ -111,16 +111,16 @@ elif [ "$1" = "keyvalue" ] && [ "$2" = "on" ]; then
|
||||||
sudo apt install -y redis-server
|
sudo apt install -y redis-server
|
||||||
|
|
||||||
# edit config: dont save to disk
|
# edit config: dont save to disk
|
||||||
sudo sed -i "/^save .*/d" /etc/redis/redis.conf
|
# echo "# edit config"
|
||||||
sudo sed -i 's/^stop-writes-on-bgsave-error yes/stop-writes-on-bgsave-error no/' /etc/redis/redis.conf
|
sudo cp /etc/redis/redis.conf /etc/redis/redis.conf.backup
|
||||||
|
sudo sed -i "s/^# save \"\"/save \"\"/g" /etc/redis/redis.conf
|
||||||
|
sudo sed -i "s/^appendonly yes/appendonly no/g" /etc/redis/redis.conf
|
||||||
|
sudo sed -i "s/^stop-writes-on-bgsave-error yes/stop-writes-on-bgsave-error no/g" /etc/redis/redis.conf
|
||||||
|
|
||||||
|
echo "# restart and remove db dump file"
|
||||||
# restart with new config
|
# restart with new config
|
||||||
if ! ischroot; then sudo systemctl restart redis-server; fi
|
if ! ischroot; then sudo systemctl restart redis-server; fi
|
||||||
|
|
||||||
# clean old databases if exist
|
|
||||||
sudo rm /var/lib/redis/dump.rdb 2>/dev/null
|
sudo rm /var/lib/redis/dump.rdb 2>/dev/null
|
||||||
|
|
||||||
# restart again this time there is no old data dump to load
|
|
||||||
if ! ischroot; then sudo systemctl restart redis-server; fi
|
if ! ischroot; then sudo systemctl restart redis-server; fi
|
||||||
|
|
||||||
# uninstall
|
# uninstall
|
||||||
|
|
|
@ -57,9 +57,15 @@ echo "OK"
|
||||||
# make sure that every install runs API with own secret
|
# make sure that every install runs API with own secret
|
||||||
# https://github.com/raspiblitz/raspiblitz/issues/4469
|
# https://github.com/raspiblitz/raspiblitz/issues/4469
|
||||||
echo
|
echo
|
||||||
echo "disable redis for initial start ..."
|
# check if redis is enabled
|
||||||
sudo systemctl stop redis 2>/dev/null
|
REDIS_ENABLED=$(sudo systemctl is-enabled redis 2>/dev/null | grep -c enabled)
|
||||||
sudo systemctl disable redis 2>/dev/null
|
if [ ${REDIS_ENABLED} -gt 0 ]; then
|
||||||
|
echo "disable redis for initial start ..."
|
||||||
|
sudo systemctl stop redis 2>/dev/null
|
||||||
|
sudo systemctl disable redis 2>/dev/null
|
||||||
|
fi
|
||||||
|
echo "deleting redis data (if still there) ..."
|
||||||
|
sudo rm /var/lib/redis/dump.rdb 2>/dev/null
|
||||||
echo "OK"
|
echo "OK"
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
|
|
@ -140,7 +140,7 @@ if [ "$2" = "info" ]; then
|
||||||
|
|
||||||
# get data
|
# get data
|
||||||
ln_getInfo=$($lndcli_alias getinfo 2>/dev/null)
|
ln_getInfo=$($lndcli_alias getinfo 2>/dev/null)
|
||||||
if [ "${ln_getInfo}" == "" ]; then
|
if [ $? != 0 ] || [ "${ln_getInfo}" == "" ]; then
|
||||||
echo "command='$lndcli_alias getinfo'"
|
echo "command='$lndcli_alias getinfo'"
|
||||||
echo "error='no data'"
|
echo "error='no data'"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Add table
Reference in a new issue