blob: 2e339dd9f9ce2ca2c3cc2f8a1c9187388eb900b9 [file] [log] [blame]
# Copyright 2018 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 "Downloadable content service daemon"
author "chromium-os-dev@chromium.org"
# dlcservice parameters passed in by upstart command.
import PARAMS
start on starting system-services
stop on stopping system-services
pre-start script
# Checks sanity of ${PARAMS}.
if [ -n "${PARAMS}" -a "${PARAMS}" != "--load_installed=false" ]; then
logger -t dlcservice "PARAMS is not properly set."
exit 1
fi
# Initializes DLC module image root directory.
dlc_image_root_path="/var/lib/dlc"
mkdir -p "${dlc_image_root_path}"
chmod 0755 "${dlc_image_root_path}"
chown dlcservice:dlcservice "${dlc_image_root_path}"
end script
exec minijail0 -u dlcservice -g dlcservice -G -n -S \
/usr/share/policy/dlcservice-seccomp.policy /usr/sbin/dlcservice ${PARAMS}