LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-25-2018, 12:50 PM   #1
masayk
LQ Newbie
 
Registered: Apr 2013
Distribution: Slackware
Posts: 5

Rep: Reputation: Disabled
LXC: Failed to talk to init daemon and other errors


Hello!

I have an issue with LXC. I create under root a new container with command "lxc-create -n c7 -t download", then choose centos-7-amd64. It installs it. After that, if I do not setup network settings, I can lunch it with "lxc-start -d -n c7" command and even attach to it, but I cannot almost do anything.

For example, if I try reboot:
Quote:
root@c7:~# reboot
Failed to talk to init daemon.
If I set up network settings in the config file, than it doesn't start after that:
Quote:
lxc-start 20180225183041.667 ERROR lxc_network - network.c:setup_hw_addr:2680 - Failed to perform ioctl: Cannot assign requested address
lxc-start 20180225183041.667 ERROR lxc_network - network.c:lxc_setup_netdev_in_child_namespaces:2821 - Failed to setup hw address for network device "eth0"
lxc-start 20180225183041.667 ERROR lxc_network - network.c:lxc_setup_network_in_child_namespaces:2963 - failed to setup netdev
lxc-start 20180225183041.667 ERROR lxc_conf - conf.c:lxc_setup:3097 - failed to setup the network for 'c7'
lxc-start 20180225183041.667 ERROR lxc_start - start.c:do_start:1020 - Failed to setup container "c7".
lxc-start 20180225183041.667 ERROR lxc_sync - sync.c:__sync_wait:57 - An error occurred in another process (expected sequence number 5)
lxc-start 20180225183041.692 ERROR lxc_container - lxccontainer.c:wait_on_daemonized_start:754 - Received container state "ABORTING" instead of "RUNNING"
lxc-start 20180225183041.692 ERROR lxc_start - start.c:__lxc_start:1530 - Failed to spawn container "c7".
lxc-start 20180225183041.692 ERROR lxc_start_ui - tools/lxc_start.c:main:368 - The container failed to start.
lxc-start 20180225183041.692 ERROR lxc_start_ui - tools/lxc_start.c:main:370 - To get more details, run the container in foreground mode.
lxc-start 20180225183041.692 ERROR lxc_start_ui - tools/lxc_start.c:main:372 - Additional information can be obtained by setting the --logfile and --logpriority options.
My host system is Slackware64-current.

Container config file:
Quote:
root@lion:/var/lib/lxc/c7# cat config
# Template used to create this container: /usr/share/lxc/templates/lxc-download
# Parameters passed to the template: --flush-cache
# Template script checksum (SHA-1): 01d100d3f1129082777c82a0e3a66adcaeb5c37f
# For additional config options, please look at lxc.container.conf(5)

# Uncomment the following line to support nesting containers:
#lxc.include = /usr/share/lxc/config/nesting.conf
# (Be aware this has security implications)


# Distribution configuration
lxc.include = /usr/share/lxc/config/centos.common.conf
lxc.arch = x86_64

# Container specific configuration
lxc.rootfs = /var/lib/lxc/c7/rootfs
lxc.rootfs.backend = dir
lxc.utsname = c7

# Network configuration
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br0
lxc.network.name = eth0
lxc.network.hwaddr = 01:26:3e:3c:f5:c3
lxc.network.mtu = 1500
Can you give me an advice how to fix it? Thank you!
 
Old 02-25-2018, 07:57 PM   #2
chris.willing
Member
 
Registered: Jun 2014
Location: Brisbane, Australia
Distribution: Slackware,LFS
Posts: 915

Rep: Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619
Quote:
Originally Posted by masayk View Post
Hello!

I have an issue with LXC. I create under root a new container with command "lxc-create -n c7 -t download", then choose centos-7-amd64. It installs it. After that, if I do not setup network settings, I can lunch it with "lxc-start -d -n c7" command and even attach to it, but I cannot almost do anything.
What do you mean by
Quote:
if I do not setup network settings
The network seems already set up and when I executed similar commands, it all ran as expected:
Quote:
chris@d6:~$ sudo lxc-start -n c7
chris@d6:~$ sudo lxc-attach -n c7
root@c7:/# ping www.uq.edu.au
PING www.uq.edu.au (130.102.131.123) 56(84) bytes of data.
64 bytes from www.uq.edu.au (130.102.131.123): icmp_seq=1 ttl=245 time=7.10 ms
^C
--- www.uq.edu.au ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 7.103/7.103/7.103/0.000 ms
root@c7:/# reboot
root@c7:/# chris@d6:~$
 
Old 02-25-2018, 08:34 PM   #3
chris.willing
Member
 
Registered: Jun 2014
Location: Brisbane, Australia
Distribution: Slackware,LFS
Posts: 915

Rep: Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619
I just remembered that I already had some host side network preparation already done so that networking for new containers just works. Have a look at http://www.darlo.tv/lxc-14.2/network...slackware.html - set and forget (I did). The article mentions unprivileged containers but that's just because it's part of a series - it works for privileged containers too.

chris
 
Old 02-27-2018, 12:34 PM   #4
masayk
LQ Newbie
 
Registered: Apr 2013
Distribution: Slackware
Posts: 5

Original Poster
Rep: Reputation: Disabled
I am sorry for long time no answer. I just got sick.
Chris, thank you for your advice and very useful article there. I will try to follow it.

And by "What do you mean by 'if I do not setup network settings'" I meant about configuring network settings in the lxc's config file:
Quote:
# Network configuration
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br0
lxc.network.name = eth0
lxc.network.hwaddr = 01:26:3e:3c:f5:c3
lxc.network.mtu = 1500
If you don't mind, I will ask here if I have problems with instructions in your article. Thank you again!
 
Old 02-27-2018, 04:05 PM   #5
chris.willing
Member
 
Registered: Jun 2014
Location: Brisbane, Australia
Distribution: Slackware,LFS
Posts: 915

Rep: Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619
Quote:
Originally Posted by masayk View Post
# Network configuration
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br0
lxc.network.name = eth0
lxc.network.hwaddr = 01:26:3e:3c:f5:c3
lxc.network.mtu = 1500
That (or similar) is what I have in my configuration. I didn't set it up explicitly; it was derived, when the container was first created, from settings I've made in /etc/lxc/default.conf. It has:
Code:
chris@d6:~$ cat /etc/lxc/default.conf
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = lxcbr0
lxc.network.name = eth0
lxc.network.hwaddr = 00:16:3e:xx:xx:xx
chris@d6:~$
which results in a config file containing:
Code:
...
# Network configuration
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = lxcbr0
lxc.network.name = eth0
lxc.network.hwaddr = 00:16:3e:8c:31:28
The main difference is the name of the nertwork.link (the host network interface to attach to) which is lxcbr0 in my case, br0 in your case. Either is OK provided it exists in the host.

BTW an alternative location for that configuration is ~/.config/lxc/default.conf

chris
 
Old 03-12-2018, 01:18 PM   #6
masayk
LQ Newbie
 
Registered: Apr 2013
Distribution: Slackware
Posts: 5

Original Poster
Rep: Reputation: Disabled
Hello, Chris!

I did everything according to your article and now I can run container with user privileges. But I still cannot do anything in my guest system (just like when I run lxc containers under root) and get messages like:

Quote:
bash-4.4$ lxc-start -n m4
bash-4.4$ lxc-attach -n m4
bash-4.2# su -
[root@m4 ~]# export LC_ALL=en_US
[root@m4 ~]# reboot
Failed to talk to init daemon.
[root@m4 ~]# systemctl status httpd
Failed to get D-Bus connection: No such file or directory
 
Old 03-12-2018, 05:33 PM   #7
chris.willing
Member
 
Registered: Jun 2014
Location: Brisbane, Australia
Distribution: Slackware,LFS
Posts: 915

Rep: Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619
Quote:
Originally Posted by masayk View Post
Hello, Chris!

I did everything according to your article and now I can run container with user privileges. But I still cannot do anything in my guest system (just like when I run lxc containers under root) and get messages like:
The reason to point to that article was to suggest a networking setup rather than all the stuff about creating unprivileged containers (although good to know that part of it still works).

Since you have the same problem with a second container, suspicion next falls on the host system - is it a stock 14.2 system (all packages installed, no funny business in /etc/rc.d/* files, etc.)?

In the meantime you could try running the lxc-start in the foreground e.g.
Code:
sudo lxc-start -n c7 -F
or even with a log file e.g.
Code:
sudo lxc-start -n c7 -F -o /tmp/c7.log
My resulting log file was empty - I presume because there were no errors in my case. Running the container in the foreground shows lots more extra stuff as the container starts up. This mode ends with a login prompt which won't work unless you previously set up a root password for the container, so use lxc-attach as before from a different terminal.

Hopefully one of these options may give some indication of what's going on.

chris
 
Old 03-13-2018, 02:27 PM   #8
masayk
LQ Newbie
 
Registered: Apr 2013
Distribution: Slackware
Posts: 5

Original Poster
Rep: Reputation: Disabled
Hello, Chris!

My log is also empty, but output of your command is

Quote:
root@lion:~# lxc-start -n m7 -F
Failed to mount cgroup at /sys/fs/cgroup/systemd: Operation not permitted
[!!!!!!] Failed to mount API filesystems, freezing.
Freezing execution.
I use Slackware-current.

It (seems) started to work under root and under user after I've done:

Quote:
mkdir -p /sys/fs/cgroup/systemd
mount -t cgroup -o none,name=systemd systemd /sys/fs/cgroup/systemd
chown 100000:100000 -R /sys/fs/cgroup/systemd/
But it worked without entering those commands earlier. So, do you know where those commands should be placed? I am not sure if the last command is necessary here.

By the way, I found solution here:
https://j2h2.com/entry/alpine-linux-...ainers-round-2

Last edited by masayk; 03-13-2018 at 02:49 PM.
 
Old 03-13-2018, 05:05 PM   #9
chris.willing
Member
 
Registered: Jun 2014
Location: Brisbane, Australia
Distribution: Slackware,LFS
Posts: 915

Rep: Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619
Interesting. I don't see that error in 14.2 where there is no /sys/fs/cgroup/systemd directory.

In 14.2, lxc is at version 2.0.1 whereas current has lxc-2.0.9 - maybe it's just a version issue ...

Perhaps it's worth raising this issue in the "Requests for -current" thread to raise awareness there, just in case Pat & crew stopped watching this thread?

chris
 
  


Reply

Tags
lxc, slackware64-current, systemd



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to start the talk daemon? kris108 Slackware 12 01-31-2013 12:27 AM
Using the talk daemon kaplan71 Linux - General 1 05-22-2010 06:47 AM
talk daemon running but not accepting connections ikjeft01 Red Hat 2 03-29-2010 09:19 PM
talk talk daemon configuration ananthkrk Red Hat 1 10-16-2004 11:45 AM
Can't run talk daemon ust Linux - General 3 05-24-2004 04:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration