Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Trying to start a unicorn daemon as a non-root user but failing hard.

Unicorn gives the the following error:

directory for pid=/var/run/sinatra_test/ not writable

So I made the following:

sudo mkdir /var/run/sinatra_test
sudo chown ruby:www-data /var/run/sinatra_test
sudo chmod g+w /var/run/sinatra_test

ls -ld /var/run/sinatra_test returns:

drwxrwxr-x 2 ruby www-data 60 Oct 27 09:55 /var/run/sinatra_test

What am I missing? Still getting Permission denied errors.

share|improve this question
up vote 1 down vote accepted

Most probably you got some leftover with pid file (/var/run/sinatra_test/

Did you killed your app (kill -9 )? If application is down, then verify if there is this pid file - if there is - please remove it. And retry to start it again.

share|improve this answer
I guess that was the error. I restarted the server and it works now. I didn't kill the app so I assume it still was running. Thanks. – kornnflake Oct 27 '12 at 15:28
Well it's always good to veryfiy it using ps aux | grep <application> and if you know on which port it does work - netstat -nlp | grep <port>. It's good habit. Also - please restore folder permissions. – Piotr Kieszczyński Oct 27 '12 at 15:51

Your Answer


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.