A question, are you using the resin-made base images? Because the INITSYSTEM variable only has effect on our own base images, obviously not for the external ones. From the code you shared with us seems you are using an upstream image, not a resin-provided one.
I’ve tried it out, and you are correct, that with INITSYSTEM=on
, application exiting won’t stop the container. So based on that and what you mentioned, I’d probably set up your application’s start with a systemd system file, and then you can set your own restart policy as well easily, and so on.
One side note, there’s an open issue for Debian Stretch using the INITSYSTEM
settings, so that won’t work at the momemnt, but we’re fixing it. Jessie works correctly, though, in case.