Updated init script to check for running processes