slimtoolkit / slim

Slim(toolkit): Don't change anything in your container image and minify it by up to 30x (and for compiled languages even more) making it secure too! (free and open source)
Apache License 2.0
18.85k stars 702 forks source link

New sensor shutdown sequence #600

Closed iximiuz closed 8 months ago

iximiuz commented 8 months ago

A bunch of changes to the sensor shutdown sequence and the (new) control commands:

The change is needed to work around a deadlock situation caused by the sensor main loop (blockingly) invoking art_collector, which would also blockingly run the sensor control stop-target-app command, which in turn would become stuck waiting for the main loop to terminate the target app.

The proposed usage now looks like this:

<start the instrumented container>
sensor control-stop-target-app                            # non-blocking
sensor control wait-for-event event.sensor.shutdown.done  # optional,blocking
docker stop <instrumented container>                      # or the like