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 ## Changelog
### v8.1.0-beta.2 (coming soon) ### v8.1.0-beta.3 (05.07.2023)
* prohibit restore when startup script is still running * fix issue with js-controller ui upgrade
* extend time before restart after restore is done * fix small issues in maintenance script
* influx data repo will be added automatically when PACKAGES contains influxdb or influxdb2-cli package * 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) * v8.1.0-beta.1 (14.04.2023)
* enhance github actions * enhance github actions
* enhance log output of maintenance script on restore ([#333](https://github.com/buanet/ioBroker.docker/issues/333)) * 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 return
fi 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.' echo 'You are now going to stop ioBroker and activate maintenance mode for this container.'
if [[ "$autoconfirm" != yes ]]; then if [[ "$killbyname" != yes ]]; then
local reply if [[ "$autoconfirm" != yes ]]; then
local reply
read -rp 'Do you want to continue [yes/no]? ' reply read -rp 'Do you want to continue [yes/no]? ' reply
if [[ "$reply" == y || "$reply" == Y || "$reply" == yes ]]; then if [[ "$reply" == y || "$reply" == Y || "$reply" == yes ]]; then
: # continue : # continue
else else
return 1 return 1
fi
fi fi
else
echo 'This command was already confirmed by the -y or --yes option.'
fi fi
echo 'Activating maintenance mode...' echo 'Activating maintenance mode...'
echo 'maintenance' > "$healthcheck" echo 'maintenance' > "$healthcheck"
sleep 1 sleep 1
echo 'Done.'
echo -n 'Stopping ioBroker...' echo -n 'Stopping ioBroker...'
stop_iob stop_iob
} }
@@ -116,8 +100,6 @@ disable_maintenance() {
else else
return 1 return 1
fi fi
else
echo 'This command was already confirmed by the -y or --yes option.'
fi fi
echo 'Deactivating maintenance mode and forcing container to stop or restart...' echo 'Deactivating maintenance mode and forcing container to stop or restart...'
@@ -142,8 +124,6 @@ upgrade_jscontroller() {
else else
return 1 return 1
fi fi
else
echo 'This command was already confirmed by the -y or --yes option.'
fi fi
if ! maintenance_enabled > /dev/null; then if ! maintenance_enabled > /dev/null; then
@@ -169,29 +149,37 @@ stop_iob() {
local status timeout local status timeout
timeout="$(date --date="now + $pkill_timeout sec" +%s)" timeout="$(date --date="now + $pkill_timeout sec" +%s)"
pkill -u iobroker -f iobroker.js-controller pkill -u iobroker -f 'iobroker.js-controller[^/]*$'
status=$? status=$?
if (( status >= 2 )); then # syntax error or fatal error if (( status >= 2 )); then # syntax error or fatal error
echo 'fatal error' #for logging
return 1 return 1
fi fi
if (( status == 1 )); then # no processes matched if (( status == 1 )); then # no processes matched
echo 'no process matched' #for logging
return return
fi fi
# pgrep exits with status 1 when there are no matches if [[ "$killbyname" != yes ]]; then
while pgrep -u iobroker > /dev/null; (( $? != 1 )); do # pgrep exits with status 1 when there are no matches
if (($(date +%s) > timeout)); then while pgrep -u iobroker > /dev/null; (( $? != 1 )); do
echo -e '\nTimeout reached. Killing remaining processes...' if (($(date +%s) > timeout)); then
pgrep --list-full -u iobroker echo -e '\nTimeout reached. Killing remaining processes...'
pkill --signal SIGKILL -u iobroker pgrep --list-full -u iobroker
echo 'Done.' pkill --signal SIGKILL -u iobroker
return echo 'Done.'
fi return
fi
echo -n '.' echo -n '.'
sleep 1 sleep 1
done done
else
for ((i=0; i<3; i++)); do
sleep 1
echo -n '.'
done
fi
echo -e '\nDone.' echo -e '\nDone.'
} }
@@ -210,12 +198,12 @@ restart_container() {
else else
return 1 return 1
fi fi
else
echo 'This command was already confirmed by the -y or --yes option.'
fi fi
echo -n 'Stopping ioBroker...' if ! maintenance_enabled > /dev/null; then
stop_iob echo -n 'Stopping ioBroker...'
stop_iob
fi
echo 'Container will be stopped or restarted in 5 seconds...' echo 'Container will be stopped or restarted in 5 seconds...'
sleep 5 sleep 5
@@ -238,8 +226,6 @@ restore_iobroker() {
else else
return 1 return 1
fi fi
else
echo 'This command was already confirmed by the -y or --yes option.'
fi fi
if check_starting > /dev/null; then if check_starting > /dev/null; then