| # Copyright (c) 2012 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. |
| |
| # modemmanager |
| # |
| # starts modemmanager once udev has been started. |
| |
| # Log level: ERR, WARN, INFO, DEBUG |
| env MM_LOGLEVEL=INFO |
| |
| import MM_LOGLEVEL |
| |
| start on starting system-services |
| stop on stopping system-services |
| |
| respawn |
| |
| # Keep track of the ModemManager process launched by minijail instead of the |
| # minijail process. minijail exits immediately after launching ModemManager. |
| expect fork |
| |
| pre-start script |
| case "${MM_LOGLEVEL}" in |
| DEBUG|INFO|WARN|ERR) |
| ;; |
| *) |
| logger -p err -t "${UPSTART_JOB}" "Unsupported log level: ${MM_LOGLEVEL}" |
| exit 1 |
| ;; |
| esac |
| end script |
| |
| # Run ModemManager under the 'modem' user/group. Keep the CAP_SYS_ADMIN |
| # capability to allow ModemManager to set 'closing_wait' to none on the modem |
| # serial port via ioctl(TIOCGSERIAL). Set NoNewPrivs. CAP_NET_ADMIN is needed to |
| # create net links for Qrtr devices. |
| # |
| # TODO(benchan): Refine the minijail sandbox to further constrain ModemManager. |
| exec minijail0 -u modem -g modem -c cap_net_admin,cap_sys_admin=e -n -i -- \ |
| /usr/sbin/ModemManager --log-level="${MM_LOGLEVEL}" |