Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I saved the following file at /etc/init/nodejs.conf

description "node.js server"
author      "dorelal"

start on startup
stop on shutdown

script
    # We found $HOME is needed. Without it, we ran into problems
    export HOME="/root"

    exec /usr/local/bin/node /home/dorelal/nodejs.js 2>&1 >> /var/log/node.log
end script

Then I tried to start the server

> sudo initctl start nodejs
initctl: Unknown job: nodejs

Ubuntu information

> cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=9.10
DISTRIB_CODENAME=karmic
DISTRIB_DESCRIPTION="Ubuntu 9.10"

What do I need to do to start the server using upstart.

share|improve this question
    
did you try restarting init? –  kbyrd Apr 9 '10 at 5:06

3 Answers 3

I had a similar problem which was solved by running initctl reload-configuration manually (it's supposed to watch the file but I assume since it's a symlink that it has problems).

share|improve this answer

For some reason, I have the idea that the comment section is required at the top of the file. Look at one of the other files in that directory and copy that format into your file (making changes as necessary) and see if that doesn't help (also, verify that the file owner, group and permissions are correct).

share|improve this answer
    
will try that. thanks –  user36318 Apr 8 '10 at 20:57

I have found that the comments at the top did not affect whether it worked or not.

What affected it was putting quotes around the description, in my particular case.

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.