-
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
Support for systemd #2474
base: master
Are you sure you want to change the base?
Support for systemd #2474
Conversation
Use jchroot to start systemd. Detects running systemd process for chroot using PID file and enters.
Good job! |
Thanks for the PR! This is really awesome.
Passing remark: The whole mount-chroot/unmount-chroot logic could be simplified a lot if we used mount namespaces. Even if we do not start any init system. In most cases it should be ok to tear down systemd if no one uses the namespace anymore (maybe after a timeout?). We need to figure out the logic ,-)
We'd need to add these to core target.
No issues here, all of our kernels have PID_NS enabled:
(note to self, CLA in file, thanks!) |
Clean environment with env when entering chroot. Use read -r.
Nice! Didn't know about Agreed that using mount namespaces instead of juggling the mounts by scripts would be nice. For now though, I'll look into how to detect whether or not the systemd PID namespace is in use, for unmounting the old way. |
Did you try this option?
|
Yes, that's what I'm using. The weirdness is this: # Works
minijail0 ... -I /bin/bash -c "exec /lib/systemd/systemd"
# Does not work (exits immediately with code 255)
minijail0 ... -I /lib/systemd/systemd |
Thank you so much for doing this! |
One option for installing the service, while preventing it from starting would be: env RUNLEVEL=1 apt-get install alsa-utils console-setup ... An option to disable services after they are installed would be: systemctl disable alsa-utils |
Right, so I'll drop an issue for this a bit later, but I've got a few questions for @sn0e, @drinkcat, @dnschneid, or anyone else in the project that I haven't found answers to in the issues section. Firstly, does this work? I can't seem to upgrade to xenial (or anything past trusty) due to the systemd issue. Secondly, how does this work? My *nix development and admin skills are lagging. Thirdly, how do I go about building this and compiling it from source. Fourthly, is cruton still alive and well? I'm having trouble tracking your development milestones and progress. That's probably because I'm dense and presently have the luxury of relying on cleverer minds than mind for product management. Finally, is there just a simple fix that I'm missing for the systemd problem that you've already implemented, and that's just slipped by me? I'm just messing about with my relic of a Cr-48, if that is indicative of anything. |
What would it take to get this merged? I am not so interested in systemd per-se, but on having crouton run inside its own pid namespace (i.e. wrap with minijail0). |
Any news on this? I'm assuming it's being backlogged to preference Crostini? Was there any plans on making this mergeable? |
Patched these mods into my current enter-chroot; works like a charm! |
Can someone explain/link how to setup crouton using these/any mods as the last commenter stated they did? This issue is over 2 years old so I don't really have much hope in waiting longer. |
Any info on whether this will be merged? I would love this to happen in the mainstream. |
How'd you do this? |
This is an attempt of having enter-chroot start systemd inside a PID namespace for kernels that support it. New param
-s
enables this mode. It allows one to manage services, run Gnome, and otherwise use systemd like normal people inside a chroot. I've been using it with Ubuntu Wily, and it works pretty well already.Present challenges:
Currently lacking proper running session detection, so crouton always attempts to unmount the chroot when exiting a shell.
Requires jchroot on the host - should perhaps be added and included with crouton? Single C file which can be found and compiled from https://github.com/vincentbernat/jchroot.Now usesminijail0
which is already in CrOS.A target is needed that masks (disables) some services that wreaks havok with Chrome OS managed devices like keyboard and touchpad. I have yet to figure out how to create a target file though. For now these commands should be run before using
-s
by first entering the chroot normally:Lots of polish,
like detecting whether or not the kernel is built with(already included in all kernels)CONFIG_PID_NS
and give the user nice error messages if not.