Add custom startup and shutdown functions.