LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 05-22-2007, 01:32 AM   #1
rajat
LQ Newbie
 
Registered: Jan 2007
Posts: 20

Rep: Reputation: 0
How to make TCP server a daemon / service much like a dhcpd service?


Hi Folks !
I have a fedora core 6 machine, kernel 2.6.18. I intend to create my TCP Server a daemon ( or a service) much like any other daemon / service like dhcpd.

Is this possible?
I want it to be able to control much like a dhcpd service is controlled ie. I should be able to start, stop and query its status as we do it with the dhcpd service.

I know i'm mixing up the 2 terms daemon and service. But I do not have any idea as to whether they are the same or different.

Please suggest how should I go about doing this. At the least I request to please direct me to some link on the net.


Thanks and regards,
Rajat
 
Old 05-22-2007, 02:29 AM   #2
raskin
Senior Member
 
Registered: Sep 2005
Location: Russia
Distribution: NixOS (http://nixos.org)
Posts: 1,893

Rep: Reputation: 68
http://en.wikipedia.org/wiki/Daemon_(computer_software) - as for links for daemon, and description of what it is. But daemon only refers to mode of running of one instance of process; there is sometimes 'daemon' utility that can run any process not requiring input/output to console as daemon.

What you want about controlling it like other system daemons, is achieved by initscripts. Look at /etc/init.d/dhcpd (or /etc/rc.d/init.d/dhcpd, it varies). It is a shell script, that can take 'start', 'stop' and 'restart' parameters (sometimes such scripts can take some other parameters, like 'reload', but are only run with a single parameter). It then loads parameters from configuration files in /etc, decides what command-line is needed for daemon and either runs it ('start') or makes it know it needs to terminate ('stop'), usually by sending a signal that daemon will proceed (read man signal) or - if it is 15 (SIGTERM), for example - which will make OS terminate daemon.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to disable TCP/IP Denial of Service mayankh Linux - Security 2 10-14-2006 05:01 AM
adding a new daemon (service) vjenks Linux - Newbie 3 02-11-2004 08:31 PM
How To Program Daemon(Service) Application wlmapp3 Programming 6 07-23-2003 04:58 PM
Service Monitoring Daemon (MON) PokerFace Programming 1 12-04-2002 12:31 PM
I want to start Snort as a service/daemon Olusegun Linux - Software 3 10-15-2002 11:35 AM


All times are GMT -5. The time now is 02:17 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration