My google-foo is failing me and I can't seem to find documentation that explains what I'm doing wrong :/
I have a number of LXC/LXD containers running on an ubuntu 16.04 server.
I try to script creating new containers with something like the following:
Running this script gives:
How ever the group exists after the script finishes and I can run the following:
If I do a groupadd instead of groupmod in my script then the awesomelxc group is added, but so is ubuntu, only at the next available GID.
What gives? When are the ubuntu group and ubuntu user provisioned? And why can I not script both the lxc launch and the lxc exec commands in the same script?
I have a number of LXC/LXD containers running on an ubuntu 16.04 server.
I try to script creating new containers with something like the following:
Code:
#!/bin/bash
set -ex
lxc launch 'ubuntu:16.04' awesomelxc
lxc exec --mode=non-interactive awesomelxc -- groupmod -n awesomegrp ubuntu
Code:
+ lxc launch ubuntu:16.04 awesomelxc
Creating awesomelxc
Starting awesomelxc
+ lxc exec --mode=non-interactive awesomelxc -- groupmod -n awesomegrp ubuntu
groupmod: group 'ubuntu' does not exist
Code:
lxc exec --mode=non-interactive awesomelxc -- groupmod -n awesomegrp ubuntu
What gives? When are the ubuntu group and ubuntu user provisioned? And why can I not script both the lxc launch and the lxc exec commands in the same script?