diff --git a/.VERSION b/.VERSION index 27157caf..360908c6 100644 --- a/.VERSION +++ b/.VERSION @@ -1 +1 @@ -v8.1.0-beta.2 \ No newline at end of file +v8.1.0-beta.3 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index f3d9de55..58a7e51a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)) diff --git a/debian/scripts/maintenance.sh b/debian/scripts/maintenance.sh index dc423bc3..f43b1ebd 100644 --- a/debian/scripts/maintenance.sh +++ b/debian/scripts/maintenance.sh @@ -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