Container hangs on startup when lxc.hook.start-host script is calling lxc-info

I am trying to create additional iptables rules on container startup. I wanted to achieve it by using lxc.hook.start-host script. This script is calling lxc-info -n <container_name> -iH.
In this situation container hangs on lxc-start command. lxc-stop doesn’t work too. I needed to kill lxc-start command.

  • Is it ok to call lxc-info in start-host hook?
  • If it is ok how can I debug where it hangs/locks?
  • If it is not ok what is the best way to get ip address of a container in a hook. Can I get ip address by interface name in lxc.net.[i].script.up script?

Lxc version is 5.0.2