In safe_asterisk, there is a section where the script executes some startup scripts, located in /etc/asterisk/startup.d However, when you restart asterisk with "core restart now" or you go ahead and kill the asterisk process, these scripts that are so important do not get executed. The question is: where in the safe_asterisk script can I copy the whole loop so in any event, if Asterisk gets restarted, these scripts get properly executed. Otherwise there is no way to ensure that the finite-state machine starts from an known start point.