I can always start my container successfully with:
fadedbee@host:~$ sudo lxc-start -n mycontainer
It used to start automatically, until I bound some directories on a local ZFS to it.
I added the following to /etc/rc.local:
/bin/date >> /var/log/mycontainer.log /bin/chmod a+r /var/log/mycontainer.log /usr/bin/lxc-start -o /var/log/mycontainer.log
-l INFO -n mycontainer > /var/log/mycontainer.stdout 2> /var/log/mycontainer.stderr &
The /var/log/mycontainer.log file is created, but only contains the date and nothing else.
I added the following to root's crontab:
@reboot /usr/bin/lxc-start -o /var/log/mycontainer.log -l INFO -n mycontainer
but that didn't produce any result either.
I strongly suspect that all of these things are happening before ZFS has finished. Adding a
sleep 30 ; to the cron entry didn't help.
What confuses me is that I get no log stderr, stdout or log output at all.
How can I make my container start automatically, or at least see log output?
*/5 * * * * /usr/bin/lxc-start -n mycontainer
to root's cron, but still it won't start. The same (sudo'd) command from the bash prompt works. The rest of root's cron entries are working as expected.