What is the order of execution for when an LXC container is started when it has both a mount point (bind mount in this case) and a hook script set?
Example lxc config:
I am trying to execute a command from the container hook script (hook.sh) at the "post-start" phase which depends on files contained within the bind mount point (mp0). This fails because at the time the hook script post-start phase is executed, the local mount point directory (/root/post-start.d in this example) does not exist.
I assume that the "post-start" phase does not wait for mount points to finish mounting before executing, is this true? At what point exactly does the "post-start" phase happen?
Example lxc config:
Code:
hostname: ct1
ostype: debian
arch: amd64
cores: 1
memory: 1024
swap: 1024
rootfs: local:100/vm-100-disk-0.raw,size=10G
onboot: 0
unprivileged: 1
mp0: /mnt/bindmounts/shared,mp=/root/post-start.d,ro=1
hookscript: local:snippets/hook.sh
I am trying to execute a command from the container hook script (hook.sh) at the "post-start" phase which depends on files contained within the bind mount point (mp0). This fails because at the time the hook script post-start phase is executed, the local mount point directory (/root/post-start.d in this example) does not exist.
I assume that the "post-start" phase does not wait for mount points to finish mounting before executing, is this true? At what point exactly does the "post-start" phase happen?