| # Copyright 2018 The Chromium OS Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| description "Chrome OS Runtime Probe service" |
| author "chromium-os-dev@chromium.org" |
| |
| # This daemon is started by D-Bus service activation configured in |
| # dbus/org.chromium.RuntimeProbe.service. |
| stop on stopping system-services |
| expect fork |
| |
| script |
| # Check if the device node to mount exists. |
| set -- |
| if [ -e /dev/cros_ec ]; then |
| set -- "$@" -b /dev/cros_ec |
| fi |
| |
| exec minijail0 -i -e -p -r -v -l --uts -n \ |
| -u runtime_probe -g runtime_probe -G \ |
| --profile=minimalistic-mountns \ |
| -k 'tmpfs,/run,tmpfs,MS_NODEV|MS_NOEXEC|MS_NOSUID,mode=755,size=10M' \ |
| -b /run/dbus,,1 \ |
| -b /sys \ |
| "$@" \ |
| -S /usr/share/policy/runtime_probe-seccomp.policy \ |
| -- /usr/bin/runtime_probe --dbus --debug |
| end script |
| # Wait for daemon to claim its D-Bus name before transitioning to started. |
| post-start exec minijail0 -u runtime_probe -g runtime_probe /usr/bin/gdbus \ |
| wait --system --timeout 15 org.chromium.RuntimeProbe |