简体   繁体   中英

Watchdog in python / subprocess

I'm looking to execute an application that then binds to a defined port if successful, and then poll it over http, if it fails, restart it (pretty much a single-process simple watchdog). Looking at subprocess , but a bit unsure as to how to continue. Can anyone point me on a path or something?

The process has no stdin, no stdout, and no stderr (all can be discarded). Just pretty much a loop that checks if it responds (via urllib/Requests?) then sleep 30 seconds.

I'm looking to execute an application

subprocess module........................

http://docs.python.org/3/library/subprocess.html#replacing-older-functions-with-the-subprocess-module

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM