Disabling unnecessary startup services
Hello,
In order to preserve resources and to have more secure machine I want to disable services which are of no use to me. But being relatively new to Linux I want to make sure I'm disabling those really unnecessary and that my actions wont have a negative impact on overall system health / usability. All comments, suggestions and constructive critique is welcome and appreciated! Below is the output from sysv-rc-conf --list Code:
acpi-support 1:off 2:on 3:on 4:on 5:on I'm running Ubuntu 10.10 on a laptop which means that things like acpi-support, pcpid or lm_sensors I will want to have. I'm not using dail-up so I should have no need for atd and pppd-dns. To list other services I'm planing on getting rid of: anacron, bluetooth, brltty, cups, rsync, saned, speech-dispatcher I'm not sure what to do with avahi-deamon - I'm not using any network shares, at least currently, so it should be safe to turn it off. Services I'm not quite sure what to do with are as follow: dns-clean, hostname, screen-clean Finally, services I'm planing on leaving on: acpi-support, acpid, alsa-mixer-save, apparmor, apport, binfmt-support, bootlogd, console-setup, cron, cryptdisks, cryptdisks-enable, cryptdisks-udev, dbus, dmesg, ecryptfs-utils-restore, ecryptfs-utils-save, failsafe-x, fancontrol, gdm, grub-common, halt, hwclock, hwclock-save, irqbalance, kerneloops, killprocs, lm-sensors, module-init-tools, network-interface, network-interface-security, network-manager, networking, ondemand, pcmciautils, plymouth, plymouth-log, plymouth-spl, plymouth-sto, procps, pulseaudio, rc.local, reboot, rsyslog, saned, screen-clean, sendsigs, single, stop-bootlog, stop-bootlog, sudo, udev, udev-finish, udevmonitor, udevtrigger, ufw, umountfs, umountroot, unattended-u, urandom, x11-common I know, I'm leaving plymouth - but it just looks gorgeous ;-) Corrections and suggestions anyone? Tom |
The command you're looking for to enable/disable boot scripts is update-rc.d. What I do to disable a service is rename the /etc/init.d/file_name to /etc/init.d/file_name.bak and then run
Code:
update-rc.d file_name remove HTH, |
Hi, welcome to LQ!
atd has nothing to do with dial-up; it allows you to run commands as one-offs at a given time. You also shouldn't really disable anacron - some system maintenance tasks may rely on it (not that I know much about Ubuntus inner workings). |
Quote:
@Tinkster You're right about atd and anacron! From man pages: Quote:
|
Be careful when disabling things! You could end of with a hung machine at boot. :(
|
Quote:
For now I have disabled only avahi-demon, bluetooth, brltty, cups / cupsd and saned. Printing daemon and avahi were a bit of a pain - I wasn't able to get rid of them using update-rc.d. What did the trick for me was to rename their files in /etc/init/. Now they are no more! In the course of googling form more information about couple of processes I came across this little, precious gem - bootchart. Now, my booting time is roughly 30 seconds and I'm quite happy with this, tweaking things to get an extra second or two doesn't appeal to me. But having more memory available is quite tempting. My next target is getty - I'm not using terminal much and so I want to changing the number of available terminals from four to only two or even one. Any idea how I should get around to do that? I'm still looking for informations about that but this time google don't seems to be on my side... |
Quote:
Code:
# /sbin/getty invocations for the runlevels. |
Just rebooted and everything seems to be still working! I did have six as well, now it just two. But I done it in a different way - I went to /etc/init/ and appended _bak to filenames of last four tty's.
For now that the end for me - I need to read some more about other services before I will attempt to disable them. Suggestions where should I start are more than welcome! |
1 Attachment(s)
Quote:
Code:
03:37:08 /home/barrie $ > ps -u barrie |
1 Attachment(s)
OK, I got rid of the following: avahi-daemon, bluetooth, brltty, cups, dns-clean, pppd-dns, rsync, saned, speech-dispatcher and I'm down to two tty's. I'm planing on removing unattended-updates as well but after setting up cron job to take over it's function.
@barriehie I went with your advice and used update-rc.d to remove all the links, thanks again. Fluxbox looks interesting but (ashamed) I have to admit that I like visual side of Ubuntu. This "frantic" disabling of services is a learning experience for me - what those things are doing and what will happen when I will switch them off. And there is security / maintenance approach - less services running, less chances for something to go funny ;-) I'm attaching graph from bootchart - if anyone will have any suggestions as to what (and why) I can still disable I will be grateful. |
You can use sysv-rc-conf directly to enable or disable services. That is what it is for. You don't need to mess with anything in /etc/init/. See this tutorial on sysv-rc.conf:
http://ubuntuforums.org/showthread.php?t=89491 It is a bit out of date, but it does go into detail on how to use sysv-rc-conf. It is a handy tool for enabling or disabling services. There is also an option under: system > administration > startup_services (or it may be: system > preferences > startup_services) for enabling and disabling may things from starting automatically. |
Yeah, I know about sysv-rc-conf but you can't disable couple of things with it completely, ex. avahi-daemon or cups. If you will have a look here you will know what I was messing with /etc/init in the first place. As for using Startup Applications from the menu - it's OK to start with but it have just bare basic. What I want to do is to learn a bit about every process which is started - what they are there for and what can be done with them.
This tutorial you have mentioned is actually a reason for all that! |
I've been using fluxbox long enought that a 'regular' desktop is rather weird! I can go with the CLI and not much in the way of a drop down menu!
|
I'm not sure how editable the /etc/init/rc.local file is in Ubuntu, but Arch Linux uses a somewhat similarly named /etc/rc.conf file. Here is mine so you can see what the (almost) bare minimums are. Keep in mind I'm not running a gui or even pulseaudio.
Code:
# Code:
modprobe -r <modulename> Code:
lsmod Code:
lsmod|grep <search string> |
All times are GMT -5. The time now is 03:14 PM. |