上午嘗試使用以下nohup命令使用結構啓動celerycam進程。不幸的是,沒有任何事情發生,手動使用相同的命令,我可以啓動過程,但不通過結構。任何建議我如何解決這個問題?使用結構nohup啓動後臺進程
def start_celerycam():
'''Start celerycam daemon'''
with cd(env.project_dir):
virtualenv('nohup bash -c "python manage.py celerycam --logfile=%scelerycam.log --pidfile=%scelerycam.pid &> %scelerycam.nohup &> %scelerycam.err" &' % (env.celery_log_dir,env.celery_log_dir,env.celery_log_dir,env.celery_log_dir))
我嘗試了一堆不同的方法來做到這一點。這是最後工作的那個。 – 2012-08-15 21:52:25
我試過了,它的工作原理!但是當我在'cmd'中添加nohup時,仍然無法工作,所以我只刪除了nohup和'&'。 – Vimos 2014-01-26 03:39:30
非常感謝,解決了我所有的問題 – Cmag 2015-01-10 05:04:53