I'm trying to do this:
test.sh
#!/bin/bash
/mnt/.../test2.sh&
test2.sh
#!/bin/bash
sleep 10
echo "test" > /root/test.txt
104.conf
lxc.hook.pre-start: /mnt/.../test.sh
In this case, the container wait for 15 seconds, creates a file, and then starts.
104.conf
lxc.hook.pre-start: /mnt/.../test2.sh&
In this case, container doesn't start, but the script is executed.
Is it possible to run the script on the host after the container starts?
test.sh
#!/bin/bash
/mnt/.../test2.sh&
test2.sh
#!/bin/bash
sleep 10
echo "test" > /root/test.txt
104.conf
lxc.hook.pre-start: /mnt/.../test.sh
In this case, the container wait for 15 seconds, creates a file, and then starts.
104.conf
lxc.hook.pre-start: /mnt/.../test2.sh&
In this case, container doesn't start, but the script is executed.
Is it possible to run the script on the host after the container starts?
Last edited: