Bug 80620

Summary: Systemd crashes in libcontainer/docker
Product: systemd Reporter: Jaka Hudoklin <jakahudoklin>
Component: generalAssignee: systemd-bugs
Status: RESOLVED NOTOURBUG QA Contact: systemd-bugs
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Jaka Hudoklin 2014-06-28 08:10:19 UTC
I was trying to make systemd 212 run in lxc implementation of docker(on nixos linux distro), libcontainer. Well it crashes immidiately, without any log output or anything. This is backtrace from gdb:

#0  0x00007ff44f7e3d10 in __pause_nocancel () from /nix/store/94n64qy99ja0vgbkf675nyk39g9b978n-glibc-2.19/lib/libpthread.so.0
#1  0x000000000048595d in freeze ()
#2  0x000000000049aa2e in main ()

What is funny is that i'm able to run it perfectly fine if PID>1 using --system flag. Just as an info, i'm running it from init shell script, which does exec(so replacing shell process with systemd process).

I also reported this issue to docker https://github.com/dotcloud/docker/issues/6730
Comment 1 Lennart Poettering 2014-06-29 18:40:42 UTC
Docker/LXC are probably not setting up something properly that is necessary to log. Would be good to get an strace.
Comment 2 Lennart Poettering 2014-08-18 21:36:09 UTC
Please provide the console output of this, when you boot systemd with systemd.log_level=debug systemd.log_target=console on the container's PID 1 command line. Otherwise I cannot really tell you much....
Comment 3 Jaka Hudoklin 2014-08-18 21:44:12 UTC
(In reply to comment #2)
> Please provide the console output of this, when you boot systemd with
> systemd.log_level=debug systemd.log_target=console on the container's PID 1
> command line. Otherwise I cannot really tell you much....

Well i do that, but the problem is that systemd crashes immidiatelly and no debug output is printed out. I might be able to run it with debugging symbols and debug trace might be better, do you have any other suggestion? What's funny is that this is known problem in docker, but looks like no one else has bothered to fix it.
Comment 4 Lennart Poettering 2014-08-18 22:22:47 UTC
consider running systemd with "strace -D -o /tmp/foobar" or so, to see if any syscalls fail.
Comment 5 Lennart Poettering 2015-02-04 18:55:38 UTC
Anyway, this is nothing to fix in systemd really. The docker guys need to set up their execution environment right for systemd if they want to be able to run it in a docker container. How that's supposed to be done is well documented in 

http://www.freedesktop.org/wiki/Software/systemd/ContainerInterface/

Closing this bug now. Feel free to reopen if you have a specific issue where you think systemd is doing something wrong, that is not covered by the docs above.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.