-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
base: master
Are you sure you want to change the base?
Conversation
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' |
There was a problem hiding this comment.
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.
installer/functions
Outdated
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2>/dev/null
|
host-bin/enter-chroot
Outdated
@@ -355,6 +390,10 @@ tmpfsmount /var/run/lock 'noexec,nosuid,nodev,size=5120k' | |||
bindmount /var/run/dbus /var/host/dbus |
There was a problem hiding this comment.
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.
455c029
to
cebf84f
Compare
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.