| # 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. |
| |
| description "Extract Chrome OS machine info for Enterprise enrollment" |
| author "chromium-os-dev@chromium.org" |
| |
| # /tmp/machine-info contains the serial number and other information that may |
| # identify the device. This information is required by OOBE and enterprise |
| # enrollment, and as of Chrome OS 58, we display it on the login screen. |
| # On the other hand, we don't want it around after login for privacy reasons. |
| # That's why /tmp/machine-info is removed on the start-user-session signal. |
| |
| # This starts every time the UI (re)starts in order to restore |
| # /tmp/machine-info if needed. |
| start on starting ui |
| |
| # Remove /tmp/machine-info when a user logs in, in which case session_manager |
| # emits the start-user-session signal. Also stop when the ui terminates so |
| # restarts of the ui job trigger a full stop/start cycle. |
| stop on start-user-session or stopping ui |
| |
| env MACHINE_INFO=/tmp/machine-info |
| |
| # This is a pre-start so that this task will run before the "start" stanza |
| # of the ui job. |
| pre-start exec /usr/share/cros/init/write-machine-info |
| |
| post-stop exec rm -f $MACHINE_INFO |