LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   slackware 13.1 speeding up boot time (http://www.linuxquestions.org/questions/slackware-14/slackware-13-1-speeding-up-boot-time-820654/)

H_TeXMeX_H 07-19-2010 06:18 AM

slackware 13.1 speeding up boot time
 
Just some things I changed to speed up the boot time.

In '/etc/rc.d/'

rc.acpid
Code:

    echo "Starting ACPI daemon:  /usr/sbin/acpid &"
    /usr/sbin/acpid &

rc.hald
Code:

    echo "Starting HAL daemon:  /usr/sbin/hald --daemon=yes &"
    /usr/sbin/hald --daemon=yes &

rc.M

Note that commenting out some of these may mess things up, but you can run these commands manually. However, I don't see why this has to be done EVERY BOOT.

Code:

# Update the X font indexes:
#if [ -x /usr/bin/fc-cache ]; then
#  echo "Updating X font indexes:  /usr/bin/fc-cache -f &"
#  /usr/bin/fc-cache -f &
#fi

# Update any existing icon cache files:
#if find /usr/share/icons 2> /dev/null | grep -q icon-theme.cache ; then
#  for theme_dir in /usr/share/icons/* ; do
#    if [ -r ${theme_dir}/icon-theme.cache ]; then
#      echo "Updating icon-theme.cache in ${theme_dir}..."
#      /usr/bin/gtk-update-icon-cache -t -f ${theme_dir} 1> /dev/null 2> /dev/null &
#    fi
#  done
  # This would be a large file and probably shouldn't be there.
#  if [ -r /usr/share/icons/icon-theme.cache ]; then
#    echo "Deleting icon-theme.cache in /usr/share/icons..."
    #/usr/bin/gtk-update-icon-cache -t -f /usr/share/icons 1> /dev/null 2> /dev/null &
#    rm -f /usr/share/icons/icon-theme.cache
#  fi
#fi

# These GTK+/pango files need to be kept up to date for
# proper input method, pixbuf loaders, and font support.
#if [ -x /usr/bin/update-gtk-immodules ]; then
#  /usr/bin/update-gtk-immodules --verbose
#fi
#if [ -x /usr/bin/update-gdk-pixbuf-loaders ]; then
#  /usr/bin/update-gdk-pixbuf-loaders --verbose
#fi
#if [ -x /usr/bin/update-pango-querymodules ]; then
#  /usr/bin/update-pango-querymodules --verbose
#fi

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 a 2.6.x or newer kernel udev mounts devpts.
# 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

Of course you can also use the lilo 'compact' option, and compile a new kernel ... but I bet many will not do that.

Anyway, I'll be away on vacation for a while, so I'll see you later :)

business_kid 07-19-2010 10:05 AM

Have you tried initng?

dimm0k 07-19-2010 11:14 AM

This may come in handy... wanted to cut down on some of the "extra" stuff, but did not have time to look for them.

dugan 07-19-2010 11:48 AM

Woodsman's advice on this:

http://humanreadable.nfshost.com/sdeg/boot_time.htm

vdemuth 07-19-2010 11:52 AM

I moved the GTK immodules updating into a new file and named it rc.update-gtk, and added a call to it from rc.M. This means I just need to chmod it every now and then to run it.

What I would like to do, and it's a pound to a pinch of salt someone here will tell me how, is to run that script automatically, then to somehow have it tagged as having been run, and avoid running it fot the next X number of boots, where X=some arbitrary number I can assign, maybe via a .conf file of some sort.
Anyone any suggestions?

TIA

rmjohnso 07-19-2010 12:35 PM

Quote:

Originally Posted by vdemuth (Post 4038211)
I moved the GTK immodules updating into a new file and named it rc.update-gtk, and added a call to it from rc.M. This means I just need to chmod it every now and then to run it.

What I would like to do, and it's a pound to a pinch of salt someone here will tell me how, is to run that script automatically, then to somehow have it tagged as having been run, and avoid running it fot the next X number of boots, where X=some arbitrary number I can assign, maybe via a .conf file of some sort.
Anyone any suggestions?

TIA

You could always move the script to one of the cron directories and have cron take care of it for you. That's typically what I do.

bgeddy 07-19-2010 07:06 PM

Quote:

What I would like to do, and it's a pound to a pinch of salt someone here will tell me how, is to run that script automatically, then to somehow have it tagged as having been run, and avoid running it fot the next X number of boots, where X=some arbitrary number I can assign, maybe via a .conf file of some sort.
You could try this I've just knocked up :
Code:

#!/bin/bash
SCRIPT=${1:-""}
NUMBOOTS=${2:-10}
CONFFLE=${3:- "/etc/boots.count"}
if [ ! -e $CONFFLE ]
        then
        echo "boots=0" > $CONFFLE
fi
TEST=$(cat $CONFFLE  | sed 's/boots=//' )
let TEST+=1
if [ $TEST -gt $NUMBOOTS ]
        then
        let TEST=$NUMBOOTS
fi
if [ $TEST -eq $NUMBOOTS ]
        then 
        let TEST=0
        sh $SCRIPT

fi
echo "boots=$TEST" > $CONFFLE

It's a simple little bash script that takes another script name, number of boots to cycle (optional - defaults to 10), boot count file (optional - defaults to /etc/boots.count) as parameters. You need to save it somewhere (say /etc/rc.d/rc.boots" and make it executable. Then just substitute your call in /etc/rc.d/rc.M with this and the script name to run. So - to run your rc.update.gtk every 20 boot just put this in /etc/rc.d/rc.M
Code:

/etc/rc.d/rc.boots /etc/rc.d/rc.update-gtk 20"
Note that I have just cobbled this together and done very, very little testing and the script itself does no error checking so beware. It just keeps a count in /etc/boots.count but you could supply differing count files for different boot scripts so they maintain their own count files. This is neccesary as each call of the script treates the associated count file as it's own. If you just have the script to run in that command with a cycle number it defaults to ten boot cycles.

theCapitain 09-21-2010 01:13 PM

Hi,
I've followed the suggestions pointed out in this thread, beside putting in background the start of some daemon I've put part of rc.M into an executable saved in cron.daily like explained by Woodsman obtaining a considerable reduction in boot time. Now I wander if there is a way of knowing if and when this cron's commands are executed … just to be sure that I've done everything properly. Can someone give me instructions?

rob.rice 09-21-2010 01:26 PM

I cut down my boot time on slackware-13.0 by building a monolithic kernel with just the
built-in hardware that's part of my laptop so much so that lsmod returns a blank screen
until I plug something in to a usb port

Richard Cranium 09-21-2010 01:34 PM

I just buy a faster machine.

dimm0k 09-21-2010 01:38 PM

Quote:

Originally Posted by Richard Cranium (Post 4104726)
I just buy a faster machine.

Sounds more like a Windows-specific solution to me...

Richard Cranium 09-21-2010 01:45 PM

Works for slack too.

GazL 09-21-2010 01:49 PM

I just go make coffee while it boots.

easuter 09-21-2010 02:08 PM

Quote:

Originally Posted by GazL (Post 4104741)
I just go make coffee while it boots.

+1.

astrogeek 09-21-2010 02:46 PM

Quote:

Originally Posted by Richard Cranium (Post 4104726)
I just buy a faster machine.

I accept donations of used hardware from rich people :-)


All times are GMT -5. The time now is 10:09 PM.