| OLD | NEW |
| 1 #!/bin/sh | 1 #!/bin/sh |
| 2 | 2 |
| 3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 # Shutdown is best-effort. We don't want to die on errors. | 7 # Shutdown is best-effort. We don't want to die on errors. |
| 8 set +e | 8 set +e |
| 9 | 9 |
| 10 # Measure shutdown time. /var/log/metrics is created by chromeos_startup. | 10 # Measure shutdown time. /var/log/metrics is created by chromeos_startup. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 # TODO: swapoff as necessary. | 23 # TODO: swapoff as necessary. |
| 24 | 24 |
| 25 # Kill any that may prevent us from unmounting the stateful partition | 25 # Kill any that may prevent us from unmounting the stateful partition |
| 26 # or the crypto-home and then unmount. These should be all that we need | 26 # or the crypto-home and then unmount. These should be all that we need |
| 27 # to unmount for a clean shutdown. | 27 # to unmount for a clean shutdown. |
| 28 kill_with_open_files_on /mnt/stateful_partition /home/chronos | 28 kill_with_open_files_on /mnt/stateful_partition /home/chronos |
| 29 | 29 |
| 30 # Unmount our stateful mount points. If any of these fail we do a best-effort | 30 # Unmount our stateful mount points. If any of these fail we do a best-effort |
| 31 # attempt to touch a /var/log file for future inspection. | 31 # attempt to touch a /var/log file for future inspection. |
| 32 /usr/sbin/umount.cryptohome | 32 /usr/sbin/cryptohome --action=unmount |
| 33 if [ $? -ne 0 ] ; then | 33 if [ $? -ne 0 ] ; then |
| 34 mount > /var/log/shutdown_cryptohome_umount_failure | 34 mount > /var/log/shutdown_cryptohome_umount_failure |
| 35 fi | 35 fi |
| 36 | 36 |
| 37 # join hwclock setting, already in progress. If the job has already been | 37 # join hwclock setting, already in progress. If the job has already been |
| 38 # finished and reaped, we need to suppress error output. It seems that anything | 38 # finished and reaped, we need to suppress error output. It seems that anything |
| 39 # on stderr will make the shutdown appear "unclean" from the POV of upstart. | 39 # on stderr will make the shutdown appear "unclean" from the POV of upstart. |
| 40 (fg ${HWCLOCK} || /bin/true) 2> /dev/null | 40 (fg ${HWCLOCK} || /bin/true) 2> /dev/null |
| 41 | 41 |
| 42 # Measure shutdown time | 42 # Measure shutdown time |
| (...skipping 10 matching lines...) Expand all Loading... |
| 53 if [ $? -ne 0 ] ; then | 53 if [ $? -ne 0 ] ; then |
| 54 mount > /mnt/stateful_partition/var/log/shutdown_stateful_umount_failure | 54 mount > /mnt/stateful_partition/var/log/shutdown_stateful_umount_failure |
| 55 mount > /var/log/shutdown_stateful_umount_failure | 55 mount > /var/log/shutdown_stateful_umount_failure |
| 56 fi | 56 fi |
| 57 | 57 |
| 58 # Just in case something didn't unmount properly above. | 58 # Just in case something didn't unmount properly above. |
| 59 sync | 59 sync |
| 60 | 60 |
| 61 # Ensure that we always claim success. | 61 # Ensure that we always claim success. |
| 62 exit 0 | 62 exit 0 |
| OLD | NEW |