| # Copyright 2014 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 "Supplemental session_manager initialization after boot" |
| author "chromium-os-dev@chromium.org" |
| |
| # This job forwards machine information to session_manager over DBus. |
| # The data is used by session_manager eventually, but is not critical to |
| # starting the UI. |
| |
| # Machine information needs to be pushed to session_manager every time |
| # it starts. However, the data may not be available yet. In that case |
| # this job runs again after ui-collect-machine-info has collected the |
| # data. |
| start on login-prompt-visible or stopped ui-collect-machine-info |
| |
| env UI_MACHINE_INFO_FILE=/var/run/session_manager/machine-info |
| |
| script |
| # Bail out if data collection is still pending. |
| [ -e "${UI_MACHINE_INFO_FILE}" ] || exit 0 |
| |
| dbus-send --system --dest=org.chromium.SessionManager \ |
| --type=method_call /org/chromium/SessionManager \ |
| org.chromium.SessionManagerInterface.InitMachineInfo \ |
| string:"$(cat "${UI_MACHINE_INFO_FILE}")" || |
| logger -t "${UPSTART_JOB}" \ |
| "Failed to pass machine info to session_manager!" |
| end script |