class Obsctl::Service::ServiceInstaller

Overview

Installs and controls the obsctl systemd user service.

Defined in:

obsctl/service/service_installer.cr

Constant Summary

VALID_ACTIONS = ["install", "uninstall", "status", "start", "stop", "restart"] of ::String

Constructors

Instance Method Summary

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.


[View source]

Instance Method Detail

def install : String #

Writes the service unit and reloads the user systemd manager.


[View source]
def run(action : String) : String #

Runs a service action such as install, start, status, or uninstall.


[View source]
def uninstall : String #

Removes the service unit when present and reloads the user systemd manager.


[View source]