Slackware This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
|
04-26-2014, 01:53 PM
|
#1
|
Senior Member
Registered: Mar 2004
Location: Kirkwall, Orkney
Distribution: Linux Mint 20.3 - Cinnamon
Posts: 1,425
Rep:
|
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
|
|
|
04-26-2014, 02:36 PM
|
#2
|
Senior Member
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982
|
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.
|
04-26-2014, 03:16 PM
|
#3
|
Senior Member
Registered: Mar 2004
Location: Kirkwall, Orkney
Distribution: Linux Mint 20.3 - Cinnamon
Posts: 1,425
Original Poster
Rep:
|
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
|
|
|
04-26-2014, 03:24 PM
|
#4
|
LQ Guru
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,564
|
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.
|
04-26-2014, 03:34 PM
|
#5
|
Senior Member
Registered: Mar 2004
Location: Kirkwall, Orkney
Distribution: Linux Mint 20.3 - Cinnamon
Posts: 1,425
Original Poster
Rep:
|
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
|
|
|
04-26-2014, 03:54 PM
|
#6
|
Senior Member
Registered: Mar 2004
Location: Kirkwall, Orkney
Distribution: Linux Mint 20.3 - Cinnamon
Posts: 1,425
Original Poster
Rep:
|
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
|
|
|
04-26-2014, 05:11 PM
|
#7
|
Senior Member
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982
|
Quote:
Originally Posted by samac
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.
|
04-27-2014, 04:24 AM
|
#8
|
Member
Registered: Dec 2008
Location: Cape Town, South Africa
Distribution: Slackware 15.0
Posts: 634
|
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.
|
|
|
04-27-2014, 05:28 AM
|
#9
|
Moderator
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
|
Quote:
Originally Posted by samac
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.
|
|
|
04-27-2014, 07:25 AM
|
#10
|
Senior Member
Registered: Mar 2004
Location: Kirkwall, Orkney
Distribution: Linux Mint 20.3 - Cinnamon
Posts: 1,425
Original Poster
Rep:
|
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
|
|
|
04-27-2014, 09:27 AM
|
#11
|
Moderator
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
|
Just set up a static IP and your router as standard gateway and nameserver, I don't see why this shouldn't work.
|
|
|
04-27-2014, 10:22 AM
|
#12
|
Senior Member
Registered: Mar 2004
Location: Kirkwall, Orkney
Distribution: Linux Mint 20.3 - Cinnamon
Posts: 1,425
Original Poster
Rep:
|
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
|
|
|
04-27-2014, 10:25 AM
|
#13
|
Member
Registered: Dec 2008
Location: Cape Town, South Africa
Distribution: Slackware 15.0
Posts: 634
|
Could you tell us the make of this router, so that we can all avoid it.
|
|
|
04-27-2014, 01:33 PM
|
#14
|
Member
Registered: Sep 2011
Posts: 925
|
Quote:
Originally Posted by samac
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.
|
|
|
04-27-2014, 03:46 PM
|
#15
|
Senior Member
Registered: Mar 2004
Location: Kirkwall, Orkney
Distribution: Linux Mint 20.3 - Cinnamon
Posts: 1,425
Original Poster
Rep:
|
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
|
|
|
All times are GMT -5. The time now is 04:44 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|