Linked by Thom Holwerda on Sun 2nd Apr 2006 18:09 UTC, submitted by anonymous
Linux "In any Linux distribution, some services are enabled to start at boot up by default. For example, on my machine, I have pcmcia, cron daemon, postfix mail transport agent, just to name a few, which start during boot up. Usually, it is prudent to disable all services that are not needed as they are potential security risks and also they unnecessarily waste hardware resources. For example, my machine does not have any pcmcia cards so I can safely disable it. Same is the case with postfix which is also not used. So how do you disable these services so that they are not started at boot time?"
Order by: Score:
Redhat method
by hraq on Sun 2nd Apr 2006 18:29 UTC
Member since:

Redhat methods are the easiest here, especially "service pcmcia stop" and "service httpd start".
But REMEMBER that you have to type "/sbin" before "service" like this "/sbin/service sound stop", to really work on RHEL distros. I personally use the GUI tool which is amazing because it lists the services available and which one is enabled and which one is not, besides it gives you complete description on each service and what it is its function.

Reply Score: 2

RE: Redhat method
by kernelpanicked on Sun 2nd Apr 2006 19:08 UTC in reply to "Redhat method"
kernelpanicked Member since:

If you log in to root using 'su -' it will load the root path and you won't need the path to the service binary. You do know that service $something stop only turns off the service until the next init change right? You need to use chkconfig to completely disable something.

chkconfig $something off

Reply Score: 1

RE[2]: Redhat method
by Sphinx on Mon 3rd Apr 2006 16:56 UTC in reply to "RE: Redhat method"
Sphinx Member since:

I believe chkconfig is an invention of Sun's used by Redhat and any other distro that wants to add the proper comments to their run change scripts, nothing specific to any distro there.

Reply Score: 1

BootUp Manager
by Lamego on Sun 2nd Apr 2006 19:09 UTC
Member since:

There is a nice gui tool to enable/disable boot servces on ubuntu, the name is BootUp Manager.
It can be installed with:
sudo apt-get install bum

Reply Score: 1

RE: BootUp Manager
by ozonehole on Sun 2nd Apr 2006 23:35 UTC in reply to "BootUp Manager"
ozonehole Member since:

There is a nice gui tool to enable/disable boot servces on ubuntu, the name is BootUp Manager.
It can be installed with:
sudo apt-get install bum

Thanks for mentioning this. Actually, it works with any Debian-based system.

Reply Score: 1

disabling postfix
by subterrific on Sun 2nd Apr 2006 20:13 UTC
Member since:

disabling postfix might not be such a good idea. it is often installed and configured as a local only mail server used to email system alerts to the root user.

Reply Score: 1

How About FreeBSD/rc.d Method?
by dswain on Sun 2nd Apr 2006 20:13 UTC
Member since:

Similar to what Gentoo is, only you point directly to the created initiation files and pass an argument like (for example):

/etc/rc.d/sshd start|stop|restart

You add and remove the services in a list located in the /etc/rc.conf file. Arch Linux uses the same method of operation which is another reason I enjoy Arch Linux.

Here's a little more information about it:

In the end though, they are all relatively similar at least in operation sense. I think it's a somewhat portable skill to have.

Reply Score: 2

Slackware method
by situation on Sun 2nd Apr 2006 20:37 UTC
Member since:

In Slackware:

chmod -x /etc/rc.d/rc.sshd

Pretty simple and clean, just uses the built in commands instead of seperate binaries or special scripts.

Reply Score: 4

Use Gentoo
by siride on Sun 2nd Apr 2006 22:05 UTC
Member since:

Use Gentoo and you don't have to worry about disabling a bunch of services you don't want after an install.

Reply Score: 0

RE: Use Gentoo
by rm6990 on Sun 2nd Apr 2006 23:40 UTC in reply to "Use Gentoo"
rm6990 Member since:

Yes, because compiling everything (sometimes takes days) is so much quicker than disabling services (normally takes minutes or seconds, and only needs to be done once).

Christ, I understand Gentoo is great and all, but give it a rest.

Reply Score: 2

Setting the services
by TaterSalad on Sun 2nd Apr 2006 22:05 UTC
Member since:

While I have no fear of the command line/terminal window I find the GUI based tools with each distro to be easy to use. Just stop the service, uncheck the box so its not used during sstart up then click ok. But I can understand the GUI not being an option on servers, in which case this article would apply.

Reply Score: 1

Simpleinit simply better
by Sphinx on Mon 3rd Apr 2006 00:16 UTC
Member since:

chmod +/-x /sbin/init.d/service name

Reply Score: 1

by joesnow on Mon 3rd Apr 2006 02:20 UTC
Member since:

i don't "worry" about the services i don't want. I just disable them in a matter of seconds, with redhat.

Reply Score: 1

Re: How About FreeBSD/rc.d Method?
by dillee1 on Mon 3rd Apr 2006 16:31 UTC
Member since:

Not all init script of FBSD are in /etc/rc.d/
only those considered as "core" system daemons are there.
Majority 3rd party stuff like apache and samba are in /usr/local/etc or in package specific directories. This can be confusing to newbies or lazy lamer who don't read the man page ;-)

Reply Score: 1

Re: Setting the services
by dillee1 on Mon 3rd Apr 2006 16:51 UTC
Member since:

Strongest point of cmdline here is its scriptability. e.g. for RH systems
1) to save the current state of you services(so that if some dependecies are bork you can still revert back)
chkconfig --list > services.states

1) dump the service names
chkconfig --list | awk '{print $1}' > services.txt

2) del services you want to turn off from services.txt, save it as services.on . you can check what the service does before making a decision with
rpm -qi `rpm -qf /etc/init.d/$SERVICE_NAME`

3) run a script like this

while read SERVICE_NAME
chkconfig --level 345 $SERVICE_NAME $MODE


4) repeat 2)3) for services you wanna turn off, just save the config to another file and edit $FILENAME on aforesaid script.

Tada, done. you can use the configuration text file on multiple machines, getting them configured in seconds too.

Reply Score: 1