I want to run simple shell script when lxc container is stopped.
I try to use
lxc.hook.post-stop = script
I want to execute
in my lxc container config file,
but the script is not being invoked when the lxc container is stopped.
Is there any other way to achieve the same.
my system details: Ubuntu : 16.04 LTS, LXC version : 2.0.8
the shell script contains:
#!/bin/bash
##Start the container if it is stopped
lxc-start -n nameofthecontainer
My intention is to keep the container running all the time, hence looking for some notification when the container is stopped so that I can restart.
Thank you for the help.