<div dir="ltr"><div class="gmail_extra">The rewording I have in mind would be to sharply distinguish starting/stopping *applications* from starting/stopping their supervision tree if there is any, and from callback invocation. Also, to make more explicit the existence of library and regular/active applications.</div><div class="gmail_extra"><br></div><div class="gmail_extra">For example, define that starting an application means (needs review):</div><div class="gmail_extra"><br></div><div class="gmail_extra">1. (Guessing) The application controller makes sure all applications specified in the application resource file are started.</div><div class="gmail_extra">2. The application controller spawns an application master process for the application.</div><div class="gmail_extra">3. The application master becomes the group leader of all the application processes.</div><div class="gmail_extra">4. (Regular applications only) The application master calls `start/2` in the callback module if there is one, and stores the returned <span id="m_7599124757192073265:e1.1">PID</span> for later use.</div><div class="gmail_extra"><br></div><div class="gmail_extra">(Don't know if firing <span id="m_7599124757192073265:e1.2">SASL</span> events is worth being documented, I see generally they don't seem to be.)</div><div class="gmail_extra"><br></div><div class="gmail_extra">In particular, you know who the group leader is when `start/2` runs. And it is obvious that there are things going on regardless of the existence of a callback module.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Stopping an application means (needs review):</div><div class="gmail_extra"><br></div><div class="gmail_extra">1. (Regular applications only) The application master shuts down the top supervisor using the <span id="m_7599124757192073265:e1.3">PID</span> stored when the application started.</div><div class="gmail_extra">2. (Regular applications only) The application master invokes the `stop/1` callback of the application callback module.</div><div class="gmail_extra">3. The application master process is shut down (by the application controller?).</div><div class="gmail_extra">4. <<Termination logic depending on the application type goes here>></div><div class="gmail_extra"><br></div><div class="gmail_extra">It could also be explicitly said that unless stated otherwise, from then on an "application" means a "regular application".</div><div class="gmail_extra"><br></div><div class="gmail_extra">Are there factual errors? Makes sense?</div><div class="gmail_extra"><br></div></div>