Skip to content

Commit

Permalink
Merge pull request #197 from imobach/fix-waiting-services-sle-12-ga
Browse files Browse the repository at this point in the history
Use /proc/uptime instead of system time while waiting for services restart
  • Loading branch information
imobachgs committed Mar 8, 2016
2 parents e32ca03 + 2ea095e commit b4fe206
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
7 changes: 7 additions & 0 deletions package/autoyast2.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Feb 24 16:36:20 UTC 2016 - igonzalezsosa@suse.com

- Check uptime instead of system time while waiting for systemd
services to be restarted (bsc#956730)
- 3.1.69.12

-------------------------------------------------------------------
Tue Feb 2 17:32:02 CET 2016 - schubi@suse.de

Expand Down
2 changes: 1 addition & 1 deletion package/autoyast2.spec
Expand Up @@ -17,7 +17,7 @@


Name: autoyast2
Version: 3.1.69.11
Version: 3.1.69.12
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
13 changes: 11 additions & 2 deletions src/clients/inst_autoconfigure.rb
Expand Up @@ -458,7 +458,7 @@ def wait_systemd_finished(max_wait, ser_ignore)
max_wait,
ser_ignore
)
st_time = Builtins.time
st_time = uptime
cur_time = st_time
last_busy = st_time
cmd = "systemctl --full list-jobs"
Expand All @@ -484,7 +484,7 @@ def wait_systemd_finished(max_wait, ser_ignore)
Builtins.y2milestone("size ll=%1 ll:%2", cnt, ll)
last_busy = cur_time if Ops.greater_than(cnt, 0)
Builtins.sleep(500)
cur_time = Builtins.time
cur_time = uptime
Builtins.y2milestone(
"wait_systemd_finished time:%1 idle:%2",
Ops.subtract(cur_time, st_time),
Expand All @@ -498,6 +498,15 @@ def wait_systemd_finished(max_wait, ser_ignore)

nil
end

private

# Determines the current uptime
#
# @return [Float] Current uptime in seconds
def uptime
Process.clock_gettime(Process::CLOCK_MONOTONIC)
end
end
end

Expand Down

0 comments on commit b4fe206

Please sign in to comment.