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.

I am using Sass on a CentOS 5.8 server and want it to keep running after SSH logout, so that other users can edit *.scss files for days or even weeks to come without any need to start the program each time they login (in fact, they don't even have SSH access).

I have used the following command from this question/answer:

$ nohup sass --watch path/to/scss/files:path/to/css/output/files &

Then, I log out of the SSH session and the process keeps running. It all works fine (logging in again and using touch to create a test file (test.scss) correctly triggers the creation of the corresponding test.css file) for the first few minutes, but after a while the *.scss files stop getting compiled... However,

$ ps aux | grep 'sass'

Shows that the process is still running.

Anybody knows what am I doing wrong?

EDIT: this is the output I'm getting from nohup.out:

/usr/local/rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/yaml.rb:56:in `':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
>>> Sass is watching for changes. Press Ctrl-C to stop.
>>> New template detected: 
/home/*/sites/all/themes/test.scss
  overwrite private_html/sites/all/themes//test.css
>>> Deleted template detected: 
/home/*/sites/all/themes/test.scss

The YAML-related error seems unrelated to the problem as Sass is working correctly for a short while. It just silently stops working at some point even though the process remains running...

share|improve this question
    
Do you get any output in nohup.out? –  zmode Oct 26 '12 at 12:09
    
Thanks for the question, have added the output from nohup.out –  maurits Oct 27 '12 at 15:20
    
I have the same problem. I've been running roughly the same setup for about a week (Sass via nohup under Ubuntu 12.04). As a work-around I plan to launch Sass via bash script in a semi-frequent cron job, killing existing sass jobs before launching the new ones. This feels kludgy and makes me a uneasy, especially the possibility of killing a sass job while it's writing to disk. But since I'm the only user on my system, with relatively infrequent commits, I may risk it. –  Andy Giesler Nov 2 '12 at 17:03

1 Answer 1

Ugh sounds like an annoying problem. Doubtful an issue with nohup since it's widely used, mature and simple. Let's eliminate it anyway. We're also eliminating the backgrounding of the process as an issue too.

Open a screen... literally screen

run your command without nohup, but lets log it somewhere

sass --watch path/to/scss/files:path/to/css/output/files 2>&1 | tee sass.log

the 2>&1 makes sure we grab STDERR and STDOUT, while tee forks a log to disk

now detach your screen: ctrl+a d

logout, log back in and see if that makes a difference. No need to reattach to your screen since you have the sass.log going but you would do that with screen -r.

share|improve this answer

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.