| OLD | NEW |
| 1 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 description "Chrome OS factory startup stub" | 5 description "Chrome OS factory startup stub" |
| 6 author "chromium-os-dev@chromium.org" | 6 author "chromium-os-dev@chromium.org" |
| 7 | 7 |
| 8 start on stopped udev-addon | 8 start on stopped udev-addon |
| 9 stop on starting halt or starting reboot | 9 stop on starting halt or starting reboot |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 fi | 22 fi |
| 23 FACTORY_LOG_FILE=/var/log/factory.log | 23 FACTORY_LOG_FILE=/var/log/factory.log |
| 24 CONSOLE_LOG_FILE=/var/log/factory_console.log | 24 CONSOLE_LOG_FILE=/var/log/factory_console.log |
| 25 # Factory log will be uploaded so we must always preserve previous results. | 25 # Factory log will be uploaded so we must always preserve previous results. |
| 26 # Console log is just for UI to display, no need to be saved across sessions; | 26 # Console log is just for UI to display, no need to be saved across sessions; |
| 27 # however in order to support writing by multiple processes, the file must be | 27 # however in order to support writing by multiple processes, the file must be |
| 28 # opened in "append" mode. So we must first delete it then use >> to append. | 28 # opened in "append" mode. So we must first delete it then use >> to append. |
| 29 rm -f "$CONSOLE_LOG_FILE" | 29 rm -f "$CONSOLE_LOG_FILE" |
| 30 ./bin/autotest -t factory $OPT control 2>&1 | | 30 ./bin/autotest -t factory $OPT control 2>&1 | |
| 31 tee -a "$FACTORY_LOG_FILE" | | 31 tee -a "$FACTORY_LOG_FILE" | |
| 32 grep --line-buffer "FACTORY" >>"$CONSOLE_LOG_FILE" | 32 grep --line-buffer "FACTORY" | |
| 33 sed -u 's/^\([0-9:]*\) ERROR| FACTORY: /\1 | /' >>"$CONSOLE_LOG_FILE" |
| 33 end script | 34 end script |
| 34 | 35 |
| 35 pre-stop script | 36 pre-stop script |
| 36 pkill python | 37 pkill python |
| 37 pkill X | 38 pkill X |
| 38 end script | 39 end script |
| OLD | NEW |