Try fix
This commit is contained in:
parent
0677fe39dd
commit
ddec7ebe50
@ -79,6 +79,10 @@ in
|
|||||||
SYSTANT_PUBLISH_INTERVAL = toString cfg.publishInterval;
|
SYSTANT_PUBLISH_INTERVAL = toString cfg.publishInterval;
|
||||||
# Override RELEASE_COOKIE to bypass file reading
|
# Override RELEASE_COOKIE to bypass file reading
|
||||||
RELEASE_COOKIE = "systant-bypass-cookie";
|
RELEASE_COOKIE = "systant-bypass-cookie";
|
||||||
|
# Set proper PATH for NixOS
|
||||||
|
PATH = "/run/current-system/sw/bin:/run/wrappers/bin:\${PATH}";
|
||||||
|
# Set log level to debug for troubleshooting
|
||||||
|
SYSTANT_LOG_LEVEL = "debug";
|
||||||
};
|
};
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
|
|||||||
@ -253,10 +253,18 @@ defmodule Systant.CommandExecutor do
|
|||||||
env = build_command_environment()
|
env = build_command_environment()
|
||||||
|
|
||||||
Logger.info("Executing system command: #{inspect(final_command)} (timeout: #{timeout}ms)")
|
Logger.info("Executing system command: #{inspect(final_command)} (timeout: #{timeout}ms)")
|
||||||
|
Logger.debug("Environment PATH: #{Map.get(env, "PATH")}")
|
||||||
|
Logger.debug("Environment USER: #{Map.get(env, "USER")}")
|
||||||
|
Logger.debug("Environment HOME: #{Map.get(env, "HOME")}")
|
||||||
|
Logger.debug("Environment XDG_RUNTIME_DIR: #{Map.get(env, "XDG_RUNTIME_DIR")}")
|
||||||
|
|
||||||
try do
|
try do
|
||||||
case System.cmd(List.first(final_command), Enum.drop(final_command, 1),
|
task = Task.async(fn ->
|
||||||
stderr_to_stdout: true, timeout: timeout, env: env) do
|
System.cmd(List.first(final_command), Enum.drop(final_command, 1),
|
||||||
|
stderr_to_stdout: true, env: env)
|
||||||
|
end)
|
||||||
|
|
||||||
|
case Task.await(task, timeout) do
|
||||||
{output, 0} ->
|
{output, 0} ->
|
||||||
execution_time = System.monotonic_time(:millisecond) - start_time
|
execution_time = System.monotonic_time(:millisecond) - start_time
|
||||||
Logger.info("Command completed successfully in #{execution_time}ms")
|
Logger.info("Command completed successfully in #{execution_time}ms")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user