Class: AgentsControl::Service::Systemd
- Inherits:
-
Service
- Object
- Service
- AgentsControl::Service::Systemd
- Defined in:
- lib/agents_control/service.rb
Overview
Linux.
Instance Method Summary collapse
Instance Method Details
#install ⇒ Object
129 130 131 132 133 134 135 |
# File 'lib/agents_control/service.rb', line 129 def install write(path, unit) system("systemctl", "--user", "daemon-reload", out: File::NULL, err: File::NULL) system("systemctl", "--user", "enable", "--now", "agents-control", out: File::NULL, err: File::NULL) path end |
#installed? ⇒ Boolean
143 |
# File 'lib/agents_control/service.rb', line 143 def installed? = File.exist?(path) |
#log_path ⇒ Object
127 |
# File 'lib/agents_control/service.rb', line 127 def log_path = "journal" |
#path ⇒ Object
125 |
# File 'lib/agents_control/service.rb', line 125 def path = File.("~/.config/systemd/user/agents-control.service") |
#uninstall ⇒ Object
137 138 139 140 141 |
# File 'lib/agents_control/service.rb', line 137 def uninstall system("systemctl", "--user", "disable", "--now", "agents-control", out: File::NULL, err: File::NULL) FileUtils.rm_f(path) end |