[lxc-users] lxc.hook.start not working?

Anjali Kulkarni anjali at juniper.net
Wed Mar 4 19:52:31 UTC 2015


Thanks, that does not work either.
Is this broken?

On 3/2/15, 10:22 PM, "Fajar A. Nugraha" <list at fajar.net> wrote:

>On Tue, Mar 3, 2015 at 1:15 PM, Tamas Papp <tompos at martos.bme.hu> wrote:
>>
>>
>>
>> On March 3, 2015 12:03:06 AM Anjali Kulkarni <anjali at juniper.net> wrote:
>>
>>> I tried to add a lxc.hook.start, and pointing to a simple script.
>>> However, on trying to start the container I get this error:
>>>
>>> lxc-start -n c8
>>> lxc-start: invalid sequence number 1. expected 4
>>> lxc-start: failed to spawn Œc8'
>>> lxc-start: Device or resource busy - cgroup_rmdir: failed to delete
>>> /cgroup/lxc/c8
>>>
>>> This is all I added in the config:
>>>
>>> lxc.hook.start = /var/lib/lxc/c8/rootfs/home/ubuntu/tmp.sh
>>>
>>> Also, the tmp.sh is definitely there in container rootfs, so why does
>>>not
>>> not work?
>>
>>
>> It has not yo be under the rootfs, but anywhere.
>> The right keyword is lxc.hook.pre-start or something else based on your
>> needs. Check the manual for the options.
>
>
>man lxc.container.conf
>
>       lxc.hook.start
>              A hook to be run in the container's namespace
>immediately before executing the container's init. This requires the
>program to be available in the  con‐
>              tainer.
>
>
>@Anjali: assuming your file is executable, try
>
>lxc.hook.start = /home/ubuntu/tmp.sh
>
>-- 
>Fajar



More information about the lxc-users mailing list