LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   stopping and starting services (https://www.linuxquestions.org/questions/linux-newbie-8/stopping-and-starting-services-35333/)

nero64 11-13-2002 12:47 AM

stopping and starting services
 
Hi everyone.

I have installed Red Hat 7.1 and i am studying for the Linux+ exam. I don't know much but i heard this exam is a basic level exam.

My book tells me that to stop and start a service you do the following:

#./dhcp stop
#./dhcp start

when i do it i get no such file or directory error

I am logged in as root

born4linux 11-13-2002 12:58 AM

for dhcp, it should be:

/usr/sbin/dhcpd

And to enable it on startup, run this:

chkconfig --level 345 dhcpd on

Now, I don't why dhcpd can't be controlled by using the /sbin/service command (ie. service dhcpd start/stop/restart) or by /etc/init.d/dhcpd start/stop/restart) but most services can be controlled using the service command

# for xinetd
/sbin/service xinetd start/stop/restart

# for mysqld
/sbin/service xinetd start/stop/restart

# for httpd
/sbin/servie httpd start/stop/restart

Some services are xinetd controlled (not standalone services) and for this services, enabling them under the corresponding files in /etc/xinetd.d/ and then restart xinetd will make them accessible. Like for wu-ftpd, to enable, edit /etc/xinetd.d/wu-ftpd and set the the 'disable=yes' to 'disable=no' and then restart xinetd:

/sbin/service xinetd restart

Or, the easiest way is:

/sbin/chkconfig wu-ftpd on

no need to restart xinetd here. once an ftp connection is made, only then you should see an ftp daemon running.

trickykid 11-13-2002 01:00 AM

Have you tried the full path to it ?? And usually the dhcp has a d at the end like this:

dhcpd stop or start

mayankjohri 11-13-2002 01:10 AM

try this
 
the files you are trying are normally localted in /etc/rc.d/init.d/ folders

mayank johri


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