Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Job hangs until timeout if command starts a program that doesn't finish #67

Closed
ragnarak54 opened this issue Jun 27, 2020 · 5 comments
Closed

Comments

@ragnarak54
Copy link

I'm trying to use this as a way to update a continuously running Python application on my remote server. The sequence of commands I'd like to run is:

pkill -f 'python filename.py'
git pull
nohup python filename.py &

This all works fine, and the entire process executes successfully. However, the Github job will say that the action step is pending until the timeout limit is reached, at which point it "fails." With a Python script that runs and finishes, the job correctly succeeds and finishes. I thought it may have been because the Python script didn't exit, which made it think I could have more commands waiting to be executed afterward, which is why I added the nohup. Unfortunately, no combination of running in the background and additional commands after running the file (which also successfully execute) has made the Github job realize that it is finished.

@alelevinas
Copy link

same issue here

@flancer64
Copy link

@ragnarak54 , try this:

nohup python filename.py > ./output.log 2>&1 &

@PKlempe
Copy link

PKlempe commented Aug 29, 2020

@flancer64

nohup python filename.py > ./output.log 2>&1 &

This worked perfectly. Thank you very much! ❤

EDIT: For everyon else having this problem. Its probably better to pipe the output into /dev/null instead of having a file which grows over time.

@appleboy
Copy link
Owner

I think this issue should be closed. Thanks.

@Ciel-azure
Copy link

@flancer64 perfectly work. thank you !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants