Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm currently working on a web project on uWSGI, it's quite a chore to keep typing the same command in the terminal everytime I want to start up uWSGI, so I made an executable script that will automatically run the process when I execute it.

It works, but the problem is, normally when I run uWSGI from the terminal manually (by typing in the commands), when I try to close the terminal window while the process is still running, it will prompt me if I want to terminate the process before closing the terminal. However, the terminal window that appears after I ran the executable script from GUI will not warn me when I accidentally close the window, and as a result the process will still be running in the background.

How can I make the script such that it will display a warning like it normally will when I try to close the terminal window when the process is still running?

share|improve this question

1 Answer 1

Just add the following line at the end of your script:

$SHELL
share|improve this answer
    
thank you very much for helping. I guess there's no way to do it.. the terminal window for the uwsgi that appears will still close without warning when I click on close, and the process still runs in the background, $SHELL only make the window prompt a warning after I end the uwsgi process by pressing Control+C, when the process is still running, no warning will appear when the window is closed. –  csharpnewbie Sep 12 '13 at 7:56
    
@csharpnewbie It's normal as long as the process is running in background. So it no longer has something to do with the terminal. So, if you close the terminal or if you don't close it, you don't affect with nothing the process that running in background. Or make it to not run in background if you prefer to be asked... –  Radu Rădeanu Sep 12 '13 at 8:07
    
oh. then there's no way to tie the process with the terminal such that it will display warning when the terminal window is to be closed? or to run the process in the foreground and not background? so that the process started by the terminal will terminate when the terminal window is closed? –  csharpnewbie Sep 12 '13 at 8:10
1  
@csharpnewbie As I said, make it to not run in background if you prefer to be asked... –  Radu Rădeanu Sep 12 '13 at 8:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.