HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free and registered users see less advertising! If you just want to browse through the existing questions, just select the forum that you want to visit from the selection below. Otherwise, click here to register!. We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Re: disabling services from cli

Re: disabling services from cli

Agar: do you ever try to find answers to your questions? I mean there are ~7 topics (in a short span of time) that you started into which you asked simple questions. Did you ever try to find the answer with manpages, with google before? If you did not you should, it will help you gain more autonomy.

Re: disabling services from cli

Agar: Don't worry about it! If this were a real busy board short on resourses then I would agree with GnuVince - but I am frustrated half the time becuase there are not enough questions asked here. So as far as I am conserned keep asking - hell - ask me how to spell linux if ya wanna

for those NOT controlled by xinetd, you can use setup or you can use service. service apm stop service apm start, that kind of thing. Problem with that is that's it's only for that session. If you don't disable them in setup, or hand editing the /etc/rc.d/ files, they will start up again at next boot.

Re: disabling services from cli

haha sorry about all the simple questions. I try and play with as many things as I can on my small network and I get impatient when I can't get things to work. Other times I don't find the info I'm looking for in man pages or tutorials and whatnot so I ask.

Re: disabling services from cli

As KP mentioned chkconfig is the utility you want. Red Hat's modifications to irix's chkconfig now include support for services run from xinetd directly. Very useful feature. If you run

Code:

chkconfig --list

you'll see &quot;xinetd based services:&quot; at the bottom followed by a list of services with their state (on&#124;off). So for example, if you wanted to quickly turn off (which also disables it from future reboots) finger you would simply issue the command:

Code:

chkconfig finger off

Neat huh? However there is one &quot;gotcha&quot; When the configuration is changed, xinetd is signaled automagically to reload the new configuration with the command &quot;/etc/rc.d/init.d/xinetd restart&quot;, that is executed by chkconfig. What does that mean? Well, active sessions of services offered through xinetd (ie., Telnet, FTP, etc) are immediaately terminated. So unless you want to modify the xinetd script so that the reload option sends a SIGUSER1 signal (soft reconfiguration), just plan your chkconfig use when the service isn't being used by someone.

So to recap here are some basic usages of chkconfig:chkconfig --list &#124; grep sendmail Since --list by itself results in everything being displayed you pipe it through grep to narrow it down. You can parse it anyway you want, like

Code:

chkconfig --list &#124; grep &quot;3:on&quot;

to see all runlevel 3 services or send the whole thing to a file chkconfig --list &gt; services.txt to look at later, etc.chkconfig --level 35 sendmail off this would turn off sendmail for runlevels 3 and 5 (run /sbin/runlevel if your not sure which rl your using) and will leave it off. chkconfig --del sendmail at times removing a service altogether may be in order, sendmail for example, on client machines where incomming mail for local accounts is not required, running sendmail as a daemon may not be necessary. What this command does is remove all sendmail scripts from /etc/rc.d/rc#.d/ (where # is the runlevel) but leaves the main sendmail script located in /etc/rc.d/init.d/ intact, just in case you want to re-establish sendmail as a service for runlevels again.

In short, you have two types of services. Those run from xinetd and those run standalone. chkconfig can handle them both. These are just a few examples to get you going. &quot;man chkconfig&quot; for futher info.