| # Copyright 2022 The ChromiumOS Authors |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| description "Start the ChromiumOS shader cache daemon" |
| author "chromeos-gaming-core@google.com" |
| |
| start on started system-services and started vm_concierge |
| stop on stopping system-services and stopped vm_concierge |
| |
| # Minijail forks off the desired process. |
| expect fork |
| |
| # shadercached is a restartable daemon. |
| oom score -100 |
| |
| # If the job respawns 10 times in 10 seconds, stop trying. |
| respawn |
| respawn limit 10 10 |
| |
| # - shadercached does not enter any new namespace because it needs to bind mount |
| # dlc contents into /run/daemon-store/crosvm/... directory. |
| # - cap_sys_admin required to mount DLC contents into Borealis VM gpu cache |
| # - --uts -e -l -N set as per Sandboxing recommendations, see minijail0 manual |
| # for details. |
| exec minijail0 \ |
| -u shadercached -g shadercached -G \ |
| -c 'cap_sys_admin+eip' --ambient \ |
| --uts -e -l -N \ |
| -i \ |
| /usr/bin/shadercached |