blob: a0f607adcf043fb71305808707335f1d9b8f8e84 [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 mountpoint -q "${DJFS_MOUNTPOINT}"; then
break
fi
sleep 0.1
done
end script