| # Copyright 2019 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 "Daemon providing eSIM support" |
| author "chromium-os-dev@chromium.org" |
| |
| env LOG_LEVEL=0 |
| import LOG_LEVEL |
| |
| start on started network-services |
| stop on starting pre-shutdown |
| expect fork |
| respawn |
| # if the job respawns 3 times in 10 seconds, stop trying. |
| respawn limit 3 10 |
| # Do not respawn if we exited on purpose (e.g. service disabled). |
| normal exit 0 |
| |
| pre-start script |
| case "${LOG_LEVEL}" in |
| -3|-2|-1|0|1|2) |
| ;; |
| *) |
| logger -p err -t "${UPSTART_JOB}" "Unsupported log level: ${LOG_LEVEL}" |
| exit 1 |
| ;; |
| esac |
| end script |
| |
| # List of provided args in order: |
| # - Run as hermes user and group. |
| # - Inherit supplementary groups from user hermes. |
| # - Set no_new_privs. |
| exec minijail0 \ |
| -u hermes -g hermes \ |
| -G \ |
| -n \ |
| -i \ |
| /usr/bin/hermes \ |
| --log_level="${LOG_LEVEL}" |