-
Notifications
You must be signed in to change notification settings - Fork 230
USHIFT-2992: Image builder cleanup: don't stop osbuild-composer.socket #3271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,15 +59,17 @@ clean_osbuilder_services() { | |
| fi | ||
|
|
||
| title "Stopping osbuild services" | ||
| sudo systemctl stop --now osbuild-composer.socket osbuild-composer.service | ||
| for n in $(seq 100) ; do | ||
| worker=osbuild-worker@${n}.service | ||
| if sudo systemctl status "${worker}" &>/dev/null ; then | ||
| sudo systemctl stop --now "osbuild-worker@${n}.service" | ||
| sudo systemctl stop "osbuild-worker@${n}.service" | ||
| else | ||
| break | ||
| fi | ||
| done | ||
| # Don't stop the .socket as it can cause composer.service to fail | ||
| # stopping resulting in failed restarts which cause problem starting later. | ||
| sudo systemctl stop osbuild-composer.service | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add a comment about stopping osbuild-composer.socket here? |
||
|
|
||
| title "Cleaning osbuild worker cache" | ||
| sleep 5 | ||
|
|
@@ -79,19 +81,12 @@ restart_osbuilder_services() { | |
| return | ||
| fi | ||
|
|
||
| if ! systemctl is-active -q osbuild-composer.socket &>/dev/null ; then | ||
| if ! systemctl is-active -q osbuild-composer.service &>/dev/null ; then | ||
| title "Starting osbuild services" | ||
| sudo systemctl start osbuild-composer.socket | ||
| for try in $(seq 3); do | ||
| sleep 1 # Give composer some time to be ready for workers | ||
| if sudo systemctl start osbuild-worker@1.service; then | ||
| break | ||
| else | ||
| if [ "${try}" -eq 2 ]; then | ||
| return 1 | ||
| fi | ||
| fi | ||
| done | ||
| sudo systemctl start osbuild-worker@1.service | ||
| # Thanks to osbuild-composer.socket, starting worker should be enough | ||
| # to start the composer, but left it just in case. | ||
| sudo systemctl start osbuild-composer.service | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should the start order be inverted here as we're first stopping workers now?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually I found that we don't even need to start composer. Thanks to the socket, starting workers will cause composer to start but left it just in case
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add a comment about this? |
||
| fi | ||
| } | ||
|
|
||
|
|
||
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.
Why did we remove
--now? Does it have no effect during stop?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.
--nowis only meaningful forenableanddisableand results in immediate start (enable) and stop (disable)