You can move any shutdown-related cleanup to its own subroutine, if you haven't already done so, and let signalHandler()
call that cleanup sub and then simply exit
.
Then edit your start/stop script to send SIGALRM instead. SIGALRM will interupt the sleep. If your script is edited to catch this, everything will be stopped at once.
Further reading: sleep()