On Tue, Jul 12, 2005 at 10:16:18AM +0100 or so it is rumoured hereabouts,
Colin O'Keeffe thought:
> HI
>> I was just wondering , if Iam running process's , lets say BIND, or
> named as its know, can I just do kill pid for named or is this the
> wrong way to kill it?
This probably depends on distro. (You're not running bind under MS
Windows are you?? :-).
Generally, services like bind, sshd and such should be managed with their
runlevel control scripts rather than just killing PIDs. Have a look in
/etc/rc.d/init.d/ for the scripts that control services. Then either run
them directly (usually if you run one of these with no args you'll get a
useage message) with a 'status' argument to see the status of the service
and with a 'stop' argument to halt them. Eg. to stop your ssh daemon, run
/etc/rc.d/init.d/sshd stop
or, under RH (which I use), do
service sshd stop
for the same effect.
To control whether they start at all, look at the symlinks in the
/etc/rc.d/rc<n>.d/ directories where <n> is a number between 1 and 5
(between 0 and 6 actually but 0 and 6 are system halt and reboot so these
should only hold 'kill' symlinks). You'll see two sets of symlinks, all
of which link to the scripts in the init.d directory. One set of links
beginning 'K<nn>' are 'kill' symlinks and <nn> is a number that specifies
the order in which they are run. The other set, beginning 'S<nn>' are
'start' symlinks.
When you change runlevel, the 'kill' scripts in the new runlevel are run
first with 'stop' arguments. Then the 'start' scripts are run with
'start' arguments. These symlinks can be modified by hand but probably
should be managed with that distribution's 'runlevel editor' tool. I use
RH's 'chkconfig' commandline tool.
If you cite your distro, those in the know will detail the commands to
use...
Conor
--
Conor Daly <conor.daly at oceanfree.net>
Domestic Sysadmin :-)
---------------------
Hobbiton.cod.ie
09:48:44 up 5 days, 12:43, 1 user, load average: 0.02, 0.07, 0.02
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!