Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm trying to run a CherryPy app on my NetBSD 5.1 box. To have it start automatically, I've added this line to my /etc/rc.local:

/bin/httpd &

When I boot the machine, some of the output of the Webserver starting is visible, right after the Starting sshd. message. None the less, I can't connect to my web-server.

I can log into the machine, and when I start the web-server by typing httpd, it all works well. What am I doing wrong? What is the correct way to have my program start on boot-time?

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

The program will exit as soon as the rc.local script is finished. So, here's the complete procedure that doesn't require the program to understand any of the rc.d stuff:

  • Make the script executable (e.g. chmod a+x /usr/local/bin/httpd)
  • Add the following line to your /etc/rc.local:

    nohup /usr/local/bin/httpd &
    
share|improve this answer
add comment

Add httpd=YES to /etc/rc.conf. Reading man rc.conf might help

share|improve this answer
2  
thanks for telling me to read the manual :-) Now, I'm using rc.local rather than rc.conf, as the NetBSD guide says: "to start local daemons that don't fit the rc.d model". So I'm afraid your answer doesn't help me in this case. –  Stefano Palazzo Jun 14 '11 at 19:33
add comment

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.