!@#$%^&*() writes:
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.
You would want to read up man page for daemon(). In short, you'd need to fork() [parent 1], start a new session and make it the process leader using setsid(), realease the parent [parent 1] using fork() [parent 2] again, and then if you are using BDS pthreads, take care of stuff like umask, root directory (chdir ("/"). daemon() call would do the rest by closing the child fd's and then releasing the tty's. For details, google.
./h