Moving a device from one app to another does not kill the previous container


#1

UPDATE: I believe this is expected behaviour with multicontainer – it just doesn’t match my use case.

I’ve been moving devices from one application to another and experiencing some unexpected behaviour. After some digging around, it looks like both our old container and our new container are running simultaneously on the same device after changing applications.

Here’s the log output after I moved from my Nick app to my Nick2 app:

22.03.18 15:11:02 (-0500) DOING THINGS IN Nick FROM COMMIT 95a7fb29fe9c13cf48d18716cd4930c140368149
22.03.18 15:11:05 (-0500) DOING THINGS IN Nick2 FROM COMMIT 95a7fb29fe9c13cf48d18716cd4930c140368149
22.03.18 15:11:05 (-0500) DOING THINGS IN Nick FROM COMMIT 95a7fb29fe9c13cf48d18716cd4930c140368149
22.03.18 15:11:08 (-0500) DOING THINGS IN Nick2 FROM COMMIT 95a7fb29fe9c13cf48d18716cd4930c140368149
22.03.18 15:11:08 (-0500) DOING THINGS IN Nick FROM COMMIT 95a7fb29fe9c13cf48d18716cd4930c140368149
22.03.18 15:11:11 (-0500) DOING THINGS IN Nick2 FROM COMMIT 95a7fb29fe9c13cf48d18716cd4930c140368149
22.03.18 15:11:11 (-0500) DOING THINGS IN Nick FROM COMMIT 95a7fb29fe9c13cf48d18716cd4930c140368149
22.03.18 15:11:14 (-0500) DOING THINGS IN Nick2 FROM COMMIT 95a7fb29fe9c13cf48d18716cd4930c140368149
22.03.18 15:11:14 (-0500) DOING THINGS IN Nick FROM COMMIT 95a7fb29fe9c13cf48d18716cd4930c140368149
22.03.18 15:11:17 (-0500) DOING THINGS IN Nick2 FROM COMMIT 95a7fb29fe9c13cf48d18716cd4930c140368149
22.03.18 15:11:17 (-0500) DOING THINGS IN Nick FROM COMMIT 95a7fb29fe9c13cf48d18716cd4930c140368149
22.03.18 15:11:20 (-0500) DOING THINGS IN Nick2 FROM COMMIT 95a7fb29fe9c13cf48d18716cd4930c140368149

Is this expected behaviour? I’m running Resin OS 2.9.6+rev1 (dev) and Supervisor Version 6.5.9. Do I need to update either to fix this issue?

UPDATE: With @imrehg’s help, I’ve updated to Resin OS 2.12.3+rev1 (dev) and Supervisor 7.1.14 , but still see the same issues.

Here’s the Dockerfile:

// Dockerfile
FROM resin/rpi-raspbian:jessie

# Set environment variables
ENV MAIDBOT_WS="/home/robot" \
    LC_ALL=C.UTF-8 \
    DEBIAN_FRONTEND=noninteractive

WORKDIR $MAIDBOT_WS

RUN apt-get update && \
    apt-get -y install --no-install-recommends --fix-missing procmail && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

ENTRYPOINT ["entry.sh"]
CMD ["loop_echo_inf"]

And the entry script:

// entry.sh
function loop_echo_inf()
{
	while true; do
		echo 'DOING THINGS IN' $RESIN_APP_NAME 'FROM COMMIT' $RESIN_APP_RELEASE;    
	sleep 3; # Change when swapping app
	done
}

# Grab the update lockfile
lockfile /tmp/resin/resin-updates.lock

echo "Starting device container"

$@

#5

Hi @nckswt, I think it was discussed elsewhere, that here the issue was having update lock on the old container, do I recall correctly? Once the lock was overridden, the old container was successfully expunged.