fix(tools): log websockify output

main
Tsu-ba-me 9 months ago
parent 41aba69a5a
commit 5d086f5e79
  1. 1
      Anvil/Tools.pm
  2. 6
      tools/anvil-manage-vnc-pipe

@ -1121,6 +1121,7 @@ sub _set_paths
ifcfg => "/etc/sysconfig/network-scripts", ifcfg => "/etc/sysconfig/network-scripts",
journald => "/var/log/journal", journald => "/var/log/journal",
libvirtd_definitions => "/etc/libvirt/qemu/", libvirtd_definitions => "/etc/libvirt/qemu/",
'log' => "/var/log",
NetworkManager => "/etc/NetworkManager/", NetworkManager => "/etc/NetworkManager/",
opt_alteeve => "/opt/alteeve", opt_alteeve => "/opt/alteeve",
pgsql => "/var/lib/pgsql/", pgsql => "/var/lib/pgsql/",

@ -227,7 +227,7 @@ sub find_ws_processes
$anvil->Log->variables({ source => $THIS_FILE, line => __LINE__, level => $debug, list => $parameters, prefix => "find_ws_processes" }); $anvil->Log->variables({ source => $THIS_FILE, line => __LINE__, level => $debug, list => $parameters, prefix => "find_ws_processes" });
my $ps_call = "$pgrep -a '$ps_name' | $sed -En 's/^([[:digit:]]+).*${ps_name}([[:space:]]+(--?[^[:space:]]+))*[[:space:]:]+([[:digit:]]+)[[:space:]:]+([[:digit:]]+).*\$/\\1,\\4,\\5/p'"; my $ps_call = "$pgrep -a '$ps_name' | $sed -En 's/^([[:digit:]]+).*${ps_name}.*[[:space:]:]+([[:digit:]]+)[[:space:]:]+([[:digit:]]+).*\$/\\1,\\2,\\3/p'";
my ($rcode, $output) = call({ call => $ps_call, debug => $debug }); my ($rcode, $output) = call({ call => $ps_call, debug => $debug });
@ -431,9 +431,11 @@ sub start_ws
return ($rcode) if ($rcode); return ($rcode) if ($rcode);
my $ws_log = $anvil->data->{path}{directories}{log}."/anvil-ws-".$ws_sport."-".$svr_vnc_port.".log";
# The daemon wrapper can tell us whether the daemon started correctly; # The daemon wrapper can tell us whether the daemon started correctly;
# we won't know this if the process is started in the background. # we won't know this if the process is started in the background.
my $ws_call = "$websockify -D $ws_sport :$svr_vnc_port &>/dev/null"; my $ws_call = $websockify." -D --log-file '".$ws_log."' ".$ws_sport." :".$svr_vnc_port;
($rcode) = call({ call => $ws_call, debug => $debug }); ($rcode) = call({ call => $ws_call, debug => $debug });

Loading…
Cancel
Save