Incomplete, needs to be expanded. Please help to fill the gaps or discuss the issue on the talk page
Using mythshutdown to block shutdown
Mythshutdown can be used to block an automatic shutdown. Since 0.21 it is possible to call mythshutdown --lock for each script so that shutdown will remain blocked until the last script has terminated and called mythshutdown --unlock.
# Unlock if the script is terminated for any reason
trap "/usr/local/bin/mythshutdown --unlock" 0 SIGHUP SIGINT SIGQUIT SIGABRT SIGKILL SIGALRM SIGSEGV SIGTERM
# Lock shutdown
# Do script stuff
See, also, Mythwelcome.