Add update-engine's init script

Part of a three CL commit that moves update-engine.conf from
platform/init to platform/update_engine

BUG=chromium:348801
TEST=build chromeos-init and update_engine. update-engine is now owned
by update_engine

CQ-DEPEND=Idafd4fcd84ed4b785c11b96b879aa739cd9d2ade
CQ-DEPEND=Id23e80659dfde2d48b21417245fae1326ef4cdf7

Change-Id: I54889e0b34c9adcf12ac7ba12c2409c49642827f
Reviewed-on: https://chromium-review.googlesource.com/188767
Reviewed-by: Bertrand Simonnet <[email protected]>
Tested-by: Bertrand Simonnet <[email protected]>
Commit-Queue: Bertrand Simonnet <[email protected]>
diff --git a/init/update-engine.conf b/init/update-engine.conf
new file mode 100644
index 0000000..35bfc06
--- /dev/null
+++ b/init/update-engine.conf
@@ -0,0 +1,27 @@
+# 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     "System software update service"
+author          "[email protected]"
+
+# N.B. The chromeos-factoryinstall ebuild edits the 'start on' line so as
+# to disable update_engine in factory images.  Do not change this without
+# also updating that reference.
+start on starting system-services
+stop on stopping system-services
+respawn
+
+expect fork
+
+# Runs the daemon at low/idle IO priority so that updates don't
+# impact system responsiveness.
+exec ionice -c3 update_engine
+
+# Put update_engine process in its own cgroup.
+# Default cpu.shares is 1024.
+post-start script
+  cgroup_dir="/sys/fs/cgroup/cpu/${UPSTART_JOB}"
+  mkdir -p "${cgroup_dir}"
+  echo $(status | cut -f 4 -d ' ') > "${cgroup_dir}/tasks"
+end script