blob: 9207c532445e86a146f58972835240df3c044e46 [file] [log] [blame]
# Copyright (c) 2014 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 "Start apache for moblab."
author "chromium-os-dev@chromium.org"
start on (started moblab-database-init and
stopped moblab-external-storage-init RESULT=ok)
pre-start script
APACHE_LOG_DIR=/var/log/apache2
mkdir -p "${APACHE_LOG_DIR}"
chown -R apache:apache "${APACHE_LOG_DIR}"
APACHE_RUN_DIR=/var/run/apache
mkdir -p "${APACHE_RUN_DIR}"
chown -R apache:apache "${APACHE_RUN_DIR}"
APACHE_SSH_DIR=/var/www/.ssh
if [ ! -e "${APACHE_SSH_DIR}"/id_rsa ]; then
mkdir -p "${APACHE_SSH_DIR}"
cp /root/.ssh/* "${APACHE_SSH_DIR}"
chown -R apache:apache "${APACHE_SSH_DIR}"
fi
end script
exec apache2