| # 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 "Remove ARC data for user" |
| author "chromium-os-dev@chromium.org" |
| |
| # This job is started by the Chrome Browser. |
| # Stop the job on 'stopping ui' because once ui is stopped, ARC data files |
| # in the user's home directory will not be accessible anyway. |
| stop on stopping ui |
| |
| # Use never since incomplete removal of Android /data could prevent ARC from |
| # starting properly next time. |
| oom score never |
| task |
| |
| import CHROMEOS_USER |
| # export for arc-stale-directory-remover.conf |
| export CHROMEOS_USER |
| |
| pre-start script |
| CHROMEOS_USER_HOME=$(cryptohome-path system "${CHROMEOS_USER}") |
| if [ ! -d "${CHROMEOS_USER_HOME}" ]; then |
| logger -t "${UPSTART_JOB}" \ |
| "User home ${CHROMEOS_USER_HOME} does not exist" |
| exit 1 |
| fi |
| exec /sbin/minijail0 \ |
| -c 'cap_dac_override,cap_dac_read_search+eip' \ |
| --profile=minimalistic-mountns --uts -e -l -p -N \ |
| -b /home \ |
| -k "${CHROMEOS_USER_HOME},${CHROMEOS_USER_HOME},none,MS_BIND|MS_REC" \ |
| -- /usr/sbin/arc-remove-data --log_tag=arc-remove-data |
| end script |
| # This is needed to ensure this job doesn't remain in the started state. |
| exec /bin/true |