Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 301633 - lxc-start runs host init if guest container does not have a valild config
Summary: lxc-start runs host init if guest container does not have a valild config
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Diego Elio Pettenò (RETIRED)
URL: http://lxc.sourceforge.net/
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-20 15:25 UTC by John M. Drescher
Modified: 2010-01-26 17:24 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John M. Drescher 2010-01-20 15:25:55 UTC
I found a case where lxc-start tries to execute the host systems init again. This was triggered by running lxc-create and forgetting to add the -f parameter causing an empty config file.

Reproducible: Always

Steps to Reproduce:
1. Run lxc-config with the name only.
2. Then start the container with lxc-start 


Actual Results:  
Here is when I forgot the -f parameter to lxc-create
localhost lxc # lxc-stop -n guest_1
localhost lxc # ls -al /etc/lxc/guest_1/config 
-rw-r--r-- 1 root root 0 Jan 20 10:19 /etc/lxc/guest_1/config
localhost lxc # rm -rf /etc/lxc/guest_1
localhost lxc # lxc-create -n guest_1 -f guest_1.conf 
localhost lxc # ls -al /etc/lxc/guest_1/config 
-rw-r--r-- 1 root root 877 Jan 20 10:22 /etc/lxc/guest_1/config
localhost lxc # lxc-start -n guest_1
INIT: version 2.87 booting
Loading /lib64/rc/console/keymap

   OpenRC 0.6.0 is starting up Gentoo Linux (x86_64)

 * Mounting /proc ...                                                                                                       [ ok ]
 * Caching service dependencies ...                                                                                         [ ok ]
 * Setting hostname to gentoo-lxc-guest ...                                                                                 [ ok ]
 * Configuring kernel parameters ...                                                                                        [ ok ]
 * Creating user login records ...                                                                                          [ ok ]
 * Cleaning /var/run ...                                                                                                    [ ok ]
 * Wiping /tmp directory ...                                                                                                [ ok ]
 * Setting terminal encoding [UTF-8] ...
/etc/init.d/termencoding: line 31: /dev/tty5: Operation not permitted
/etc/init.d/termencoding: line 31: /dev/tty6: Operation not permitted
/etc/init.d/termencoding: line 31: /dev/tty7: Operation not permitted
/etc/init.d/termencoding: line 31: /dev/tty8: Operation not permitted
/etc/init.d/termencoding: line 31: /dev/tty9: Operation not permitted
/etc/init.d/termencoding: line 31: /dev/tty10: Operation not permitted
/etc/init.d/termencoding: line 31: /dev/tty11: Operation not permitted
/etc/init.d/termencoding: line 31: /dev/tty12: Operation not permitted                                                      [ ok ]
 * Setting keyboard mode [UTF-8] ...
Couldn't open /dev/tty1
Couldn't open /dev/tty2
Couldn't open /dev/tty3
Couldn't open /dev/tty4
Couldn't open /dev/tty5
Couldn't open /dev/tty6
Couldn't open /dev/tty7
Couldn't open /dev/tty8
Couldn't open /dev/tty9
Couldn't open /dev/tty10
Couldn't open /dev/tty11
Couldn't open /dev/tty12                                                                                                    [ ok ]
 * Loading key mappings [us] ...                                                                                            [ ok ]
 * Starting network                                                                                                         [ ok ]
 * Adding static routes ...                                                                                                 [ ok ]
 * Initializing random number generator ...                                                                                 [ ok ]
INIT: Entering runlevel: 3
 * Mounting network filesystems ...                                                                                         [ ok ]
 * Starting syslog-ng ...
Jan 20 10:22:55 gentoo-lxc-guest syslog-ng[325]: syslog-ng starting up; version='3.0.4'                                     [ ok ]
 * Starting sshd ...
Jan 20 10:22:56 gentoo-lxc-guest sshd[339]: Server listening on 0.0.0.0 port 22.                                            [ ok ]
 * Starting local ...                                                                                                       [ ok ]
Here is the output of this:

localhost lxc # lxc-create -n guest_1
localhost lxc # ls -al /etc/lxc/guest_1/config 
-rw-r--r-- 1 root root 0 Jan 20 10:19 /etc/lxc/guest_1/config
localhost lxc # lxc-start -n guest_1
INIT: version 2.86 booting
Loading /lib64/rc/console/keymap

   OpenRC 0.6.0 is starting up Gentoo Linux (x86_64) [LXC]

Press I to enter interactive boot mode

 * /proc is already mounted, skipping
hwclock                   | * Setting system clock using the hardware clock [UTC] ...                                             [ ok ]k                   |
termencoding              | * Setting terminal encoding [UTF-8] ...
hostname                  | * Setting hostname to localhost ...                                                                   [ ok ]coding              |                                                                                                       [ ok ]me                  |
modules                   | * Autoloaded 0 module(s)
udev-mount                | * /dev is already mounted
sysctl                    | * Configuring kernel parameters ...                                                                   [ ok ]                    |
udev                      | * Starting udevd ...
udev                      | * start-stop-daemon: /sbin/udevd is already running                                                   [ !! ]                    |
udev                      | * start-stop-daemon: 1 process refused to stop
udev                      | * ERROR: udev failed to start
fsck                      | * Checking local filesystems  ...
fsck                      |/dev/sda1: clean, 132/34136 files, 122136/136520 blocks                                                [ ok ]                    |
mtab                      | * Updating /etc/mtab ...                                                                              [ ok ]                    |
localmount                | * Mounting local filesystems ...                                                                      [ ok ]ount                |
urandom                   | * Initializing random number generator ...
swap                      | * Activating swap devices ...                                                                         [ ok ]m                   |
bootmisc                  | * Creating user login records ...
procfs                    | * Mounting USB device filesystem [usbfs] ...                                                          [ ok ]                    |                                                                                                       [ ok ]sc                  |
procfs                    |mount: usbfs already mounted or /proc/bus/usb busy
procfs                    |mount: according to mtab, usbfs is already mounted on /proc/bus/usb
bootmisc                  | * Cleaning /var/run ...                                                                               [ !! ]                    |                                                                                                       [ ok ]sc                  |
bootmisc                  | * Wiping /tmp directory ...                                                                           [ ok ]sc                  |
keymaps                   | * Setting keyboard mode [UTF-8] ...
net.lo                    | * Bringing up interface lo                                                                            [ ok ]s                   |
keymaps                   | * Loading key mappings [us] ...                                                                       [ ok ]s                   |
net.lo                    | *   127.0.0.1/8 ...                                                                                   [ ok ]                    |
net.lo                    | *   Adding routes
net.lo                    | *     127.0.0.0/8 via 127.0.0.1 ...                                                                   [ ok ]                    |
INIT: Entering runlevel: 3
udev                      | * Starting udevd ...
udev                      | * start-stop-daemon: /sbin/udevd is already running                                                   [ !! ]                    |
udev                      | * start-stop-daemon: 1 process refused to stop
udev                      | * ERROR: udev failed to start
virtualbox-guest-additions| * Starting VirtualBox guest additions ...
virtualbox-guest-additions| *   Loading kernel modules and creating devices
net.eth0                  | * Bringing up interface eth0
syslog-ng                 | * Starting syslog-ng ...
virtualbox-guest-additions| *   Starting the vboxadd system service
syslog-ng                 | * start-stop-daemon: /usr/sbin/syslog-ng is already running
syslog-ng                 | * Failed to start syslog-ng                                                                           [ !! ]-ng                 |
syslog-ng                 | * ERROR: syslog-ng failed to start                                                                    [ ok ]lbox-guest-additions|
netmount                  | * Mounting network filesystems ...                                                                    [ ok ]nt                  |
sshd                      | * Starting sshd ...
sshd                      | * start-stop-daemon: /usr/sbin/sshd is already running
vixie-cron                | * Starting vixie-cron ...                                                                             [ !! ]                    |
sshd                      | * ERROR: sshd failed to start
vixie-cron                | * start-stop-daemon: /usr/sbin/cron is already running                                                [ !! ]cron                |
vixie-cron                | * ERROR: vixie-cron failed to start
net.eth0                  | *   null ...                                                                                          [ ok ]h0                  |
net.br0                   | * Bringing up interface br0

This is gentoo-lxc-guest.unknown_domain (Linux x86_64 2.6.32-gentoo) 10:22:57

gentoo-lxc-guest login: 

Expected Results:  
Now when I do things properly:
localhost lxc # rm -rf /etc/lxc/guest_1
localhost lxc # lxc-create -n guest_1 -f guest_1.conf 
localhost lxc # ls -al /etc/lxc/guest_1/config 
-rw-r--r-- 1 root root 877 Jan 20 10:22 /etc/lxc/guest_1/config
localhost lxc # lxc-start -n guest_1
INIT: version 2.87 booting
Loading /lib64/rc/console/keymap

   OpenRC 0.6.0 is starting up Gentoo Linux (x86_64)

 * Mounting /proc ...                                                                                                       [ ok ]
 * Caching service dependencies ...                                                                                         [ ok ]
 * Setting hostname to gentoo-lxc-guest ...                                                                                 [ ok ]
 * Configuring kernel parameters ...                                                                                        [ ok ]
 * Creating user login records ...                                                                                          [ ok ]
 * Cleaning /var/run ...                                                                                                    [ ok ]
 * Wiping /tmp directory ...                                                                                                [ ok ]
 * Setting terminal encoding [UTF-8] ...
/etc/init.d/termencoding: line 31: /dev/tty5: Operation not permitted
/etc/init.d/termencoding: line 31: /dev/tty6: Operation not permitted
/etc/init.d/termencoding: line 31: /dev/tty7: Operation not permitted
/etc/init.d/termencoding: line 31: /dev/tty8: Operation not permitted
/etc/init.d/termencoding: line 31: /dev/tty9: Operation not permitted
/etc/init.d/termencoding: line 31: /dev/tty10: Operation not permitted
/etc/init.d/termencoding: line 31: /dev/tty11: Operation not permitted
/etc/init.d/termencoding: line 31: /dev/tty12: Operation not permitted                                                      [ ok ]
 * Setting keyboard mode [UTF-8] ...
Couldn't open /dev/tty1
Couldn't open /dev/tty2
Couldn't open /dev/tty3
Couldn't open /dev/tty4
Couldn't open /dev/tty5
Couldn't open /dev/tty6
Couldn't open /dev/tty7
Couldn't open /dev/tty8
Couldn't open /dev/tty9
Couldn't open /dev/tty10
Couldn't open /dev/tty11
Couldn't open /dev/tty12                                                                                                    [ ok ]
 * Loading key mappings [us] ...                                                                                            [ ok ]
 * Starting network                                                                                                         [ ok ]
 * Adding static routes ...                                                                                                 [ ok ]
 * Initializing random number generator ...                                                                                 [ ok ]
INIT: Entering runlevel: 3
 * Mounting network filesystems ...                                                                                         [ ok ]
 * Starting syslog-ng ...
Jan 20 10:22:55 gentoo-lxc-guest syslog-ng[325]: syslog-ng starting up; version='3.0.4'                                     [ ok ]
 * Starting sshd ...
Jan 20 10:22:56 gentoo-lxc-guest sshd[339]: Server listening on 0.0.0.0 port 22.                                            [ ok ]
 * Starting local ...                                                                                                       [ ok ]


This is gentoo-lxc-guest.unknown_domain (Linux x86_64 2.6.32-gentoo) 10:22:57

gentoo-lxc-guest login:
Comment 1 John M. Drescher 2010-01-20 15:47:15 UTC
I am told (from the new lxc-users mailing list) the following patch fixes this issue:

http://lxc.git.sourceforge.net/git/gitweb.cgi?p=lxc/lxc;a=commit;h=f2ae79a04567fb8c1181f4d3331d2b7a48889cf3

I am also told 0.6.5 is supposed to be released this week and it will include the patch.
Comment 2 Diego Elio Pettenò (RETIRED) gentoo-dev 2010-01-26 17:11:19 UTC
That patch is already in 0.6.4-r2. 0.6.5 is out but it's not working right for me so I haven't committed it yet.
Comment 3 John M. Drescher 2010-01-26 17:24:10 UTC
This error occurred when I was using 0.6.4-r2.