Skip to content

Commit

Permalink
fixed date check in systemctl
Browse files Browse the repository at this point in the history
  • Loading branch information
cryi committed Jul 16, 2024
1 parent 6e64c4d commit 8041799
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/systemctl/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.6
0.2.7
4 changes: 2 additions & 2 deletions src/systemctl/systemctl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ function systemctl.get_service_status(serviceName, options)
assert(_exitcode == 0, "Failed to get service start timestamp")
local _started = type(_stdout) == "string" and _stdout:match("^ExecMainStartTimestamp=%s*(.-)%s*$")
-- adjust to UTC
local _proc = proc.spawn(options, "date", { "-u", "-d", tostring(_started), '+ExecMainStartTimestamp=%a %Y-%m-%d %H:%M:%S UTC' }, {stdio = { stdout = "pipe", stderr = "pipe" }, wait = true })
local _proc = proc.spawn("date", { "-u", "-d", tostring(_started), '+ExecMainStartTimestamp=%a %Y-%m-%d %H:%M:%S UTC' }, {stdio = { stdout = "pipe", stderr = "pipe" }, wait = true })
if not _proc then
error("Failed to execute date command")
end
Expand All @@ -239,7 +239,7 @@ function systemctl.get_service_status(serviceName, options)
end

---creates a systemctl object with options preset
---@param options SystemctlExecOptions
---@param cachedOptions SystemctlExecOptions
---@return table
function systemctl.with_options(cachedOptions)
local function patch_options(options)
Expand Down

0 comments on commit 8041799

Please sign in to comment.