publish example: exit cleanly on SIGINT, SIGTERM