Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Ok here's a quick question. I have a debian server with sass (driven by ruby) installed. To compile a sass file to a css file, yo do:

sass --watch style.scss:style.css

If I run this on my server through a terminal. Is that process still running when I close the terminal? If not, how do I keep it running? And how do I stop it if I want to?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

If you want a process to be running even when you disconnect from a server, use nohup.

nohup sass --watch style.scss:style.css &

The & will start the job in the background. nohup makes sure that even when you log out, the process continues. Every output will be logged to nohup.out.

You can also have several output files for stdout and stderr:

nohup --watch style.scss:style.css > main.log 2> err.log &
share|improve this answer
1  
Wow! Thank you! How can I stop the process? –  tbleckert Jun 23 '11 at 10:17
    
I guess you would have to run ps aux | grep nohup | grep -v grep and then run kill PID where PID is the number in the second column. Haven't found a better way to do that yet. –  slhck Jun 23 '11 at 10:20
    
Oh ok thank you :) –  tbleckert Jun 23 '11 at 10:21
    
I've been using pkill sass to stop my processes (under Ubuntu 12.04). That worries me a little since it's not a delicate approach, but I'm the only person using my server and so far it hasn't killed anything unintended. –  Andy Giesler Nov 2 '12 at 16:54

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.