botiasloop 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/botiasloop/systemd_service.rb +12 -19
- data/lib/botiasloop/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dbb8e390c2b92efbef4ef3dc885ee7be2725dbb0e19736b2a594b228426dff42
|
|
4
|
+
data.tar.gz: 0ae9c7ee8516368ca84a3834219abca4e249bb96b255906f51ab8f92d250af7c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4cff18b6b793a684001b9d912de2df8a8fbb323ced49232bd871b6fef9498828b744229314a62a4c023b5494c203e8d7ed70c67b702197bc83e6846106ec81e0
|
|
7
|
+
data.tar.gz: 23c31635ff9ef00d1652a79b0cb3ad83bf08f5aa7ebf83d34ac5a99c6890502674562c912199ba83f0347fa019cfa29ada1ad0cd305b833b601abdb321487efe
|
|
@@ -235,6 +235,17 @@ module Botiasloop
|
|
|
235
235
|
File.join(systemd_user_dir, SERVICE_NAME)
|
|
236
236
|
end
|
|
237
237
|
|
|
238
|
+
# Get the botiasloop binary path for ExecStart
|
|
239
|
+
#
|
|
240
|
+
# @return [String] Path to botiasloop binary
|
|
241
|
+
def binary_path
|
|
242
|
+
ENV["PATH"].split(":").each do |dir|
|
|
243
|
+
path = File.join(dir, "botiasloop")
|
|
244
|
+
return path if File.executable?(path)
|
|
245
|
+
end
|
|
246
|
+
raise SystemdError, "botiasloop not found in PATH"
|
|
247
|
+
end
|
|
248
|
+
|
|
238
249
|
# Generate the service file content
|
|
239
250
|
#
|
|
240
251
|
# @return [String] systemd service unit content
|
|
@@ -247,35 +258,17 @@ module Botiasloop
|
|
|
247
258
|
|
|
248
259
|
[Service]
|
|
249
260
|
Type=simple
|
|
250
|
-
ExecStart=#{
|
|
261
|
+
ExecStart=#{binary_path} gateway
|
|
251
262
|
Restart=on-failure
|
|
252
263
|
RestartSec=5
|
|
253
264
|
StandardOutput=journal
|
|
254
265
|
StandardError=journal
|
|
255
|
-
Environment="PATH=#{ruby_bin_path}:/usr/local/bin:/usr/bin:/bin"
|
|
256
266
|
|
|
257
267
|
[Install]
|
|
258
268
|
WantedBy=default.target
|
|
259
269
|
SERVICE
|
|
260
270
|
end
|
|
261
271
|
|
|
262
|
-
# Get the path to the botiasloop executable
|
|
263
|
-
#
|
|
264
|
-
# @return [String] Path to botiasloop binary
|
|
265
|
-
def executable_path
|
|
266
|
-
Gem.bin_path("botiasloop", "botiasloop")
|
|
267
|
-
rescue Gem::Exception
|
|
268
|
-
# Fallback to searching in PATH
|
|
269
|
-
`which botiasloop 2>/dev/null`.strip
|
|
270
|
-
end
|
|
271
|
-
|
|
272
|
-
# Get the Ruby bin directory for PATH
|
|
273
|
-
#
|
|
274
|
-
# @return [String] Path to Ruby bin directory
|
|
275
|
-
def ruby_bin_path
|
|
276
|
-
File.dirname(RbConfig.ruby)
|
|
277
|
-
end
|
|
278
|
-
|
|
279
272
|
# Execute a systemctl command
|
|
280
273
|
#
|
|
281
274
|
# @param args [Array<String>] Arguments to pass to systemctl
|
data/lib/botiasloop/version.rb
CHANGED