<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi all,<div class=""><br class=""></div><div class="">I face a strange issue about pipeline stopping and cleanup afterwards(<span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">I'm running my pipelines on NVidia Jetson Nano as systemd service. </span>). If use the:</div><div class=""><br class=""></div><div class="">systemctl stop myservice</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">I see the following messages in the <span style="color: rgb(0, 0, 0); font-family: Menlo; font-size: 11px;" class="">nvargus-daemon </span>log:</div><div class=""><br class=""></div><div class=""><div class="">may 27 22:18:02 devhost nvargus-daemon[7110]: === gst-launch-1.0[7064]: Connection closed (7FB0DA91D0)=== gst-launch-1.0[7064]: WARNING: CameraProvider was not destroyed before client connection terminated.=== gst-launch-1.0[7064]:          The client may have abnormally terminated. Destroying CameraProvider...=== gst-launch-1.0[7064]: CameraProvider destroyed (0x7facb8dee0)=== gst-launch-1.0[7064]: WARNING: Cleaning up 1 outstanding requests...=== gst-launch-1.0[7064]: WARNING: Cleaning up 1 outstanding streams...SCF: Error InvalidState: 5 buffers still pending during EGLStreamProducer destruction (propagating from src/services/gl/EGLStreamProducer.cpp, function freeBuffers(), line 306)</div><div class="">may 27 22:18:02 devhost nvargus-daemon[7110]: SCF: Error InvalidState:  (propagating from src/services/gl/EGLStreamProducer.cpp, function ~EGLStreamProducer(), line 50)</div><div class="">may 27 22:18:02 devhost nvargus-daemon[7110]: === gst-launch-1.0[7064]: WARNING: Cleaning up 1 outstanding stream settings...=== gst-launch-1.0[7064]: WARNING: Cleaning up 1 outstanding sessions...(NvCameraUtils) Error InvalidState: Mutex not initialized (/dvs/git/dirty/git-master_linux/camera/core_scf/src/services/gl/EGLStreamProducer.cpp:498) (in Mutex.cpp, function lock(), line 79)</div><div class="">may 27 22:18:02 devhost nvargus-daemon[7110]: SCF: Error BadParameter: Buffer is not pending (in src/services/gl/EGLStreamProducer.cpp, function presentBufferInternal(), line 502)</div><div class="">may 27 22:18:02 devhost nvargus-daemon[7110]: (NvCameraUtils) Error InvalidState: Mutex has not been initialized (in Mutex.cpp, function unlock(), line 88)</div></div><div class=""><br class=""></div><div class="">So the connection was not cleaned up, which caused if the pipeline was not stopped properly.</div><div class=""><br class=""></div><div class="">The strange thing is if I run the pipeline directly from the terminal and hit Ctrl-C the cleanup is done and I don't get any error messages.</div><div class="">The cleanup is also fine when I send the SIGINT signal to the process directly:</div><div class="">kill -2 <PID></div><div class=""><br class=""></div><div class="">But if I try to automate this by adding:</div><div class="">ExecStop=/bin/kill -2 -$MAINPID </div><div class=""><br class=""></div><div class="">Or even to get the PID from 'ps' output:</div><div class="">kill -2 $( ps aux | grep myscript.sh | grep "sensor-id=0" | awk '{print $2}')</div><div class=""><br class=""></div><div class="">The cleanup not happens and the <span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Menlo; font-size: 11px;" class="">nvargus-daemon</span> has to be restarted. (I even tried to move this stopping logic to separate script and call that from the ExecStop but its still not ok).</div><div class=""><br class=""></div><div class="">So it seem like that is connected somehow to the systemd service, if I use the standart stop/restart commands the connections are not cleaned up.</div><div class=""><br class=""></div><div class="">Do you have any idea what can be behind this? What am I doing wrong?</div><div class=""><br class=""></div><div class="">Thanks!</div><div class=""><br class=""></div><div class="">Bests,</div><div class="">Peter</div><div class=""><br class=""></div><div class=""><br class=""></div></body></html>