6

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?

Caleb
  • 69,278
  • 18
  • 196
  • 226
Stefano Palazzo
  • 608
  • 6
  • 20

2 Answers2

4

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 &
    
Stefano Palazzo
  • 608
  • 6
  • 20
0

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

Michael Mrozek
  • 91,316
  • 38
  • 238
  • 232
pato
  • 9
  • 1
  • 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