Operating System - Linux
1824721 Members
3558 Online
109674 Solutions
New Discussion юеВ

starting and stopping services

 
SOLVED
Go to solution

starting and stopping services

Hi,
How do I stop and start services in linux red hat 7.3? e.g the telnet or network service

Also, how do I configure to start services on startup?

Thanks,
Trystan.
5 REPLIES 5
Richard Slater
New Member
Solution

Re: starting and stopping services

Services are probably started via xinetd or inetd, the configuration file is in /etc called xinetd.conf or inetd.conf.

The configuration files for individual services are in /etc/inetd.d IIRC.
Chakravarthi
Trusted Contributor

Re: starting and stopping services

telnet is managed by xinetd,

to stop and start services go to /etc/rc.d/init.d/ stop/start/restart
and to configure services on startup, use chkconfig command

ex: chkconfig --level 2345 on
like nfs is by default not ON, to make activate the service you need to run the following command

chkconfig --level 2345 nfs on


regards
chakri
Bruce Copeland
Trusted Contributor

Re: starting and stopping services

On many systems, the xinetd.conf file simply says to 'includes' a directory (usually /etc/xinetd.d). xinetd is a superserver that controls other services. You control whether xinetd itself runs in any given runlevel through chkconfig. However, you control what services xinetd provides by either editing the xinetd.conf file or by editing the files for individual services (like telnet) in the xinetd.d configuration directory. Each service is described by a line that says service followed by the service name then an open brace and later a closed brace. Between the braces, you'll see a line that says ' disable = yes ' (or no). To enable a service controlled by xinetd, you usually need to set 'disable = no'. Also look at any defaults that might be in the xinetd.conf file. You should probably read your man pages for xinetd or xinetd.conf to find out a bit more about all the different configuration flavors.
Steven E. Protter
Exalted Contributor

Re: starting and stopping services

/etc/xinetd.conf

Refers to lots of little files for individual services in the directory

/etc/xinetd.d

Here is an example inet file for pop3 mail.

# default: off
# description: The POP3 service allows remote users to access their mail # using an POP3 client such as Netscape Communicator, mutt, # or fetchmail.
service pop3
{
socket_type = stream
wait = no
user = root
server = /usr/sbin/ipop3d
log_on_success += HOST DURATION
log_on_failure += HOST
disable = no
}


Counter intuitive as it is the line disable = no means the pop3 service is enabled. Its the same for all inet services. Everything else is controlled above with the chkconfig command to enable and diable startup specifying the level.

Lastly, you cant chkconfig a service unless its installed.

So if you want to enable iptables and its not installed you have to get the rpm from the install cd and do this (red hat)

rpm -i filename.rpm

Good Luck.

P
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Kevin Joubert
Occasional Advisor

Re: starting and stopping services

chkconfig is a good command line utility for configuring service runlevels. You can also use "setup" which gives you a curses interface to configure things like that.

But for me anyway, the simplest way to start or stop a service is with the "service" command. This command will manage all services listed in /etc/rc.d/inet.d

For instance.. to stop the network

service network stop

to start it

service network start


Now Telnet is controlled by the super-service xinetd, as is wu-ftpd and many others. If you look into /etc/xinetd.d you will see all the services and configuration files that are controlled by that super-service.

You can turn them off and on with the "disable =" line in each config file and then issue "service xinetd restart" to make the changes take place.

-kevin