[SOLVED] Optimize slack boot process / init scripts ?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Well, he has a point, but I for example haven't had any problems with ldconfig not being run at all (except source installs, ofcourse) for over a year now.
I know, I didn't have any problems either. But, I figure Pat V. put it to run at startup for more than one reason. Maybe it's best to make it run at startup. Of course, you could simply run it manually when you need it.
One more thing that can be done to speed up boot time (as I've seen, this is probably the one biggest slowdown left).
So in '/etc/rc.d/rc.S' you'll see something like:
Code:
# Mount non-root file systems in fstab, but not NFS or SMB
# because TCP/IP is not yet configured, and not proc or sysfs
# because those have already been mounted. Also check that
# devpts is not already mounted before attempting to mount
# it. With 2.4.x kernels devpts is mounted from an fstab
# entry while with a 2.6.x or newer kernel udev mounts it.
# We also need to wait a little bit to let USB and other
# hotplugged devices settle (sorry to slow down the boot):
echo "Mounting non-root local filesystems:"
sleep 3
if /bin/grep -wq devpts /proc/mounts ; then
/sbin/mount -a -v -t nonfs,nosmbfs,nocifs,noproc,nosysfs,nodevpts
else
/sbin/mount -a -v -t nonfs,nosmbfs,nocifs,noproc,nosysfs
fi
Note that this is run every time you boot, and it is the only such thing that has the 'sleep' command in it ... a delay command. In this case it waits 3 seconds.
Now, I commented out this entire section, because every time I boot, nothing is mounted .... there are no non-root file systems in fstab or any at all ... they don't exist.
So, I propose that is a safe optimization if every time you boot, no non-root file systems in fstab is mounted and you have no non-root filesystems on your system.
Does this seem reasonable ... should I add it to the guide with this notice ?
Last edited by H_TeXMeX_H; 06-14-2007 at 07:45 PM.
There seem to be no problems with doing this, so I'll just add it to the post. Boot time on my desktop is 26 sec (from pressing the power on button, about 20 sec from grub).
This might as well go here, for Slackware 12.0, the same steps can be used to optimize boot time (and other things concerning speed). However, now the two major slow processes are started with an '&' after them which prevents them from slowing things down, which is great.
So, the same steps can be used, with one possible addition. In '/etc/rc.d/rc.M', I added an '&' to the hal startup script:
Code:
# Start HAL:
if [ -x /etc/rc.d/rc.hald ]; then
sh /etc/rc.d/rc.hald start &
fi
Now, you cannot do this with d-bus, because d-bus must be started before hal, or hal won't work. But, d-bus loads quickly, so it's not a problem. Hal normally takes a long time to load, so it does slow things down. Also, I don't think this will affect anything, because nothing started after hal really needs hal, except maybe once you start xserver and kde, but I've found it always loads by then. It works fine for me, especially since I don't use kde and don't care too much for the automount features provided by hal. But, I like 'lshal' because it gives a nice list of all the components on the system, and was very useful on a number of occasions where I was trying to make some scripts for a ppp connection.
Unless you have a pcmica card (for laptops), then you can certainly comment it out. Or, you could just make it non-executable 'chmod a-x /etc/rc.d/rc.pcmcia'. To explain why here's an explanation of what this script means (you may already know some of this):
Code:
# if /etc/rc.d/rc.pcmcia is executable (the '-x'), then
if [ -x /etc/rc.d/rc.pcmcia ]; then
# start /etc/rc.d/rc.pcmcia
. /etc/rc.d/rc.pcmcia start
# The cards might need a little extra time here to initialize.
sleep 5
fi
Distribution: Slackware 12 Kernel 2.6.24 - probably upgraded by now
Posts: 1,054
Rep:
Can I comment out the sleep in non root fs part if all my non root fs are actual IDE/SATA HDDs?
I am not mounting anything hot pluggable , so no need to wait for that ?
Check the 'MaxMultSect=16, MultSect=16', MaxMultSect is the maximum setting for '-m' option. Thus I run 'hdparm -c3 -m16 /dev/hda'. Again, read 'man hdparm'.
If know that you have no 'non-root file systems in fstab' to mount, and every time you boot it says "Mounting non-root local filesystems:" and then nothing was mounted, then you can probably also comment the following section out of rc.S:
Code:
# Mount non-root file systems in fstab, but not NFS or SMB
# because TCP/IP is not yet configured, and not proc or sysfs
# because those have already been mounted. Also check that
# devpts is not already mounted before attempting to mount
# it. With 2.4.x kernels devpts is mounted from an fstab
# entry while with a 2.6.x or newer kernel udev mounts it.
# We also need to wait a little bit to let USB and other
# hotplugged devices settle (sorry to slow down the boot):
echo "Mounting non-root local filesystems:"
sleep 3
if /bin/grep -wq devpts /proc/mounts ; then
/sbin/mount -a -v -t nonfs,nosmbfs,nocifs,noproc,nosysfs,nodevpts
else
/sbin/mount -a -v -t nonfs,nosmbfs,nocifs,noproc,nosysfs
fi
NOTE: the above may not be safe for all setups ... try at your own risk. It works fine for me.
a) First, start with the generic kernel, and build from there. Run 'make mrproper', copy in the '.config' from the generic kernel, and then run 'make menuconfig' (or whichever one you prefer).
b) Search for the words 'not', 'found', 'no', and 'error' in 'dmesg', and take appropriate action ... removing what fails anyway.
c) disable 'pcspkr', unless you like annoying beeps every time you make an error. (disable raid/md if you don't use it)
d) make floppy a module rather than built-in (on some machines, this is the only way it will work)
e) Under 'Block layer -> IO Schedulers' read the help on all of them and see which one you think is best. IMO, the best are CFQ for desktop, and deadline for database/server.
f) Under 'Processor type and features':
i. Make sure to select your processor in 'Processor family',
ii. Enable/disable SMP (Symmetric multi-processing) if you have or don't have it
iii. Disable 'Generic x86 support' unless you're making your own distro
iv. Put max # CPUs (for multi-core)
v. Enable/disable hyperthreading for P4
vi. Enable/disable multi-core and/or SMT scheduler suppport
vii. Disable local apic
iix. Read and choose 'Preemption Model' (Voluntary is good for desktop)
ix. Enable/disable high memory support: if you have near 1GB RAM, enable it
x. Set timer frequency acordingly (1000 Hz for desktop)
xi. Maybe try enabling '64-bit memory and IO resources' if you have 64-bit processor
xii. Turn off 'Compat VDSO support' (glibc-2.3.3 or later)
g) Don't forget to fully enable your filesystem
I think those are most important performance-wise, the rest is also important, but harder to get right The guide should help with that.
3. Install grub or use lilo 'compact' option. You choose. Grub is slightly faster from what I can tell.
Last edited by H_TeXMeX_H; 10-12-2007 at 08:13 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.