Skip to content

Commit f7f78b5

Browse files
committed
Daemon - reset prior to recent Windows changes
1 parent a148eed commit f7f78b5

File tree

1 file changed

+14
-40
lines changed

1 file changed

+14
-40
lines changed

app/server/ruby/bin/daemon.rb

Lines changed: 14 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ class SpiderBooter < ProcessBooter
898898
def initialize(ports, token)
899899
args = [
900900
"--enable-frozen-string-literal", "-E", "utf-8", "--yjit",
901-
File.expand_path(Paths.spider_server_path),
901+
Paths.spider_server_path,
902902
"-u",
903903
ports["spider-listen-to-gui"],
904904
ports["spider-send-to-gui"],
@@ -910,7 +910,7 @@ def initialize(ports, token)
910910
token
911911
]
912912

913-
super(File.expand_path(Paths.ruby_path), args, File.expand_path(Paths.spider_log_path))
913+
super(Paths.ruby_path, args, Paths.spider_log_path)
914914
end
915915
end
916916

@@ -924,7 +924,7 @@ def initialize(ports, kill_switch, token)
924924
@pid_requester = SonicPi::OSC::UDPClient.new('localhost', ports["tau"])
925925

926926
@pid_updater_thread = Thread.new do
927-
while !@tau_pid.delivered? && process_running?
927+
while !@tau_pid.delivered?
928928
Util.log "Requesting tau send us its pid. Sending /send-pid-to-daemon"
929929
begin
930930
@pid_requester.send("/send-pid-to-daemon", token)
@@ -968,35 +968,23 @@ def initialize(ports, kill_switch, token)
968968
ENV["TAU_ENV"] = "#{ENV["SONIC_PI_ENV"] || unified_opts[:env] || "prod"}"
969969
ENV["MIX_ENV"] = ENV["TAU_ENV"]
970970
ENV["TAU_PHX_PORT"] = "#{@phx_port}"
971-
972-
if Util.os == :windows
973-
ENV["TAU_LOG_PATH"] = File.expand_path(Paths.tau_log_path).gsub('/', '\\')
974-
ENV["TAU_BOOT_LOG_PATH"] = File.expand_path(Paths.tau_boot_log_path).gsub('/', '\\')
975-
else
976-
ENV["TAU_LOG_PATH"] = "#{Paths.tau_log_path}"
977-
ENV["TAU_BOOT_LOG_PATH"] = "#{Paths.tau_boot_log_path}"
978-
end
971+
ENV["TAU_LOG_PATH"] = "#{Paths.tau_log_path}"
972+
ENV["TAU_BOOT_LOG_PATH"] = "#{Paths.tau_boot_log_path}"
979973

980974
if Util.os == :windows
981975
if ENV["TAU_ENV"] == "prod"
982-
ENV["RELEASE_SYS_CONFIG"] = File.expand_path(Paths.tau_release_sys_config_path).gsub('/', '\\')
983-
ENV["RELEASE_ROOT"] = File.expand_path(Paths.tau_release_root).gsub('/', '\\')
984-
ENV["TAU_LOG_PATH"] = File.expand_path(Paths.tau_log_path).gsub('/', '\\')
985-
ENV["TAU_BOOT_LOG_PATH"] = File.expand_path(Paths.tau_boot_log_path).gsub('/', '\\')
986-
987-
cmd = File.expand_path(Paths.tau_release_erl_bin_path)
988-
989-
args = ["-config", File.expand_path(Paths.tau_release_sys_path),
990-
"-boot", File.expand_path(Paths.tau_release_start_path),
991-
"-boot_var", "RELEASE_LIB", File.expand_path(Paths.tau_release_lib_path),
992-
"-args_file", File.expand_path(Paths.tau_release_vm_args_path),
976+
ENV["RELEASE_SYS_CONFIG"] = "#{Paths.tau_release_sys_config_path}"
977+
ENV["RELEASE_ROOT"] = "#{Paths.tau_release_root}"
978+
979+
cmd = "#{Paths.tau_release_erl_bin_path}".gsub('/', '\\')
980+
args = ["-config", "#{Paths.tau_release_sys_path}".gsub('/', "\\"),
981+
"-boot", "#{Paths.tau_release_start_path}".gsub('/', "\\"),
982+
"-boot_var", "RELEASE_LIB", "#{Paths.tau_release_lib_path}".gsub('/', "\\"),
983+
"-args_file", "#{Paths.tau_release_vm_args_path}".gsub('/', "\\"),
993984
"-noshell",
994985
"-s", "elixir", "start_cli",
995986
"-mode", "embedded",
996987
"-extra", "--no-halt"]
997-
998-
Util.log "Windows Tau boot command: #{cmd}"
999-
Util.log "Windows Tau boot args: #{args.inspect}"
1000988
else
1001989
cmd = Paths.tau_boot_path
1002990
args = []
@@ -1006,21 +994,7 @@ def initialize(ports, kill_switch, token)
1006994
args = [Paths.tau_boot_path]
1007995
end
1008996

1009-
# Start without internal log recording
1010997
super(cmd, args, Paths.tau_boot_log_path)
1011-
1012-
enable_internal_log_recording!
1013-
1014-
1015-
sleep 2
1016-
# Check if process exited immediately
1017-
unless process_running?
1018-
Util.log "Tau process exited immediately. Exit status: #{@wait_thr.value.exitstatus if @wait_thr}"
1019-
Util.log "Tau output: #{@log}" if @log && !@log.empty?
1020-
raise "Tau failed to start - process exited immediately"
1021-
end
1022-
1023-
disable_internal_log_recording!
1024998
end
1025999

10261000
def restart!
@@ -1208,7 +1182,7 @@ def initialize(ports, no_scsynth_inputs=false)
12081182
args << "-H" << sound_card_name
12091183
end
12101184

1211-
cmd = File.expand_path(Paths.scsynth_path)
1185+
cmd = Paths.scsynth_path
12121186

12131187
case Util.os
12141188
when :linux, :raspberry

0 commit comments

Comments
 (0)