View previous topic :: View next topic |
Author |
Message |
pa4wdh l33t
Joined: 16 Dec 2005 Posts: 812
|
Posted: Mon Jan 22, 2018 10:03 pm Post subject: [SOLVED] Problem running lxc containers |
|
|
Hi All,
I'm using a quite a few linux containers, and after an update i can't start them anymore. The system is running gentoo, and so are the systems in the containers.
The command i'm using for testing is: lxc-start -F -o log -L consolelog -n lxc-dns -f lxc.conf
The consolelog stays empty, the log shows some information:
Code: | lxc-start 20180122214910.845 ERROR lxc_conf - conf.c:mount_entry:1815 - No such file or directory - Failed to mount "shm" on "/var/lib/lxc/rootfs//dev/shm"
lxc-start 20180122214910.846 ERROR lxc_conf - conf.c:lxc_setup:3127 - failed to setup the mount entries for 'lxc-dns'
lxc-start 20180122214910.846 ERROR lxc_start - start.c:do_start:1020 - Failed to setup container "lxc-dns".
lxc-start 20180122214910.846 ERROR lxc_sync - sync.c:__sync_wait:57 - An error occurred in another process (expected sequence number 5)
lxc-start 20180122214911.401 ERROR lxc_start - start.c:__lxc_start:1530 - Failed to spawn container "lxc-dns".
lxc-start 20180122214911.153 ERROR lxc_cgfsng - cgroups/cgfsng.c:recursive_destroy:1261 - Error destroying /sys/fs/cgroup/openrc//lxc/lxc-dns
lxc-start 20180122214911.156 ERROR lxc_start_ui - tools/lxc_start.c:main:368 - The container failed to start.
lxc-start 20180122214911.156 ERROR lxc_start_ui - tools/lxc_start.c:main:372 - Additional information can be obtained by setting the --logfile and --logpriority options.
|
The mount entries in lxc.conf are:
Code: | lxc.mount.entry=proc /srv/lxc/lxc-dns/container/proc proc nodev,noexec,nosuid 0 0
lxc.mount.entry=shm /srv/lxc/lxc-dns/container/dev/shm tmpfs rw,nosuid,nodev,noexec,relatime 0 0
lxc.mount.entry=run /srv/lxc/lxc-dns/container/run tmpfs rw,nosuid,nodev,relatime,mode=755 0 0
lxc.mount.entry=/usr/portage /srv/lxc/lxc-dns/container/usr/portage none defaults,bind 0 0
lxc.mount.entry=/var/tmp/portage /srv/lxc/lxc-dns/container/var/tmp/portage none defaults,bind 0 0
|
What's confusing me is that the error message refers to /var/lib/lxc/rootfs//dev/shm but i'm not using that location at all.
I tried to comment out the shm mount entry, in that case the problem starts with the next entry. Besides that, they are both needed inside the container.
I also found a reference to a setting "lxc.autodev = 0" and added that to my lxc.conf, in that case startup works, but the container does only run an agetty process, and does not seem go through the normal startup process to start ssh, and other daemons. The problem there is that console and network access do not work, so i can't see what's going on.
Does anybody have a troubleshoting hint ? _________________ The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world
My shared code repository: https://code.pa4wdh.nl.eu.org
Music, Free as in Freedom: https://www.jamendo.com |
|
Back to top |
|
|
pa4wdh l33t
Joined: 16 Dec 2005 Posts: 812
|
Posted: Tue Jan 23, 2018 10:38 am Post subject: |
|
|
The problem has been solved. There actually where two problems.
The first was shm, which shouldn't be mounted from the containers' config. When i started a container i got no console, that was due to a configuration error, effectively denying all access to devices including /dev/null, which prevented most programs from running. _________________ The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world
My shared code repository: https://code.pa4wdh.nl.eu.org
Music, Free as in Freedom: https://www.jamendo.com |
|
Back to top |
|
|
mimosinnet l33t
Joined: 10 Aug 2006 Posts: 713 Location: Barcelona, Spain
|
Posted: Wed May 09, 2018 12:40 pm Post subject: |
|
|
pa4wdh wrote: | The first was shm, which shouldn't be mounted from the containers' config. |
I had to mount shm from the container's config after postgresql was not able to start in the container with this message in /var/lib/postgresql/10/data/postmaster.log:
Code: | FATAL: could not open shared memory segment "/PostgreSQL.1822393874": Permission denied |
postgresql started after adding this line in the container's config:
Code: | lxc.mount.entry = shm dev/shm tmpfs rw,nosuid,nodev,noexec,relatime,create=dir 0 0 |
Do you mean that shm should not be mounted in the containers' fstab?
Cheers! _________________ Please add [solved] to the initial post's subject line if you feel your problem is resolved.
Take care of the community answering unanswered posts. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|