| # 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 "Chrome OS post-mount-encrypted cleanup" |
| author "chromium-os-dev@chromium.org" |
| |
| # This job handles delayed copying of the mount-encrypted log file into |
| # /var/log. Since mount-encrypted forks a filesystem resizing process |
| # into the background, give it a chance to at least start running before |
| # copying the log. Waiting until after system-services seems sufficient, |
| # and additionally does not add any delay to chromeos_startup itself. |
| start on started system-services |
| |
| script |
| # Copy the log (not through symlinks), and retain permissions but use |
| # the default SELinux label for the target. The target should always |
| # be removed since we don't want to follow symlinks on the target. |
| # Use a trailing slash to require that "log" is a directory. |
| cp -aPZ --remove-destination /run/mount_encrypted/mount-encrypted.log \ |
| /var/log/ || true |
| |
| # Dump the log in syslog to preserve mount-encrypted info over reboots. |
| logger -t mount-encrypted -f /var/log/mount-encrypted.log || true |
| end script |