Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect whether we are running in containers and act responsively. #2063

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

arbuztw
Copy link
Contributor

@arbuztw arbuztw commented Sep 3, 2015

Detect whether we are running in containers by inspecting the environment
variable $container. If we are in container, we are not able to remount
or change the config in /proc/sys/*, so just skip them. We also have
to patch debootstrap since we are not able to mknod and we don't want
to start services in containers.

Run a daemon that handles all the requests of finding nacl_helper,
and then pass the share memory fd to client using unix socket.
# unmount, then use lazy unmount.
# FIXME: This is a hack for running in containers, since we cannot
# unmount recursive bindmount in it.
arg='-l'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is a kernel bug. I'll try to reproduce on recent kernels and ask on LKML...

Detect whether we are running in containers by inspecting the environment
variable $container. If we are in container, we are not able to remount
or change the config in /proc/sys/*, so just skip them. We also have
to patch debootstrap since we are not able to mknod and we don't want
to start services in containers.
Instead of inspecting the environment variable $container, check whether we are
able to do some operations and act responsively.
It is possible that /sys, /media is not mounted in a container,
so check it before we bind-mount it into chroot.
echo 0 > /proc/sys/kernel/hung_task_panic
# Don't fail since we do not have permission to write /proc/sys/* if we are
# in container.
echo 0 > /proc/sys/kernel/hung_task_panic || true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2>/dev/null

@drinkcat
Copy link
Collaborator

vboot_is_safe is also noisy, because of mount --bind / "$tmp"

@@ -355,6 +390,10 @@ tmpfsmount /var/run/lock 'noexec,nosuid,nodev,size=5120k'
bindmount /var/run/dbus /var/host/dbus
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2>/dev/null || true. We probably won't bind mount /var/run/dbus in verified mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants