-
Notifications
You must be signed in to change notification settings - Fork 98
Pause After Service Start During Upgrade #259
Conversation
@@ -161,6 +161,16 @@ fi | |||
echo "Restarting Home Assistant" | |||
systemctl restart home-assistant@homeassistant.service | |||
|
|||
echo "Waiting for Home Assistant to start" | |||
for i in 1 2 3 4 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i appears unused. Verify it or export it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i is indeed unused,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you change it to for i in 1 1 1 1 1
you can use $i
as a param to sleep
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would resolve the stickler comment, but seems the tail wagging the dog a bit? Ive never written bash scripts, but think I prefer disagreeing with stickler and writing the for loop as Landrash suggested.. Again - newbie here, so whatever you guys think best.
do | ||
sleep 1 | ||
|
||
if [ $(systemctl is-active home-assistant@homeassistant.service) == "active" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quote this to prevent word splitting.
@@ -161,6 +161,16 @@ fi | |||
echo "Restarting Home Assistant" | |||
systemctl restart home-assistant@homeassistant.service | |||
|
|||
echo "Waiting for Home Assistant to start" | |||
for i in 1 2 3 4 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a tad cleaner since it's a more common for a common loop.
for i in {1..5}
do
sleep 1s
if [ $(systemctl is-active home-assistant@homeassistant.service) == "active" ]; then
break
fi
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks - old C programmers first simple shell script. Will update.
@@ -161,6 +161,15 @@ fi | |||
echo "Restarting Home Assistant" | |||
systemctl restart home-assistant@homeassistant.service | |||
|
|||
echo "Waiting for Home Assistant to start" | |||
for i in {1..5} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i appears unused. Verify it or export it.
A similar thing was added in #268 |
Description:
Fix erroneous "Upgrade Failed" message by adding a pause after restarting the service to make sure the "pgrep -x hass" has time to get a Process ID
Related issue (if applicable): Fixes #
Checklist (Required):
If pertinent:
/docs