I treid to use nohup in python on cluster but failed. My code is here below:
import os path = "/ldfssz1/SP_MSI/USER/" os.system("nohup sh "+ path + "myjobs.sh &") Cluster only returns this:
nohup: ignoring input and appending output to `nohup.out' There were no pid returns and job command returns nothing. Can anyone gives me some idea what's going on here? Thank you very much!
nohupin this circumstance? It doesn't do anything useful at all.nohupdoes exactly two things: (1) it redirects any of stdin, stdout and stderr that would otherwise be going to a TTY; and (2) it turns off propagation of HUP signals (which are only TURNED ON in the first place for interactive shells, andos.system()creates noninteractive ones exclusively).sh myjobs.sh </dev/null >nohup.out 2>nohup.out &does exactly the same thing, withoutnohupinvolved. But even then, that's a bunch of needless complexity, because there's no reason to involve an extra shell either.&is absolutely not correct. That would make the exact string&be passed as an argument tomyjobs.sh.