fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fab-user] sudo and background task


From: webmaster
Subject: [Fab-user] sudo and background task
Date: Tue, 9 Jun 2009 21:50:07 +0200

Hi, 

I'm trying to use fabric to deploy my django site. It needs to start some
servers as deamon, (using &), but this makes sudo hang.
My current, far from optimal solution is to spawn a thread, that joins the
main thread with a 1 sec timeout:
-----------------
from threading import Thread
class sudobreak(Thread):
  def __init__ (self):
    Thread.__init__(self)
  def run(self):
     sudo("nohup /run_server.sh", user="sites")
t = sudobreak()
t.start()
t.join(1)
-----------------
Obviously, this solution is anything but optimal :/ (but it works!)

Is there any solution to this?

Thanx, 
Colin





reply via email to

[Prev in Thread] Current Thread [Next in Thread]