#!/usr/bin/execlineb -P

# Check if the system-probe exists before running it
ifelse -n
    { s6-test -x "/opt/datadog-agent/embedded/bin/system-probe" }
    {
        foreground { /initlog.sh "system-probe not bundled, disabling" }
        foreground { /bin/s6-svc -d /var/run/s6/services/sysprobe/ }
    }
    foreground { /initlog.sh "starting system-probe" }
    system-probe --config=/etc/datadog-agent/system-probe.yaml
