![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Ubuntu Ubuntu is a complete desktop Linux operating system, freely available with both community and professional support. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Database can't start automatically on solaris | Sachin Vaidya | SUN Solaris | 2 | 02-27-2008 11:12 PM |
| How to start Oracle database automatically | greg0320 | SUN Solaris | 3 | 03-30-2005 05:46 PM |
| start a process at boot up time | vtran4270 | UNIX for Advanced & Expert Users | 1 | 12-08-2002 07:31 PM |
| getting postfix tyo start automatically | kmgrady01 | UNIX for Dummies Questions & Answers | 2 | 05-21-2002 02:18 AM |
| Disable routed daemon at boot time???? | rrivas | UNIX for Dummies Questions & Answers | 2 | 04-09-2002 11:53 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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? |
|
|||||
|
a basic unix daemon does the following:
fork close all filedescriptors (stdout,stderr, etc) chdir / signal handeling (sighup, sigterm etc) while do stuff sleep(xx) done (example in C: daemon.c) Red Hat example on how to install startup scripts: to start a deamon at system startup in redhat you need a init script. it should be placed in /etc/init.d example of init script : Code:
# chkconfig: 3 99 1 # description: my daemon case "$1" in 'start') /usr/local/bin/mydaemon ;; 'stop') pkill mydaemon ;; 'restart') pkill -HUP mydaemon ;; esac to install the startup script use the following: chkconfig --add ./scriptabove Now it will start when the server boots. to start it right away use: service <name_of_initfile> start Hope this helps somewhat! Last edited by s93366; 12-18-2008 at 04:38 AM.. |
|
||||
|
|
|
||||
|
How does it work on Solaris?
Hi s93366,
Thanks so much for the excellent tutorial. I works great on Linux environment. However, When I was trying it on Solaris environment, it doesn't work since there's no chkconfig on Linux. Do you have any idea on how to make it work on Solaris? I am new to Linux/Unix, and is learning Linux/Unix. Any help will be greatly appreciated. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|