Why Ubuntu 16.04 C++ program cannot programatically stop mono-service?

Frank Chang frankchang91 at gmail.com
Tue May 17 14:26:40 UTC 2016


Hi Karl,
         Your idea of a couple lines of shell script is great. However, my
manager wants me to write a C++ program to start the C# executable,
Audio_Recorder.exe, as a service and also create and write a log file in an
user-specified location. How might I do that? I tried char *argv[] =
{"/bin/sh", "mono-service.exe", "Audio_Recorder.exe", "--debug", ">&",
"log.txt",0) followed by execve(argv[0], &argv[0], envp) with no success.
       Quoting your previous email  "I'm not sure, but to use the ">"
syntax I think you may have to exec a shell, and pass the rest as a command
pipe for the shell to execute." How might I do that?
        Thank you again.
              Frank
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20160517/6643d13f/attachment.html>


More information about the ubuntu-users mailing list