Re: [lxc-users] lxc-attach vs python3 attach_wait

2017-03-18 Thread Alexander Dreweke

Hi

after comparing the whole environment again, I found a difference in the
mounts. When using lxc-attach /dev/mqueue gets mounted although it's not
in the config for the container.

After adding
lxc.mount.entry=mqueue dev/mqueue mqueue rw,relatime,create=dir,optional 0 0

to the config, I now can start, stop systemd services through the python 
api as well.


I had a quick look at lxc-attach but could where /dev/mqueue gets mounted.

Best regards
Alexander
___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

[lxc-users] lxc-attach vs python3 attach_wait

2017-03-15 Thread Alexander Dreweke

Hi

I'm trying to script the creation on various LXC containers. Therefor I 
would like to execute a script that finalizes the container. But the 
script fails when it tries to interact with systemd, the error message 
reads "Failed to connect to bus: No such file or directory"


A minimal example, without a script, results in the same error:

container.attach_wait(
lxc.attach_run_command,
[ "/bin/systemctl", "enable", "systemd-networkd.service" ],
env_policy=lxc.LXC_ATTACH_CLEAR_ENV)

When I execute the same command via lxc-attach it succeeds:

lxc-attach -n test --clear-env -- /usr/bin/strace /bin/systemctl enable 
systemd-networkd.service


Am I missing an option for attach_wait?

I'm using LXC 2.0.7 and the according python3 bindings.

Best regards,
Alexander
___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users