Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adapt services according to settings in roles
- Loading branch information
1 parent
bd0438c
commit 1394a38
Showing
6 changed files
with
73 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
require "installation/clients/services_finish" | ||
|
||
::Installation::Clients::ServicesFinish.run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
require "installation/finish_client" | ||
require "installation/services" | ||
|
||
module Installation | ||
module Clients | ||
class ServicesFinish < ::Installation::FinishClient | ||
def title | ||
textdomain "installation" | ||
_("Adapting system services ...") | ||
end | ||
|
||
def write | ||
::Installation::Services.write | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
require "yast" | ||
|
||
Yast.import 'SystemdService' | ||
|
||
module Installation | ||
# Represents services manipulation in installation. | ||
class Services | ||
class << self | ||
include Yast::Logger | ||
|
||
def enabled | ||
@enabled ||= [] | ||
@enabled | ||
end | ||
|
||
def enabled=(services) | ||
if !services.is_a?(::Array) | ||
raise ArgumentError, "Services#enabled= allows only Array as " \ | ||
"argument, not #{services.inspect}" | ||
end | ||
|
||
@enabled = services | ||
end | ||
|
||
def write | ||
enabled.each do |service| | ||
log.info "Enabling service #{service}" | ||
s = Yast::SystemdService.find!(service) | ||
s.enable | ||
end | ||
end | ||
end | ||
end | ||
end |