I have web api core app on linux. After trigger this app starts console app that restarts web api core app, but when api stops, console app stops too. How to start console app without dependence. Code for start console
TerminalCommand.Start($"cd /home/pi/Console && " +
"sudo chmod 777 ./Console && " +
"sudo ./Console");
public static string Start(string command, bool checkComplete = false)
{
if (checkComplete) command = string.Join(" ; ", command, "echo $?");
var process = new Process
{
StartInfo =
{
FileName = "/bin/bash",
Arguments = $"-c \"{command}\"",
RedirectStandardOutput = true,
UseShellExecute = false,
CreateNoWindow = true
}
};
process.Start();
var strOutput = process.StandardOutput.ReadToEnd();
return strOutput
}