–rm is more trouble than it’s worth because when something is setup wrong the log contain can useful information.
What should change but has been buried in all this is the initial container should be marked started-once in the DB, and therefore be green instead of red.
OK I can understand this but just to clarify there is nothing wrong with using --rm on the initial command. It does not need to hang around?
Also understandable that you think marking this green instead of red is a good idea. Ok. But since the command starts the rancher/agent with no name it will be given some arbitrary name like thumping_einstein which will remain along with the new one you spawn called rancher-agent. Don’t you think this is somewhat confusing?