Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust/share/dbus-test.conf
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<limit name="max_message_size">1000000000</limit>
<!-- We do not override max_message_unix_fds here since the in-kernel
limit is also relatively low -->
<limit name="service_start_timeout">120000</limit>
<limit name="service_start_timeout">600000</limit>
<limit name="auth_timeout">240000</limit>
<limit name="pending_fd_timeout">150000</limit>
<limit name="max_completed_connections">100000</limit>
Expand Down
6 changes: 4 additions & 2 deletions service/bin/agamactl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def logger_for(name)
formatter = Logger::Formatter.new # the default
else
# going via syslog which will provide time and progname already
formatter = ->(severity, _time, _progname, msg) { "#{severity}: #{msg}\n" }
formatter = ->(severity, _time, _progname, msg) { "[#{severity}]: #{name}: #{msg}\n" }
$stdout.sync = true
end

Expand All @@ -59,7 +59,9 @@ def start_service(name)
module_y2dir = File.expand_path("../lib/agama/dbus/y2dir/#{name}", __dir__)
ENV["Y2DIR"] = [ENV.fetch("Y2DIR", nil), module_y2dir, general_y2dir].compact.join(":")

service_runner = Agama::DBus::ServiceRunner.new(name, logger: logger_for(name))
logger = logger_for(name)
service_runner = Agama::DBus::ServiceRunner.new(name, logger: logger)
logger.info "Starting the service"
service_runner.run
end

Expand Down
1 change: 1 addition & 0 deletions service/lib/agama/manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def initialize(config, logger)
@installation_phase = InstallationPhase.new
@service_status_recorder = ServiceStatusRecorder.new
@service_status = DBus::ServiceStatus.new.busy
on_progress_change { logger.info progress.to_s }
end

# Runs the startup phase
Expand Down
9 changes: 9 additions & 0 deletions service/lib/agama/progress.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,14 @@ def on_change(&block)
def on_finish(&block)
@on_finish_callbacks << block
end

# Returns a string-based representation of the progress
#
# @return [String]
def to_s
return "Finished" if finished?

"#{current_step.description} (#{@counter}/#{total_steps})"
end
end
end
1 change: 1 addition & 0 deletions service/lib/agama/software/manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def initialize(config, logger)
@config.pick_product(@product)
end
@repositories = RepositoriesManager.new
on_progress_change { logger.info progress.to_s }
end

def select_product(name)
Expand Down
1 change: 1 addition & 0 deletions service/lib/agama/storage/manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def initialize(config, logger)
@config = config
@logger = logger
register_proposal_callbacks
on_progress_change { logger.info progress.to_s }
end

# Whether the system is in a deprecated status
Expand Down
8 changes: 8 additions & 0 deletions service/package/rubygem-agama.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
-------------------------------------------------------------------
Fri Sep 1 07:32:59 UTC 2023 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

- Extend the Ruby-based services logs with information about
each step (gh#openSUSE/agama#732).
- Raise the D-Bus service start timeout for troubleshoting purposes
(related to bsc#1214737).

-------------------------------------------------------------------
Thu Aug 31 10:36:53 UTC 2023 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

Expand Down
2 changes: 1 addition & 1 deletion service/share/dbus.conf
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<limit name="max_message_size">1000000000</limit>
<!-- We do not override max_message_unix_fds here since the in-kernel
limit is also relatively low -->
<limit name="service_start_timeout">120000</limit>
<limit name="service_start_timeout">600000</limit>
<limit name="auth_timeout">240000</limit>
<limit name="pending_fd_timeout">150000</limit>
<limit name="max_completed_connections">100000</limit>
Expand Down
18 changes: 18 additions & 0 deletions service/test/agama/progress_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -227,4 +227,22 @@
end
end
end

describe "#to_s" do
let(:steps) { 2 }

before { subject.step("Probing software") }

it "returns the step description an the current/total steps" do
expect(subject.to_s).to eq("Probing software (1/2)")
end

context "when the progress is finished" do
before { subject.step("Probing storage") }

it "returns 'Finished' when the progress is finished" do
expect(subject.to_s).to eq("Finished")
end
end
end
end