Running kill -9 followed by a process ID sends SIGTERM, which the process can catch to perform cleanup before exiting.