blob: f44eb328f4aa4451e9462663e8be16afc74f8474 [file] [edit]
# Copyright 2024 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
description "Clean up Android data on devices that have lost ARC support"
author "chromium-os-dev@chromium.org"
start on start-user-session
stop on stopping ui
import CHROMEOS_USER
oom score never
# This job cleans up in the background not to block the user.
nice 10
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 \
--config=/usr/share/minijail/extended-updates-arc-cleanup.conf \
-k "${CHROMEOS_USER_HOME},${CHROMEOS_USER_HOME},none,MS_BIND|MS_REC" \
-- /usr/sbin/extended-updates-arc-remove-data \
--chromeos_user="${CHROMEOS_USER}"
end script