<div dir="ltr"><div><div><div><div><div><div><div><div>Hi Karl,<br></div>    Thank you for your excellent solution to the pkill problem<br></div>where we use the fact that mono-service sets a  process ID<br></div>in the lockfile.<br>  <br></div>    But when I do this, Stopping process message does not<br></div>show in tail -f  /var/log/syslog output. Is it possible to fix that?<br><br></div>    Also, when we start in the mono-service mode on Ubuntu Linux 16.04 , we would like to create<br></div>and store a log file at wherever the user wants. I tried this URL,<br><a href="http://stackoverflow.com/questions/11024474/capture-mono-service-stdout-console-output">stackoverflow.com/questions/11024474/capture-mono-service-stdout-console-output</a><br><br></div>where it says do this: <br><pre><code>mono-service2 myservice.exe -l:/var/run/test --debug > log.txt<br><br></code></pre><pre><code>which does not work when I test the following C++ program:<br><br>include <unistd.h>     // execv(), fork()<br>#include <sys/types.h>  // pid_t<br>#include <sys/wait.h>   // waitpid()<br>#include <stdio.h><br><br>int main(int argc, char* argvp)<br>{<br>   char *argv[] = { "/usr/lib/mono/4.5/mono-service.exe", <br>                    "Audio_Video_Recorder.exe", "--debug", ">&", "./LOGCamster.txt", 0};<br> <br> <br>    char *envp[] =<br>    {<br>        "LD_LIBRARY_PATH=.",<br>        0<br>    };<br>    execve(argv[0], &argv[0], envp);<br>    fprintf(stderr, "Oops!\n");<br>    return -1;<br><br>}<br><br></code></pre><pre><code>because I observe no log file being created. How could I fix<br></code></pre><pre><code>this error?<br><br><br></code></pre><pre><code>Any help is greatly appreciated.<br></code></pre><pre><code>Thank you.<br></code></pre><pre><code>       Frank<br></code></pre></div>