| # Copyright 2020 The ChromiumOS Authors | |
| # Use of this source code is governed by a BSD-style license that can be | |
| # found in the LICENSE file. | |
| description "Update flag to enable UserDataAuth from Finch" | |
| author "chromium-os-dev@chromium.org" | |
| start on starting system-services | |
| stop on stopping system-services | |
| # This service is in charge of querying Chrome Features service to check if | |
| # UserDataAuth is enabled according to finch. Then, it'll write the result to | |
| # a file, which is checked in cryptohomed.conf by shall-use-userdataauth.sh | |
| # and the appropriate flags will be added to cryptohomed on startup. | |
| # The actual query and set flag operation is done by the | |
| # update_userdataauth_from_features.sh shell script. | |
| # Note that when cryptohome is starting, the chrome features service may not | |
| # be reliably available, so this script might run a slight bit later than | |
| # cryptohomed startup, and it will only take effect on the next reboot. | |
| # Doesn't matter much if this gets killed due to oom. | |
| oom score 0 | |
| # as for address space, that is vm size. The limit for this task is 150MB. | |
| limit as 150000000 unlimited | |
| # Update the flag at start. | |
| pre-start exec /usr/libexec/cryptohome/update_userdataauth_from_features.sh | |
| # Update every 1 hour, this is so that if the configuration changes halfway | |
| # during the current boot, we'll likely have the new configuration activated on | |
| # the next reboot instead of the next next reboot. | |
| exec periodic_scheduler --period=3600 --timeout=600 \ | |
| --task_name=update_userdataauth \ | |
| -- /usr/libexec/cryptohome/update_userdataauth_from_features.sh |