-
Notifications
You must be signed in to change notification settings - Fork 302
fleetctl: check also systemd states after starting units #1566
fleetctl: check also systemd states after starting units #1566
Conversation
5496f06
to
ef054cf
Compare
Updated. (after several hiccups)
|
9fa71a3
to
ad33e13
Compare
ad33e13
to
6efb318
Compare
To resolve inconsistency between systemctl start and fleetctl start, fleetctl needs to check systemd states after starting units. If the systemd state is not a desired one, wait until it gets an active state. Fixes: coreos#1025
To cover the case of a new change for making sure that started units have active systemd states, CheckListUnits should also check the systemd unit state, after having started each unit.
6efb318
to
453e70a
Compare
14580b0
to
63b20dc
Compare
23d4b13
to
6fb1256
Compare
54409ab
to
a1a21b8
Compare
I'm going to merge it soon, unless anyone has other opinions. |
…state fleetctl: check also systemd states after starting units
// it just means that the unit test environment based on Travis is not capable | ||
// of setting up a DBUS connection of systemd, which would actually work fine | ||
// for production systems or functional tests. | ||
func tryWaitForSystemdActiveState(units []string) (ret int) { |
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.
imho the ret value is pretty unidiomatic; rather, return an error, and have the callers decide to log the error or not
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.
Agreed. I'll try to make it return an error.
} | ||
|
||
if found { | ||
err = nil |
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.
unnecessary
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.
Correct. I'll just remove err = nil
.
I think this is wrong; it's checking against a local systemd instance over dbus, but that will ONLY be right if |
@jonboulle Ok. I'll try to take a different approach as you suggested. From my understanding, |
Yep, that sounds about right! On 19 August 2016 at 10:28, Dongsu Park notifications@github.com wrote:
|
To resolve inconsistency between
"systemctl start"
and"fleetctl start"
, fleetctl needs to check systemd states after starting units. If the systemd state is not a desired one, wait until it gets an active state.Fixes: #1025