LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-05-2010, 09:08 AM   #1
cola
Senior Member
 
Registered: Sep 2007
Posts: 1,045

Rep: Reputation: 65
Suggestion to have a fast boot


It looks,slackware is taking too much time to boot.
It's starting daemons at boot time.

What are those daemons that i can stop at boot time to increase booting time?

What's the best way to stop starting daemons at boot time?
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 03-05-2010, 09:29 AM   #2
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
1) Make unexecutable anything in /etc/rc.d that you don't need, stuff like rc.gpm, but not important things (look through them and they should say what they do).

2) If you use lilo, make sure to add 'compact' to lilo.conf and then run lilo if it wasn't already there.

3) Compile your own kernel, this will improve boot speed and app start times a bit.

I wrote a how-to thread at some point on here, but it's kinda outdated, maybe I'll update it.
 
1 members found this post helpful.
Old 03-05-2010, 09:32 AM   #3
cola
Senior Member
 
Registered: Sep 2007
Posts: 1,045

Original Poster
Rep: Reputation: 65
Quote:
Originally Posted by H_TeXMeX_H View Post
1) Make unexecutable anything in /etc/rc.d that you don't need, stuff like rc.gpm, but not important things (look through them and they should say what they do).

2) If you use lilo, make sure to add 'compact' to lilo.conf and then run lilo if it wasn't already there.

3) Compile your own kernel, this will improve boot speed and app start times a bit.

I wrote a how-to thread at some point on here, but it's kinda outdated, maybe I'll update it.
It's grub boot loader.
How does compiling own kernel improve boot speed?
 
Old 03-05-2010, 09:40 AM   #4
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Quote:
Originally Posted by cola View Post
How does compiling own kernel improve boot speed?
It will reduce the time taken probing for hardware devices that don't exist and that it's never going to encounter.
 
Old 03-05-2010, 09:58 AM   #5
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Yeah, and for older computers it will greatly decrease boot time because it has less to load into RAM.

I can tell you that with my old Vaio laptop each one of these steps pretty much halved the boot time. Grub is slightly faster even than lilo compact but not by much.

Last edited by H_TeXMeX_H; 03-05-2010 at 10:00 AM.
 
Old 03-05-2010, 10:31 AM   #6
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Ok, so, after looking at my old post here:
http://www.linuxquestions.org/questi...ml#post2921723

It seems that only the following apply now:

1) Make un-executable anything in '/etc/rc.d' that you don't need. For example:

Code:
chmod a-x /etc/rc.d/rc.gpm
2) Install grub or use lilo 'compact' option. You choose. Grub is slightly faster from what I can tell, but is not available for 64-bit.

3) Compile a new kernel. Here is a good guide:
http://www.kroah.com/lkn/

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

Also note the new experimental kernel feature that can help in trimming down the kernel:
http://www.linuxquestions.org/questi...localmodconfig
you still have to know what you are doing tho.
 
2 members found this post helpful.
Old 03-05-2010, 11:23 AM   #7
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
I've speeded up time-to-login by backgrounding a non-essential item in rc.local and am planning to do more
Code:
#@ Deferred startups (so as not to delay logon)
(
        echo 'rc.local: backgrounded delayed starts initiated'
        sleep 5; /usr/sbin/hddtemp -d -l 127.0.0.1 /dev/sda
)&
 
1 members found this post helpful.
Old 03-05-2010, 11:41 AM   #8
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
I've been testing the use of 'dash' as the shell for the main init scripts. All else being equal, boot-time dropped from 17-18 seconds to 6-7 seconds. I really wanted to use dash for all or most of the init scripts, but many require major bash features and trying to maintain a full set of them altered to use dash is a chore. But just by fixing the ones included in sysvinit-scripts gave an astounding improvement.
 
Old 03-05-2010, 11:47 AM   #9
sahko
Senior Member
 
Registered: Sep 2008
Distribution: Slackware
Posts: 1,041

Rep: Reputation: Disabled
You should also do this: http://humanreadable.nfshost.com/sdeg/boot_time.htm
Its really uneeded to execute these commands every single time your machine boots.
 
Old 03-05-2010, 12:19 PM   #10
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Quote:
Originally Posted by gnashley View Post
I've been testing the use of 'dash' as the shell for the main init scripts. All else being equal, boot-time dropped from 17-18 seconds to 6-7 seconds. I really wanted to use dash for all or most of the init scripts, but many require major bash features and trying to maintain a full set of them altered to use dash is a chore. But just by fixing the ones included in sysvinit-scripts gave an astounding improvement.
So, could you provide a list of the ones where it's safe to use dash ? Pls.
 
Old 03-05-2010, 12:29 PM   #11
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
@ TEX -- If you have dash shell installed, you could simply execute each script using dash:

shell$ dash ./rc.script

and note which ones execute cleanly and which ones return errors. This should be "nearly" 100% reliable.

Kinda klunky, yes, but until someone provides an accurate list, it will work.

Myself, I have modified all my rc.init scripts (the incompatible ones) to work with Dash, as of that other thread I posted a while back about "POSIX init scripts for Slackware" or "Dash shell as /bin/sh for slackware" (something like that), but like Gilbert says, unless the scripts actually get fixed/changed up upstream, it's an ongoing task to diff the scripts that come with a new Slackware, against either your modified ones or against the default previous ones.

tuxdev posted a bunch (of fixed ones) on github too; you can find his link inside my thread mentioned above.

I *can* tell you, rc.inet1, rc.inet1.conf and rc.wireless are NOT compatible with Dash. As for the others, off top of my head I can't recall exactly, but in the next few days (since I just installed *most* of -current) I'll be having another look at the new init scripts, and this time (since you may be interested) I will keep a list of which ones I modified vs which were OK.

Hope this helps for now..
Sasha

PS - I've also learned, contrary to my intention in that above mentioned thread, that at this time, linking /bin/sh to /bin/dash provides a bit of a headache sometimes. Not a big one, but a headache nonetheless, so if you plan to use any modified scripts that work with Dash, the best plan would be to change the shebang to read #!/bin/dash

Last edited by GrapefruiTgirl; 03-05-2010 at 12:31 PM.
 
2 members found this post helpful.
Old 03-05-2010, 03:01 PM   #12
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Ok, thanks, I'll try it out.
 
Old 03-05-2010, 04:34 PM   #13
botnet
Member
 
Registered: May 2009
Posts: 158

Rep: Reputation: 40
i just followed all the suggestions in this thread; using dash for init scripts, commenting out services that need not be started at every boot and putting those scripts into cron.daily, and compiled a custom barebones kernel, and boot times are much improved

also nothing seems to be broken!


i hadnt compiled my own kernel in a long time, and never before on this machine, so that last part is a nice surprise...

and note to any out there who might forget this part; append a local version string to your kernel so in case you do miss a vital kernel module, the old modules will still be preserved in /lib/modules/2.6.33
 
Old 03-05-2010, 10:44 PM   #14
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Soooo...

Why not use /bin/ash instead? That even comes with Slackware.
 
Old 03-06-2010, 02:30 AM   #15
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
ash is currently broken on 64-bit systems. I did not link /bin/sh to /bin/dash. Instead, I changed the shebangs in the relavant scripts to explicitly use dash. Using ash or dash as /bin/sh will cause lots of problems elsewhere, even if you make the init scripts run cleanly.

I used some of sashas and some of tuxdevs scripts as a starting point and fixed/adjzsted from there. The main scripts I mean are rc.S, rc.M, rc.4, rc.6 and rc.K.
There are really only a few changes needed for just these. The problems start with the other ones called by these and the way they are called. You need to change all the instances of:
. /etc/rc.d/rc.blah start
to:
/etc/rc.d/rc.blah start
or:
sh /etc/rc.d/rc.blah start
as dash will not pass the 'start' to the child process for some reason. I worled on some of the externals and got most of them working but decided that it would not be good to try and maintain all of them.

tuxdev has modified rc.inet1 and rc.inet2 to work with dash. It would be good to use them as those scripts are long and complicated so any speedups there are significant. I also go rescan-scsi-bus.sh working with dash, but it is mostly not used anymore. Since most of the scripts are distributed with their package, it would be more difficult to manage hacked scripts as a packager. What I mean is, that if the user is to have a choice between using dash or bash, then each package with a 'dashified' rc script would have to offer both scripts and a way would have to be devised to install and use the correct one on a users' system.

Still, as I said, there was a quite significant improvement by modifying only the main scripts. I suspect that they would also work with ash, but I think there is no good reason to go on using ash-0.4 since it is no longer maintained, while dash *is*.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to boot fast? hugihugi Linux - Laptop and Netbook 1 05-28-2008 08:32 PM
celeron 1200 256MB ram dual boot with xp distro suggestion expected oguzhana Linux - Distributions 5 01-10-2008 05:12 PM
My Personal Suggestion For A Vista/linux Easy And Secure Dual Boot DOTT.EVARISTI Linux - Software 2 07-18-2007 02:10 AM
Fast Boot time monkeymartin Linux - General 2 09-23-2003 08:07 PM
Need Help Fast - Server won't boot kau Linux - General 4 05-13-2002 08:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration