LinuxQuestions.org
Review your favorite Linux distribution.
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 04-26-2014, 01:53 PM   #1
samac
Senior Member
 
Registered: Mar 2004
Location: Kirkwall, Orkney
Distribution: Linux Mint 20.3 - Cinnamon
Posts: 1,425

Rep: Reputation: 139Reputation: 139
Modify rc.M for a faster boot, is this safe.


I have managed to half my boot speed to around 20 seconds by making a couple of changes to rc.M

I would like to know if what I have done is safe or will it cause unexpected problems further down the line.

Code:
# Initialize the networking hardware.
if [ -x /etc/rc.d/rc.inet1 ]; then
  . /etc/rc.d/rc.inet1 & 
fi
Added an & ampersand to background the network hardware discovery.

Remmed font cache update, icon cache update, mime type update and GTK+/pango but added them to a script that I intend to run from cron.
Code:
#!/bin/sh
#
# Update shared libraries, font cache, icon cache and GTK+/pango
# 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
# Update mime database:
if [ -x /usr/bin/update-mime-database -a -d /usr/share/mime ]; then
  echo "Updating MIME database:  /usr/bin/update-mime-database /usr/share/mime &"
  /usr/bin/update-mime-database /usr/share/mime 1> /dev/null 2> /dev/null &
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
if [ -x /usr/bin/glib-compile-schemas ]; then
  /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas >/dev/null 2>&1
fi
# All done.
Any thoughts?

samac

Last edited by samac; 04-26-2014 at 03:59 PM. Reason: UPDATED script
 
Old 04-26-2014, 02:36 PM   #2
metaschima
Senior Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
None of these modifications will speed anything up significantly. First, you cannot background inet1 because it is sourced. Second, the '&' at the end of the other commands will background them, so I don't see why you would move these to cron. The ones you should move to cron are the GTK+/pango updates as these are very slow and don't need to be run very often.
 
1 members found this post helpful.
Old 04-26-2014, 03:16 PM   #3
samac
Senior Member
 
Registered: Mar 2004
Location: Kirkwall, Orkney
Distribution: Linux Mint 20.3 - Cinnamon
Posts: 1,425

Original Poster
Rep: Reputation: 139Reputation: 139
Hmm rc.inet1 on my computer takes at least 15 seconds to find the dhcp address, yet GTK+/pango are completed in about 1 to 2 seconds. OK I agree with the other things.

samac
 
Old 04-26-2014, 03:24 PM   #4
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,564
Blog Entries: 15

Rep: Reputation: 2117Reputation: 2117Reputation: 2117Reputation: 2117Reputation: 2117Reputation: 2117Reputation: 2117Reputation: 2117Reputation: 2117Reputation: 2117Reputation: 2117
Updates library links and such from cron is recommended actually by many people here to shave off the boot time. As far as inet however, you may want to fully test that before committing it. Messing with inet1 because it's the first network daemon initialized can cause a lot of problems with network services, so do be VERY careful with it.

There is yet another way to shave off more boot time but it involves replacing sysvinit with another init package like Runit.

Now before you go rushing off to grab Runit, let me warn you ahead of time. Runit does NOT come with premade run scripts to initialize daemons, you have to create them on your own using the trigger commands located in each sysv/bsd script used by Slackware and it's a tedious process to create, test, and debug them. It is however sysvinit script compatible, and you can run sysvinit and bsdinit scripts from Runit while you migrate them to Runit run scripts. The Runit website has a lot of information that is vital you fully read and understand.

This is just my personal opinion, but Runit is fast and highly customizable as an init system, but it's not as user friendly as sysvinit and bsdinit. Most stuff is admin created, so you'll have to know bash shell scripting at least and daemon control executions and flags extensively. It handles runlevels differently also. It does have an auto triggered console in case a boot process fails which is nice for administration purposes. As well as this most daemons can be loaded in parallel vastly speeding up boot time and shutdown processes, it also does daemon management as well.

My suggestion is to not go the route of an alternative init until you fully understand init systems. BSDinit ans SysVinit can be sped up, but it depends on which service daemons you want to load, and when you load them. Desktops like KDE and Xfce have the ability to run daemons on startup in the background.

I've been experimenting with Runit for a few months now but I'm still not comfortable with it, however, it is one of the more promising init systems that spans several operating systems across the UNIX spectrum.
 
4 members found this post helpful.
Old 04-26-2014, 03:34 PM   #5
samac
Senior Member
 
Registered: Mar 2004
Location: Kirkwall, Orkney
Distribution: Linux Mint 20.3 - Cinnamon
Posts: 1,425

Original Poster
Rep: Reputation: 139Reputation: 139
My machine is a stand alone machine only used to access the internet and read email. I run no other network services, that I am aware of, and so far it doesn't seem to have had any problems, although I was concerned that rc.inet2 would probably be run before rc.inet1 finished configuring the hardware.

I have no plans to change to Runit, but I would like to speed up my dhcp connection. The main problem is that my broadband router needs longer than the default Slackware setup time to be found, to reply and set up dhcp. So I've had to lengthen the wait time from 10 to 15.

If this process could be done in the background then I get my boot time to about 20 seconds.

samac
 
Old 04-26-2014, 03:54 PM   #6
samac
Senior Member
 
Registered: Mar 2004
Location: Kirkwall, Orkney
Distribution: Linux Mint 20.3 - Cinnamon
Posts: 1,425

Original Poster
Rep: Reputation: 139Reputation: 139
Had a quick look at rc.inet2 and the only thing that I use in there is rc.firewall, possibly rc.inetd, so I can't see a problem for me. Am I missing something?

samac
 
Old 04-26-2014, 05:11 PM   #7
metaschima
Senior Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
Originally Posted by samac View Post
Hmm rc.inet1 on my computer takes at least 15 seconds to find the dhcp address, yet GTK+/pango are completed in about 1 to 2 seconds. OK I agree with the other things.

samac
An option would be to undo any changes to 'rc.inet1.conf', set all values to "", and use network manager or wicd. This way connections don't need to take up boot time, and if connections go down you can set it auto reconnect.
 
1 members found this post helpful.
Old 04-27-2014, 04:24 AM   #8
Mark Pettit
Member
 
Registered: Dec 2008
Location: Cape Town, South Africa
Distribution: Slackware 15.0
Posts: 634

Rep: Reputation: 302Reputation: 302Reputation: 302Reputation: 302
If you want a faster boot, consider looking at e4rat. Once setup, it monitors all the programs and files that are used for a certain period of time - say 10 minutes. Then, it rearranges all the files on disk to be physically ordered in the order you use them. This results in a boot process that merely shifts the disk head in a steady direction, not randomly. I found it to be very significant. And it's not only the boot - there's the startup of X-windows, your DE (eg gnome,kde, xfce) and the first few programs you generally use (firefox, thunderbird, libreoffice, xterm - all of these start up faster. As long as you set the sample period big enough. Of course, all meaningless if you have a ssd. I recently acquired a hybrid disk - a 1 TB laptop drive with 8 GB of ssd - 4 for read-cache and 4 for write cache. This also makes a difference, altho' you have no real control over how it works.
 
Old 04-27-2014, 05:28 AM   #9
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Quote:
Originally Posted by samac View Post
I have no plans to change to Runit, but I would like to speed up my dhcp connection. The main problem is that my broadband router needs longer than the default Slackware setup time to be found, to reply and set up dhcp. So I've had to lengthen the wait time from 10 to 15.
The solution would be to not use DHCP, give the machine a fixed IP and you won't have to wait for the router.
 
Old 04-27-2014, 07:25 AM   #10
samac
Senior Member
 
Registered: Mar 2004
Location: Kirkwall, Orkney
Distribution: Linux Mint 20.3 - Cinnamon
Posts: 1,425

Original Poster
Rep: Reputation: 139Reputation: 139
My router is supplied by the ISP and it only wants to connect using dhcp, so a atatic IP doesn't seem to be the solutions, unless anyone knows a way around this.

samac
 
Old 04-27-2014, 09:27 AM   #11
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Just set up a static IP and your router as standard gateway and nameserver, I don't see why this shouldn't work.
 
Old 04-27-2014, 10:22 AM   #12
samac
Senior Member
 
Registered: Mar 2004
Location: Kirkwall, Orkney
Distribution: Linux Mint 20.3 - Cinnamon
Posts: 1,425

Original Poster
Rep: Reputation: 139Reputation: 139
Still no luck

IP 192.168.3.33
netmask 255.255.255.0
router IP 192.168.3.254
Gateway192.168.3.254
nameserver 192.168.3.254 or 8.8.8.8

I'm using netconfig as root and restarting rc.inet1 and rc.inet2 after each modification.

I'm currently back on dhcp.

samac
 
Old 04-27-2014, 10:25 AM   #13
Mark Pettit
Member
 
Registered: Dec 2008
Location: Cape Town, South Africa
Distribution: Slackware 15.0
Posts: 634

Rep: Reputation: 302Reputation: 302Reputation: 302Reputation: 302
Could you tell us the make of this router, so that we can all avoid it.
 
Old 04-27-2014, 01:33 PM   #14
jtsn
Member
 
Registered: Sep 2011
Posts: 925

Rep: Reputation: 483Reputation: 483Reputation: 483Reputation: 483Reputation: 483
Quote:
Originally Posted by samac View Post
My router is supplied by the ISP and it only wants to connect using dhcp, so a atatic IP doesn't seem to be the solutions, unless anyone knows a way around this.
Get your own (Wi-Fi) broadband router, preferably with WRT pre-installed, which has an ethernet WAN port, and put it between your network and the ISP device. Your router then talks DHCP to the alien ISP device without slowing down your PC boot-up every time and on the LAN side you can do what you want and what works best for you.
 
Old 04-27-2014, 03:46 PM   #15
samac
Senior Member
 
Registered: Mar 2004
Location: Kirkwall, Orkney
Distribution: Linux Mint 20.3 - Cinnamon
Posts: 1,425

Original Poster
Rep: Reputation: 139Reputation: 139
Quote:
Get your own (Wi-Fi) broadband router, preferably with WRT pre-installed, which has an ethernet WAN port, and put it between your network and the ISP device. Your router then talks DHCP to the alien ISP device without slowing down your PC boot-up every time and on the LAN side you can do what you want and what works best for you.
I have a broadband router set up a wireless access point. Could I use this? If so, how?

samac
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] How to boot faster? george-lappies Slackware 2 05-23-2011 02:55 AM
LXer: Linux 2.6.30 Gets Faster Boot - but is Fedora Faster? LXer Syndicated Linux News 0 06-11-2009 04:40 AM
How to boot into safe mode in XP when i run dual boot XP/suse? suse91pro General 5 11-02-2006 03:28 AM
how to boot faster? chandan Linux - General 6 07-03-2003 06:36 PM
How to boot Mandrake Linux faster (skip boot option) lava Linux - General 7 02-28-2003 02:39 PM

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

All times are GMT -5. The time now is 04:44 PM.

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