emikulic / darkhttpd

When you need a web server in a hurry.
https://unix4lyfe.org/darkhttpd/
ISC License
1.05k stars 87 forks source link

Is the fork() in line 2610 strictly necessary? Could it be changed to vfork()? #11

Closed cogburnd02 closed 2 years ago

cogburnd02 commented 3 years ago

I ask only because I would like to use this on NuttX, and it doesn't support fork(), but using it with some architectures does support vfork(). https://nuttx.apache.org/docs/latest/reference/user/01_task_control.html#c.vfork

Forgive my lack of knowledge in this area, I'm just a software user, not a programmer.

emikulic commented 3 years ago

How does other software daemonize on NuttX?

darkhttpd's daemonization is a bit [too?] complicated because the parent tries to wait until the child is successfully serving to return an appropriate exit code.

Maybe a simple workaround for you is to not daemonize darkhttpd, if you have something like daemontools / supervisord / an init system that handles daemons running in the foreground.