mirror of
https://github.com/buanet/ioBroker.docker.git
synced 2025-12-17 10:29:00 +02:00
fix running maintenance script as iobroker
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
## Changelog
|
||||
|
||||
### v8.1.0-beta.3 (05.07.2023)
|
||||
### v8.1.0-beta.4 (coming soon)
|
||||
* fix running maintenance script as iobroker
|
||||
* v8.1.0-beta.3 (05.07.2023)
|
||||
* fix permission issue for restart container as iobroker user
|
||||
* fix issue with js-controller ui upgrade
|
||||
* fix small issues in maintenance script
|
||||
|
||||
6
debian/scripts/iobroker_startup.sh
vendored
6
debian/scripts/iobroker_startup.sh
vendored
@@ -149,9 +149,9 @@ if [[ -f /opt/.first_run ]]; then
|
||||
echo ' '
|
||||
# Register maintenance script
|
||||
echo -n 'Registering maintenance script as command... '
|
||||
echo "alias maintenance=\'/opt/scripts/maintenance.sh\'" >> /root/.bashrc
|
||||
echo "alias maint=\'/opt/scripts/maintenance.sh\'" >> /root/.bashrc
|
||||
echo "alias m=\'/opt/scripts/maintenance.sh\'" >> /root/.bashrc
|
||||
echo "alias maintenance='/opt/scripts/maintenance.sh'" >> /etc/bash.bashrc
|
||||
echo "alias maint='/opt/scripts/maintenance.sh'" >> /etc/bash.bashrc
|
||||
echo "alias m='/opt/scripts/maintenance.sh'" >> /etc/bash.bashrc
|
||||
echo 'Done.'
|
||||
else
|
||||
echo "This is not the first run of this container. Skipping first run preparation."
|
||||
|
||||
6
debian/scripts/maintenance.sh
vendored
6
debian/scripts/maintenance.sh
vendored
@@ -152,22 +152,20 @@ stop_iob() {
|
||||
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
|
||||
|
||||
if [[ "$killbyname" != yes ]]; then
|
||||
# pgrep exits with status 1 when there are no matches
|
||||
while pgrep -u iobroker > /dev/null; (( $? != 1 )); do
|
||||
while pgrep -u iobroker -f 'io.' > /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
|
||||
pkill --signal SIGKILL -u iobroker -f 'io.'
|
||||
echo 'Done.'
|
||||
return
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user