0

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
        }
  • Does this answer your question? [run a shell script and immediately background it, however keep the ability to inspect its output](https://stackoverflow.com/questions/44222883/run-a-shell-script-and-immediately-background-it-however-keep-the-ability-to-in) – MindSwipe Jul 09 '20 at 11:49
  • & does't help, nohup whatevercommandyouwant whateverparameters & too – Thoughtful Perch Jul 09 '20 at 12:21

0 Answers0