arc: Decouple arc-sensor.conf and arc-network.conf
In the past, the container's init.cheets.rc only waited for one
file, /dev/.arc_network_ready, and because of that, arc-sensor.conf
had to be executed in a blocking manner so that the sensors were
ready before starting system_server.
Today, since init.cheets.rc waits for two files, both
/dev/.arc_network_ready and /dev/.arc_sensor_ready, it's okay to
write the former while settings up the sensors. This CL does that
to remove sensor related code from arc-network.conf.
BUG=None
TEST=ARC++ still starts
Change-Id: I2d92143a744984d1d4e370dfb90cec2f31046fdf
Reviewed-on: https://chromium-review.googlesource.com/1330128
Commit-Ready: Yusuke Sato <yusukes@chromium.org>
Tested-by: Yusuke Sato <yusukes@chromium.org>
Reviewed-by: Christopher Morin <cmtm@google.com>
Reviewed-by: Shuhei Takahashi <nya@chromium.org>
diff --git a/arc/network/init/arc-network.conf b/arc/network/init/arc-network.conf
index f505cf7..30b167b 100644
--- a/arc/network/init/arc-network.conf
+++ b/arc/network/init/arc-network.conf
@@ -67,10 +67,6 @@
nsenter -t "${CONTAINER_PID}" -n -- \
ip link set "slave_${CONTAINER_NAME}" name arc0
- # Start sensors in its pre-start (blocking) script.
- # TODO(yusukes): Find a better place to start the job.
- initctl emit start-arc-sensor CONTAINER_PID="${CONTAINER_PID}"
-
# Signal the container that network devices are ready.
nsenter -t "${CONTAINER_PID}" --mount --pid -- \
/system/bin/touch /dev/.arc_network_ready
@@ -88,13 +84,4 @@
exec /usr/bin/arc-networkd --con_netns=$CONTAINER_PID \
--internal_interface=${ARC_IFNAME}
-
-post-stop script
- {
- echo "Post-stop arc-network"
- set +e -x
-
- # TODO(yusukes): Move it to arc_setup_wrapper.sh.
- exec initctl emit stop-arc-sensor
- } 2>&1 | logger -t "${UPSTART_JOB}"
-end script
+post-stop exec logger -t "${UPSTART_JOB}" "Post-stop arc-network"
diff --git a/arc/setup/etc/arc-sensor.conf b/arc/setup/etc/arc-sensor.conf
index 4e83220..2798661 100644
--- a/arc/setup/etc/arc-sensor.conf
+++ b/arc/setup/etc/arc-sensor.conf
@@ -5,14 +5,13 @@
description "Start sensors for a container"
author "chromium-os-dev@chromium.org"
-start on start-arc-sensor
-stop on stop-arc-sensor
+start on started arc-boot-continue
+stop on stopped arc-boot-continue
# The following environment variable is passed when this job is
# started from arc-network.conf.
import CONTAINER_PID
-# TODO(yusukes): Consider making this non-blocking (i.e. just 'start script').
pre-start script
{
echo "Pre-start arc-sensor"