[lxc-users] How set lxc.init_cmd?
Lao Andy
yjfpb04 at gmail.com
Mon Aug 21 23:14:00 UTC 2017
On Mon, Aug 21, 2017 at 10:39 PM, Serge E. Hallyn <serge at hallyn.com> wrote:
>
> Quoting 加油站加 (yjfpb04 at gmail.com):
> > Hi folks,
> >
> > Could anyone kindly tell me how to modify the init_cmd?
> >
> > I tried:
> > root at bob-VirtualBox:~# lxc config set aaaa lxc.init.cmd /init
> > error: Bad key: lxc.init.cmd
> > root at bob-VirtualBox:~# lxc config set aaaa lxc.init_cmd /init
> > error: Bad key: lxc.init_cmd
> > root at bob-VirtualBox:~# lxc --version
> > 2.16
> > root at bob-VirtualBox:~# lxd --version
> > 2.16
>
> You can set it in raw.lxc.
>
Thanks, it works.
By the way, how to set multiple raw.lxc lines?
I set two different raw.lxc, but only one setting was saved!
lxc config set mycontainer raw.lxc lxc.init_cmd=/init
lxc config set mycontainer raw.lxc lxc.init_gid=0
root at bob-VirtualBox:~# lxc config show mycontianer
architecture: x86_64
config:
environment.HOME: /
raw.lxc: lxc.init_gid=0
security.privileged: "true"
volatile.base_image:
29785fadd59256be64aee04ff4755e9f05c2fc421b8a9a8b07223abf9b86c7c9
volatile.eth0.hwaddr: 00:16:3e:d8:5a:51
volatile.last_state.idmap: '[]'
volatile.last_state.power: RUNNING
devices:
root:
path: /
pool: default
type: disk
ephemeral: false
profiles:
- default
stateful: false
description: ""
Regards,
Andy
More information about the lxc-users
mailing list