On Mar 23, 2003 at 20:44, !@#$%^&*() wrote:
I have a C executable, which I want to run as a Service just like "httpd" or "mysqld", I guess its called "DAEMON mode", how should I do this. I do not want to run it via CRON.
Any pointers, leads are greatly appreciated.
Like someone pointed out, see the Stevens Unix Network programming book for a daemon skeleton. Then read the rc scripts documentation (pointers in /etc/init.d or /etc/rc.d). Basically you want to fork, reset all signals, detach from controlling terminal, open sockets, close terminal sockets.... I'm not clear on the issues, but Stevens is.