How can I automatically start a daemon at boot time.
Hi masters,
I am still learning trades in kernel. I am trying to learn the basic of daemon programming. Can any one tell me how can I start a daemon automatically during boot up. I will be greatfull if anyone post some example code to the above task. Also what are the other things that you must know when you try daemon programming? Can any one help me? |
What distro are you using? Many have init scripts and places for you to place your own init scripts. That way you can start your own daemon at boot up.
|
simply call the daemon from rc.local (in /etc/rc.d or /etc/init.d)
|
you can also use ntsysv
|
I am using linux kernel version 2.6.23 on a fedora 8 distribution.
cat /proc/version Linux version 2.6.23.1-42.fc8 (kojibuilder@xenbuilder4.fedora.phx.redhat.com) (gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)) #1 SMP Tue Oct 30 13:55:12 EDT 2007 Thanks for the quick replays.... I tried google for ntsysv...But whatever I got I didnt understand a bit. What they are meaning by run level....(I hope it is not a childish questine)...again thanks for the quick reply.... |
1) Add your daemon startup script to /etc/rc3.d , /etc/init.d
2) Use "chkconfig" and make sure your daemon is "on" for 3 & run levels. -- geekyfacts |
All times are GMT -5. The time now is 02:09 PM. |