From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eddy Pronk Subject: guixsd in lxd container Date: Wed, 7 Jun 2017 23:08:29 +1000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a113d6caeb7e16405515e6ea1" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48387) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIahQ-0004gN-7e for guix-devel@gnu.org; Wed, 07 Jun 2017 09:08:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dIahM-000555-RZ for guix-devel@gnu.org; Wed, 07 Jun 2017 09:08:36 -0400 Received: from mail-oi0-x229.google.com ([2607:f8b0:4003:c06::229]:35505) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dIahM-000542-IM for guix-devel@gnu.org; Wed, 07 Jun 2017 09:08:32 -0400 Received: by mail-oi0-x229.google.com with SMTP id p7so5245109oif.2 for ; Wed, 07 Jun 2017 06:08:30 -0700 (PDT) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org --001a113d6caeb7e16405515e6ea1 Content-Type: text/plain; charset="UTF-8" Hello guix! I'm trying to run guixsd in an lxd container. My lxd containers run on an Ubuntu server 16.04. I took the usb-installer image and imported in as an lxd image. When a container start it runs /sbin/init. In guixsd /proc/1 is shepherd, but a lot of stuff happens before shepherd is started. I've set a few things in the environment matching values in /proc/1/environ. The argument of --load in grub.cfg is a guile program. I found some details about the kernel loading guile here: https://lists.gnu.org/archive/html/guix-devel/2016-12/msg00704.html To be able to get some logging during startup of guixsd I'm trying to run it from a shell script as root. ==== cat /sbin/start export HOME=/ export TERM=linux export BOOT_IMAGE="/gnu/store/fqc2kg4lq1lz1ymk41080jzb5q90icg0-linux-libre-4.11/bzImage --root=gnu-disk-image --system=/gnu/store/kq71yhydfgc0nksvmmn66cbvbj5a3mvf-system --load=/gnu/store/kq71yhydfgc0nksvmmn66cbvbj5a3mvf-system/boot" export PATH=/gnu/store/crvb68g89b479n4h44r8l42hy39axhg2-shadow-4.4/sbin/ cd $HOME /gnu/store/sa7zrdfqglnb5rvvr11qdj0rspbs292v-profile/bin/ln -s /gnu/store/kq71yhydfgc0nksvmmn66cbvbj5a3mvf-system /run/current-system /gnu/store/zk41gmzbibvpx9dpsm5gs8p0liz8shy0-guile-2.0.14/bin/guile --no-auto-compile /gnu/store/kq71yhydfgc0nksvmmn66cbvbj5a3mvf-system/boot === When I run the start script I get the following output. $ lxc exec guixsd -- /gnu/store/sa7zrdfqglnb5rvvr11qdj0rspbs292v-profile/bin/bash -c "/sbin/start 2>&1" /gnu/store/sa7zrdfqglnb5rvvr11qdj0rspbs292v-profile/bin/ln: failed to create symbolic link '/run/current-system/kq71yhydfgc0nksvmmn66cbvbj5a3mvf-system': File exists making '#f' the current system... Backtrace: In ice-9/boot-9.scm: 160: 13 [catch #t # ...] In unknown file: ?: 12 [apply-smob/1 #] In ice-9/boot-9.scm: 66: 11 [call-with-prompt prompt0 ...] In ice-9/eval.scm: 432: 10 [eval # #] In ice-9/boot-9.scm: 2412: 9 [save-module-excursion #] 4089: 8 [#] 1734: 7 [%start-stack load-stack #] 1739: 6 [#] In unknown file: ?: 5 [primitive-load "/gnu/store/kq71yhydfgc0nksvmmn66cbvbj5a3mvf-system/boot"] In ice-9/eval.scm: 432: 4 [eval # ()] In unknown file: ?: 3 [primitive-load "/gnu/store/9j944zjslsihhsgipa7gz7x046fkcjm7-activate"] In ice-9/eval.scm: 432: 2 [eval # ()] In ./gnu/build/activation.scm: 456: 1 [activate-current-system #f] In unknown file: ?: 0 [symlink #f "/run/current-system.new"] ERROR: In procedure symlink: ERROR: Wrong type (expecting string): #f === Ignoring the errors above I'll now try to start shepherd, to see how far I get. jenkins@ubuntu16041:~/guixsd$ lxc exec guixsd -- /gnu/store/sa7zrdfqglnb5rvvr11qdj0rspbs292v-profile/bin/bash -c "/gnu/store/q49si29djfcrpzibqg6cg8k6xixxvd2f-shepherd-0.3.2/bin/shepherd --config /gnu/store/df56ad2rw1ayjyhs1kqadskf5zsmsc5l-shepherd.conf 2>&1" Service root has been started. starting services... Service root-file-system has been started. Service user-file-systems has been started. Service file-system-/tmp has been started. failed to start service 'file-systems' <<== first problem. failed to start service 'file-system-/dev/pts' Service file-system-/dev/shm has been started. failed to start service 'file-system-/gnu/store' failed to start service 'user-processes' Service host-name has been started. failed to start service 'user-homes' failed to start service 'nscd' failed to start service 'ssh-daemon' waiting for udevd... waiting for udevd... waiting for udevd... waiting for udevd... Service udev has been started. Service gpm could not be started. failed to start service 'console-font-tty1' failed to start service 'console-font-tty2' failed to start service 'console-font-tty3' failed to start service 'console-font-tty4' failed to start service 'console-font-tty5' failed to start service 'console-font-tty6' failed to start service 'guix-daemon' failed to start service 'syslogd' failed to start service 'term-tty6' failed to start service 'term-tty5' failed to start service 'term-tty4' failed to start service 'term-tty3' failed to start service 'term-tty2' failed to start service 'term-tty1' C-c C-c^CExiting shepherd... unmounting '/dev'... failed to unmount '/dev': Device or resource busy unmounting '/dev/null'... failed to unmount '/dev/null': Device or resource busy Service user-file-systems has been stopped. Service host-name has been stopped. Service file-system-/dev/shm has been stopped. Service file-system-/tmp has been stopped. Service udev has been stopped. closing log === See also: https://lists.gnu.org/archive/html/guix-devel/2016-12/msg00733.html I would like to get some help to solve this puzzle. Cheers, Eddy --001a113d6caeb7e16405515e6ea1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello guix!

I'm trying to = run guixsd in an lxd container.
My lxd containers run on an U= buntu server 16.04.

I took the usb-installer image and im= ported in as an lxd image.

When a container start i= t runs /sbin/init.
In guixsd /proc/1 is shepherd, but a lot of stu= ff happens before shepherd is started.

I've set a few things in the environment matching values in /proc/1/en= viron.
The argument of --load in grub.cfg is a guile program.=

I found some details about the kernel loading guile her= e:
https://lists.gnu.org/archive/html/guix-d= evel/2016-12/msg00704.html

To be able to get som= e logging during startup of guixsd I'm trying to run it from a shell sc= ript as root.

=3D=3D=3D=3D
cat /sbin/start
export H= OME=3D/
export TERM=3Dlinux
export BOOT_IMAGE=3D"/gnu/store/fqc2= kg4lq1lz1ymk41080jzb5q90icg0-linux-libre-4.11/bzImage --root=3Dgnu-disk-ima= ge --system=3D/gnu/store/kq71yhydfgc0nksvmmn66cbvbj5a3mvf-system --load=3D/= gnu/store/kq71yhydfgc0nksvmmn66cbvbj5a3mvf-system/boot"
export PATH= =3D/gnu/store/crvb68g89b479n4h44r8l42hy39axhg2-shadow-4.4/sbin/
cd $HOME=
/gnu/store/sa7zrdfqglnb5rvvr11qdj0rspbs292v-profile/bin/ln -s /gnu/stor= e/kq71yhydfgc0nksvmmn66cbvbj5a3mvf-system /run/current-system
/gnu/store= /zk41gmzbibvpx9dpsm5gs8p0liz8shy0-guile-2.0.14/bin/guile --no-auto-compile = /gnu/store/kq71yhydfgc0nksvmmn66cbvbj5a3mvf-system/boot
=3D=3D=3D
When I run the start script I get the following output.

$ lxc exec = guixsd -- /gnu/store/sa7zrdfqglnb5rvvr11qdj0rspbs292v-profile/bin/bash -c &= quot;/sbin/start 2>&1"
/gnu/store/sa7zrdfqglnb5rvvr11qdj0rsp= bs292v-profile/bin/ln: failed to create symbolic link '/run/current-sys= tem/kq71yhydfgc0nksvmmn66cbvbj5a3mvf-system': File exists
making = 9;#f' the current system...
Backtrace:
In ice-9/boot-9.scm:
= =C2=A0160: 13 [catch #t #<catch-closure 938020> ...]
In unknown fi= le:
=C2=A0=C2=A0 ?: 12 [apply-smob/1 #<catch-closure 938020>]
I= n ice-9/boot-9.scm:
=C2=A0 66: 11 [call-with-prompt prompt0 ...]
In i= ce-9/eval.scm:
=C2=A0432: 10 [eval # #]
In ice-9/boot-9.scm:
2412:= 9 [save-module-excursion #<procedure 95c900 at ice-9/boot-9.scm:4084:3 = ()>]
4089: 8 [#<procedure 95c900 at ice-9/boot-9.scm:4084:3 ()>= ]
1734: 7 [%start-stack load-stack #<procedure 9663a0 at ice-9/boot-9= .scm:4080:10 ()>]
1739: 6 [#<procedure 96ebd0 ()>]
In unknow= n file:
=C2=A0=C2=A0 ?: 5 [primitive-load "/gnu/store/kq71yhydfgc0n= ksvmmn66cbvbj5a3mvf-system/boot"]
In ice-9/eval.scm:
=C2=A0432: = 4 [eval # ()]
In unknown file:
=C2=A0=C2=A0 ?: 3 [primitive-load &quo= t;/gnu/store/9j944zjslsihhsgipa7gz7x046fkcjm7-activate"]
In ice-9/e= val.scm:
=C2=A0432: 2 [eval # ()]
In ./gnu/build/activation.scm:
= =C2=A0456: 1 [activate-current-system #f]
In unknown file:
=C2=A0=C2= =A0 ?: 0 [symlink #f "/run/current-system.new"]

ERROR: In = procedure symlink:
ERROR: Wrong type (expecting string): #f
=3D=3D=3D=

Ignoring the errors above I'll now try to start shep= herd, to see how far I get.

jenkins@ubuntu16041:~/guixsd$= lxc exec guixsd -- /gnu/store/sa7zrdfqglnb5rvvr11qdj0rspbs292v-profile/bin= /bash -c "/gnu/store/q49si29djfcrpzibqg6cg8k6xixxvd2f-shepherd-0.3.2/b= in/shepherd --config /gnu/store/df56ad2rw1ayjyhs1kqadskf5zsmsc5l-shepherd.c= onf 2>&1"
Service root has been started.
starting service= s...
Service root-file-system has been started.
Service user-file-sys= tems has been started.
Service file-system-/tmp has been started.
fai= led to start service 'file-systems'=C2=A0 <<=3D=3D first prob= lem.
failed to start service 'file-system-/dev/pts'
Service f= ile-system-/dev/shm has been started.
failed to start service 'file-= system-/gnu/store'
failed to start service 'user-processes'<= br>Service host-name has been started.
failed to start service 'user= -homes'
failed to start service 'nscd'
failed to start se= rvice 'ssh-daemon'
waiting for udevd...
waiting for udevd...<= br>waiting for udevd...
waiting for udevd...
Service udev has been st= arted.
Service gpm could not be started.
failed to start service '= ;console-font-tty1'
failed to start service 'console-font-tty2&#= 39;
failed to start service 'console-font-tty3'
failed to sta= rt service 'console-font-tty4'
failed to start service 'cons= ole-font-tty5'
failed to start service 'console-font-tty6'failed to start service 'guix-daemon'
failed to start service = 'syslogd'
failed to start service 'term-tty6'
failed = to start service 'term-tty5'
failed to start service 'term-t= ty4'
failed to start service 'term-tty3'
failed to start = service 'term-tty2'
failed to start service 'term-tty1'<= br>

=C2=A0 C-c C-c^CExiting shepherd...
unmounting '/dev'= ...
failed to unmount '/dev': Device or resource busy
unmount= ing '/dev/null'...
failed to unmount '/dev/null': Device= or resource busy
Service user-file-systems has been stopped.
Service= host-name has been stopped.
Service file-system-/dev/shm has been stopp= ed.
Service file-system-/tmp has been stopped.
Service udev has been = stopped.
closing log
=3D=3D=3D

See also:
https://lists= .gnu.org/archive/html/guix-devel/2016-12/msg00733.html

I would like to get some help to solve this puzzle.



=
Cheers,
Eddy

= --001a113d6caeb7e16405515e6ea1--