bitsy-ai / printnanny-os

Image repository, change logs, and issue tracking for PrintNanny OS
GNU Affero General Public License v3.0
23 stars 2 forks source link

gstd pipelines do not exit cleanly when systemd service exits #232

Closed leigh-johnson closed 1 year ago

leigh-johnson commented 1 year ago

Describe the bug

Add a stop-pipelines command to stop pipelines, delete pipelines (free allocated buffer pools and device locks). https://developer.ridgerun.com/wiki/index.php/GStreamer_Daemon_-_Interacting_with_Pipelines#Delete_Pipelines

Without this, stopping gstd.service does not necessarily de-allocate v4l2 buffer pool.

leigh-johnson commented 1 year ago

:+1: LGTM, gstd.service is now loaded with a drop-in gst-exec-stop.conf

office-v0-6:~$ systemctl status gstd
● gstd.service - GStreamer Daemon
     Loaded: loaded (/lib/systemd/system/gstd.service; enabled; preset: enabled)
    Drop-In: /lib/systemd/system/gstd.service.d
             └─gst-exec-stop.conf

This conf fragment adds an ExecStop command:

office-v0-6:~$ cat /lib/systemd/system/gstd.service.d/gst-exec-stop.conf 
[Service]
ExecStop=/usr/bin/printnanny -v cam stop-pipelines --http-port="${GSTD_HTTP_PORT}"