Add OnRun hook to servenv.