class
Obsctl::Service::ServiceInstaller
- Obsctl::Service::ServiceInstaller
- Reference
- Object
Overview
Installs and controls the obsctl systemd user service.
Defined in:
obsctl/service/service_installer.crConstant Summary
-
VALID_ACTIONS =
["install", "uninstall", "status", "start", "stop", "restart"] of ::String
Constructors
-
.new(service_path : String = SystemdUserService.default_path, executable_path : String = default_executable_path, runner : SystemCommandRunner = SystemCommandRunner.new)
Creates a service installer with injectable paths and command runner for tests.
Instance Method Summary
-
#install : String
Writes the service unit and reloads the user systemd manager.
-
#run(action : String) : String
Runs a service action such as install, start, status, or uninstall.
-
#uninstall : String
Removes the service unit when present and reloads the user systemd manager.
Constructor Detail
def self.new(service_path : String = SystemdUserService.default_path, executable_path : String = default_executable_path, runner : SystemCommandRunner = SystemCommandRunner.new)
#
Creates a service installer with injectable paths and command runner for tests.
Instance Method Detail
def run(action : String) : String
#
Runs a service action such as install, start, status, or uninstall.
def uninstall : String
#
Removes the service unit when present and reloads the user systemd manager.