blob: 78a08e87b899838d28218a9de1385738cce7f792 [file] [log] [blame]
# Copyright 2016 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 "device jail FUSE daemon"
author "chromium-os-dev@chromium.org"
env DJFS_MOUNTPOINT=/run/djfs
pre-start script
mkdir -p "${DJFS_MOUNTPOINT}"
chown devicejail:devicejail "${DJFS_MOUNTPOINT}"
end script
# device_jail_fs enters a minijail after mounting the FS.
exec /usr/bin/device_jail_fs "${DJFS_MOUNTPOINT}"
post-start script
# Wait up to five seconds for the mountpoint to appear in /proc/mounts.
# This could take a while if the fuse module isn't loaded yet.
for i in $(seq 50); do
if cut -d' ' -f2 /proc/mounts | grep -F "${DJFS_MOUNTPOINT}"; then
break
fi
sleep 0.1
done
end script