sreenivas
sreenivas

Reputation: 2257

Get the PID of a process started with fabric run command

How to get the PID of the processes started by the fabric run command. I want to keep track of the PID, in case I want to kill the process. Any better way of dealing with this case?

Upvotes: 5

Views: 1850

Answers (1)

C Jarrett
C Jarrett

Reputation: 51

This should work because the shell opened by the run command is still open when the echo portion of the command is run:

run("mycommand & echo $!")

Upvotes: 5

Related Questions