blob: 6b97b015d33aad28334d6c60aa7141f2a2d96b7d [file] [log] [blame]
# Copyright 2021 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 "Job to start"
author ""
start on starting update-engine
stop on stopping update-engine
# We only run this on test images, but its a good idea to set this so we can
# change the default.
oom score -100
env NEBRASKA_CONFIG_FILE=/usr/local/nebraska/config.json
pre-start script
# If no JSON file for updating nebraska's config was provided, don't run
# nebraska. We only want to run nebraska when we intend to do so.
if [ ! -f "${NEBRASKA_CONFIG_FILE}" ]; then
logger -t "${UPSTART_JOB}" "Can't run without its config file."
exit 0
logger -t "${UPSTART_JOB}" "Running"
end script
post-start script
# Wait for the port file to appear for no more than 3 seconds. --poll
if [ "$?" -ne 0 ]; then
logger -t "${UPSTART_JOB}" "Failed to find pid/port files of"
exit 0
PORT="$(cat /run/nebraska/port)"
end script