LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-14-2007, 11:46 AM   #1
er_gaurav22
LQ Newbie
 
Registered: Apr 2006
Posts: 20

Rep: Reputation: 0
Regarding any new service


Hi All,

How to run any service after entering in /etc/services file without restart service i have done as follows:-

vi /etc/services

monit 2812/tcp # monit service
monit 2812/udp # monit service






after that i m runing command:-

nmap localhost

Starting nmap 3.70 ( http://www.insecure.org/nmap/ ) at 2007-09-14 22:01 UTC
Interesting ports on testserver (127.0.0.1):
(The 1649 ports scanned but not shown below are in state: closed)
PORT STATE SERVICE
21/tcp open ftp
22/tcp open ssh
80/tcp open http
111/tcp open rpcbind
631/tcp open ipp
782/tcp open hp-managed-node
834/tcp open unknown
855/tcp open unknown
2049/tcp open nfs
3306/tcp open mysql
32770/tcp open sometimes-rpc3

Nmap run completed -- 1 IP address (1 host up) scanned in 0.242 seconds






there is no 2812 port open.





please help me to open the port
 
Old 09-14-2007, 01:32 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
/etc/services is just a lookup file like /etc/hosts. It doesn't "start" anything on its own. It just associates a port number with a name so that when you use the netstat command or similar utility you can see the name rather than the number for the port (assuming you don't use the -n flag with netstat of course).

It is the start of the software that requires the port that would "start" the service.

e.g. If you're not running sendmail or some other Mail Transport Agent (MTA) then port 25 won't be "LISTENING" even though /etc/services shows you:
smtp 25/tcp mail
smtp 25/udp mail


Ports that are LISTENING are typically daemons and can be started either by starting the actual application that uses the port (e.g. sendmail) so that it s running all the time or by using inetd or xinetd to LISTEN for the port and start the application only when there is a need for it. (e.g. ftpd - you're not usually doing ftp to the server 24x7 so no reason to tie up resources by running ftpd all the time - when inetd or xinetd see a request for port 21 it starts ftpd at that point and then it stops running at some time after the ftp session has quit).

The reason many applications ask you to add entries to /etc/services is to prevent the specific port from being assigned randomly to applications that request random port rather than specific ports. /etc/services doesn't actually reserver the port - if an application asks for the port specifically and it is not in use by another application then it will use that port even if you have some other name in /etc/services. However it does prevent it from randomly picking the port as noted earlier.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make TCP server a daemon / service much like a dhcpd service? rajat Linux - Networking 1 05-22-2007 01:29 AM
how to add service in service list akamol Linux - Software 2 07-20-2006 01:37 AM
LXer: Telsasoft, a Telecommunications Service Assurance Software Company Based in Minneapolis, Minnesota Received Order for a Set of GSM CDR (Call Detail Record) Reports from a Regional GSM Network Service LXer Syndicated Linux News 0 01-03-2006 09:46 PM
Making a service as a system service Dakkar SUSE / openSUSE 2 07-13-2005 07:36 AM
/sbin/service is empty every weekend and changed to service.1 LineS Linux - General 0 05-24-2004 02:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:27 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration