Bertrand SIMONNET | 01ca1fb | 2014-03-04 10:06:26 -0800 | [diff] [blame^] | 1 | # Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | description "System software update service" |
| 6 | author "chromium-os-dev@chromium.org" |
| 7 | |
| 8 | # N.B. The chromeos-factoryinstall ebuild edits the 'start on' line so as |
| 9 | # to disable update_engine in factory images. Do not change this without |
| 10 | # also updating that reference. |
| 11 | start on starting system-services |
| 12 | stop on stopping system-services |
| 13 | respawn |
| 14 | |
| 15 | expect fork |
| 16 | |
| 17 | # Runs the daemon at low/idle IO priority so that updates don't |
| 18 | # impact system responsiveness. |
| 19 | exec ionice -c3 update_engine |
| 20 | |
| 21 | # Put update_engine process in its own cgroup. |
| 22 | # Default cpu.shares is 1024. |
| 23 | post-start script |
| 24 | cgroup_dir="/sys/fs/cgroup/cpu/${UPSTART_JOB}" |
| 25 | mkdir -p "${cgroup_dir}" |
| 26 | echo $(status | cut -f 4 -d ' ') > "${cgroup_dir}/tasks" |
| 27 | end script |