def open_pid():
# Get the PID of this process
# Exit if a version of the script is already running
if os.path.isfile(PID_FILE):
print_and_log("PID already open, exiting script", error=True)
sys.exit(1)
else:
# Create the lock file for the script
pid = str(os.getpid())
open(PID_FILE, 'w').write(pid)
评论列表
文章目录