v8.1.0-beta.3

This commit is contained in:
buanet
2023-07-05 21:44:47 +02:00
parent f225536852
commit 3d83c7fa21
3 changed files with 43 additions and 53 deletions

View File

@@ -1 +1 @@
v8.1.0-beta.2
v8.1.0-beta.3

View File

@@ -1,9 +1,13 @@
## Changelog
### v8.1.0-beta.2 (coming soon)
* prohibit restore when startup script is still running
* extend time before restart after restore is done
* influx data repo will be added automatically when PACKAGES contains influxdb or influxdb2-cli package
### v8.1.0-beta.3 (05.07.2023)
* fix issue with js-controller ui upgrade
* fix small issues in maintenance script
* update action workflows
* v8.1.0-beta.2 (26.04.2023)
* prohibit restore when startup script is still running
* extend time before restart after restore is done
* influx data repo will be added automatically when PACKAGES contains influxdb or influxdb2-cli package
* v8.1.0-beta.1 (14.04.2023)
* enhance github actions
* enhance log output of maintenance script on restore ([#333](https://github.com/buanet/ioBroker.docker/issues/333))

View File

@@ -59,40 +59,24 @@ enable_maintenance() {
return
fi
if [[ "$killbyname" == yes ]]; then
# undocumented option, only for use with backitup restore scripts
# stops iobroker by terminating js-controller process by name (the old way)
echo 'This command will activate maintenance mode and stop js-controller.'
echo 'Activating maintenance mode...'
echo 'maintenance' > "$healthcheck"
sleep 1
echo 'Done.'
echo -n 'Stopping ioBroker...'
pkill -u iobroker -f iobroker.js-controller
sleep 5
echo 'Done.'
return
fi
echo 'You are now going to stop ioBroker and activate maintenance mode for this container.'
if [[ "$autoconfirm" != yes ]]; then
local reply
if [[ "$killbyname" != yes ]]; then
if [[ "$autoconfirm" != yes ]]; then
local reply
read -rp 'Do you want to continue [yes/no]? ' reply
if [[ "$reply" == y || "$reply" == Y || "$reply" == yes ]]; then
read -rp 'Do you want to continue [yes/no]? ' reply
if [[ "$reply" == y || "$reply" == Y || "$reply" == yes ]]; then
: # continue
else
return 1
else
return 1
fi
fi
else
echo 'This command was already confirmed by the -y or --yes option.'
fi
echo 'Activating maintenance mode...'
echo 'maintenance' > "$healthcheck"
sleep 1
echo 'Done.'
echo -n 'Stopping ioBroker...'
stop_iob
}
@@ -116,8 +100,6 @@ disable_maintenance() {
else
return 1
fi
else
echo 'This command was already confirmed by the -y or --yes option.'
fi
echo 'Deactivating maintenance mode and forcing container to stop or restart...'
@@ -142,8 +124,6 @@ upgrade_jscontroller() {
else
return 1
fi
else
echo 'This command was already confirmed by the -y or --yes option.'
fi
if ! maintenance_enabled > /dev/null; then
@@ -169,29 +149,37 @@ stop_iob() {
local status timeout
timeout="$(date --date="now + $pkill_timeout sec" +%s)"
pkill -u iobroker -f iobroker.js-controller
pkill -u iobroker -f 'iobroker.js-controller[^/]*$'
status=$?
if (( status >= 2 )); then # syntax error or fatal error
echo 'fatal error' #for logging
return 1
fi
if (( status == 1 )); then # no processes matched
echo 'no process matched' #for logging
return
fi
# pgrep exits with status 1 when there are no matches
while pgrep -u iobroker > /dev/null; (( $? != 1 )); do
if (($(date +%s) > timeout)); then
echo -e '\nTimeout reached. Killing remaining processes...'
pgrep --list-full -u iobroker
pkill --signal SIGKILL -u iobroker
echo 'Done.'
return
fi
echo -n '.'
sleep 1
done
if [[ "$killbyname" != yes ]]; then
# pgrep exits with status 1 when there are no matches
while pgrep -u iobroker > /dev/null; (( $? != 1 )); do
if (($(date +%s) > timeout)); then
echo -e '\nTimeout reached. Killing remaining processes...'
pgrep --list-full -u iobroker
pkill --signal SIGKILL -u iobroker
echo 'Done.'
return
fi
echo -n '.'
sleep 1
done
else
for ((i=0; i<3; i++)); do
sleep 1
echo -n '.'
done
fi
echo -e '\nDone.'
}
@@ -210,12 +198,12 @@ restart_container() {
else
return 1
fi
else
echo 'This command was already confirmed by the -y or --yes option.'
fi
echo -n 'Stopping ioBroker...'
stop_iob
if ! maintenance_enabled > /dev/null; then
echo -n 'Stopping ioBroker...'
stop_iob
fi
echo 'Container will be stopped or restarted in 5 seconds...'
sleep 5
@@ -238,8 +226,6 @@ restore_iobroker() {
else
return 1
fi
else
echo 'This command was already confirmed by the -y or --yes option.'
fi
if check_starting > /dev/null; then