crond中flock启动daemon进程不释放问题
1、以daemon方式启动rsync为例子,文件为 /tmp/restart_rsync.py# -*- coding: utf-8 -*-import osif __name__ == "__main__": #杀掉进程 pid_path = "/var/run/rsyncd.pid" if os.path.exists(pid_path): f = file(pid_path,"r")