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.
There are a bunch of things in rc.M that run every boot, that don't strictly need to run every boot but only when things change.
In the past I used this patch to move them out or rc.M which saved me a good 10 - 15 seconds (on 5200rpm spinning rust. SSD users will most likely see less of a saving).
Please note: I put this here only to identify where some small savings might be made. The patch is outdated and will need updating for 15.0/current
Code:
# Patch to move some of the maintenance tasks out of rc.M
# and into their own rc file to improve boot-speed.
#
# You will probably want to run the rc.maintenance script
# from inittab. See the comments in the script for an example.
#
# Apply with:
# cd /etc/rc.d && patch -p1 < rc.maintenance.patch
#
diff -Nurp a/rc.M b/rc.M
--- a/rc.M 2017-02-06 14:29:59.555173098 +0000
+++ b/rc.M 2017-02-06 14:29:15.925898230 +0000
@@ -77,12 +77,6 @@ if [ -x /etc/rc.d/rc.syslog -a -x /usr/s
. /etc/rc.d/rc.syslog start
fi
-# 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
-
# Run rc.udev again. This will start udev if it is not already running
# (for example, upon return from runlevel 1), otherwise it will trigger it
# to look for device changes and to generate persistent rules if needed.
@@ -163,28 +157,6 @@ if [ -x /etc/rc.d/rc.cpufreq ]; then
. /etc/rc.d/rc.cpufreq start
fi
-# Update any existing icon cache files:
-if find /usr/share/icons -maxdepth 2 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
-
# Start console-kit-daemon:
if [ -x /etc/rc.d/rc.consolekit ]; then
sh /etc/rc.d/rc.consolekit start
@@ -201,29 +173,6 @@ if [ -x /etc/rc.d/rc.pulseaudio ]; then
. /etc/rc.d/rc.pulseaudio start
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
- echo "Updating gtk.immodules:"
- echo " /usr/bin/update-gtk-immodules &"
- /usr/bin/update-gtk-immodules > /dev/null 2>&1 &
-fi
-if [ -x /usr/bin/update-gdk-pixbuf-loaders ]; then
- echo "Updating gdk-pixbuf.loaders:"
- echo " /usr/bin/update-gdk-pixbuf-loaders &"
- /usr/bin/update-gdk-pixbuf-loaders > /dev/null 2>&1 &
-fi
-if [ -x /usr/bin/update-pango-querymodules ]; then
- echo "Updating pango.modules:"
- echo " /usr/bin/update-pango-querymodules &"
- /usr/bin/update-pango-querymodules > /dev/null 2>&1 &
-fi
-if [ -x /usr/bin/glib-compile-schemas ]; then
- echo "Compiling GSettings XML schema files:"
- echo " /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas &"
- /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas >/dev/null 2>&1 &
-fi
-
# Start dnsmasq, a simple DHCP/DNS server:
if [ -x /etc/rc.d/rc.dnsmasq ]; then
/etc/rc.d/rc.dnsmasq start
diff -Nurp a/rc.maintenance b/rc.maintenance
--- a/rc.maintenance 1970-01-01 01:00:00.000000000 +0100
+++ b/rc.maintenance 2017-02-06 14:55:43.940949765 +0000
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+# Script to run system maintenane tasks.
+#
+# Run this script from rc.M, rc.local or add the following to your
+# /etc/inittab to run this script in the background at system boot:
+# # Maintenance scripts
+# m1:34:once:/etc/rc.d/rc.maintenance
+
+exec >/var/log/maintenance.log 2>&1
+
+# Update the X font indexes:
+/usr/bin/fc-cache -v -s -f
+
+# Update any existing icon cache files:
+rm -f /usr/share/icons/icon-theme.cache
+find /usr/share/icons -maxdepth 2 -name 'icon-theme.cache' \
+ -printf '%h\0' \
+ | xargs -0r -I'{}' /usr/bin/gtk-update-icon-cache -t -f '{}'
+
+# Update mime database:
+/usr/bin/update-mime-database /usr/share/mime
+
+# These GTK+/pango files need to be kept up to date for
+# proper input method, pixbuf loaders, and font support.
+[ -x /usr/bin/update-gtk-immodule ] && /usr/bin/update-gtk-immodules --verbose
+[ -x /usr/bin/update-gdk-pixbuf-loaders ] && /usr/bin/update-gdk-pixbuf-loaders --verbose
+[ -x /usr/bin/update-pango-querymodules ] && /usr/bin/update-pango-querymodules --verbose
+[ -x /usr/bin/glib-compile-schemas ] && /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas
+
+# All done.
Also, when comparing to systemd based systems, remember that systemd starts things on demand while Slackware starts things in advance. systemd may look like it boots faster, but the reality is that it's likely still only half-up. Ever tried to boot window and sign in the instant the login prompt shows? You end up with a non responsive desktop for 10-20 seconds, or more, because the system isn't actually fully up: it only looks like it is. The systemd situation is similar, though it happens because of the nature of the systemd design rather than an intentional attempt to deceive the user about boot speed, which is my suspicion about the Microsoft's product.
When comparing boot times, you need to make sure you're comparing like for like.
Anyway, for what it's worth...
Hello, I don't know how to know what I have in rc.M, I don't know how it looks, but it would be interesting to know.
The script that you give me is really interesting, but I don't know how to execute it, it seems that there are several scripts, I don't know which scripts I really don't understand much, apart from if you say that it is not valid for slackware 15, I use precisely slackware 15.
Hello, I don't know how to know what I have in rc.M, I don't know how it looks, but it would be interesting to know.
As your skill level and experience increases it'll mean more to you. Given your current level of understanding it's best to leave rc.M be. Knocking 10 seconds off really isn't a big deal in the scheme of things and you don't want the hassle of maintaining non-standard init-scripts before it becomes second nature to you.
If you're serious about understanding this stuff start by learning the shell and shell-scripting. Once you're comfortable with that all this other stuff will just fall into place.
As your skill level and experience increases it'll mean more to you. Given your current level of understanding it's best to leave rc.M be. Knocking 10 seconds off really isn't a big deal in the scheme of things and you don't want the hassle of maintaining non-standard init-scripts before it becomes second nature to you.
If you're serious about understanding this stuff start by learning the shell and shell-scripting. Once you're comfortable with that all this other stuff will just fall into place.
Don't worry, I don't intend to waste anyone's time, the 10, 20 or 30 seconds thing doesn't really matter to me, I just do it to learn and a good way is to google a lot, that's how I installed slackware, I installed everything and configured all without having to ask anything and the forums are also very good to learn.
It's clear that I have to learn shell, I'm already thinking of starting with several youtube videos, because that's how you really learn linux, learning shell, the problem is that you spend years using linux, but you use ubuntu, linux mint, etc and since it's all graphic and they give you everything done, well you don't really learn linux, you learn to manage different distributions, even debian and fedora are no longer what they were, any novice installs them and they won't have many problems.
So I'll leave this post parked and when I have more knowledge I'll come back, hahaha.
Everyone who comes to slackware never comes with the necessary knowledge to handle it unless they are a linux system administrator, if what they have done before is handling different distributions, everyone who comes to slackware can be considered a novice.
If someone wants to continue contributing to the post to other questions and doubts that I have formulated or about the post in general, I am grateful because that way I continue to learn more.
It can also be useful for other colleagues who pass by here in the future.
Thanks for everything. Greetings.
Last edited by NaboHipersonico; 10-21-2022 at 10:41 AM.
It's clear that I have to learn shell, I'm already thinking of starting with several youtube videos, because that's how you really learn linux, learning shell, the problem is that you spend years using linux, but you use ubuntu, linux mint, etc and since it's all graphic and they give you everything done, well you don't really learn linux, you learn to manage different distributions, even debian and fedora are no longer what they were, any novice installs them and they won't have many problems.
I see that all those who have published here have these processes activated, so they will be important, but I don't know what they are, if someone can explain it to me, because of learning. Thanks.
Code:
-rwxr-xr-x 1 root root 18050 ene 27 2022 /etc/rc.d/rc.S
-rwxr-xr-x 1 root root 13230 12 de noviembre de 2021 /etc/rc.d/rc.M
-rwxr-xr-x 1 raíz raíz 3303 23 de abril de 2021 /etc/rc.d/rc.K
-rwxr-xr-x 1 raíz raíz 1649 24 de abril de 2021 / etc/rc.d/rc.4
-rwxr-xr-x 1 raíz raíz 10077 10 de noviembre de 2021 /etc/rc.d/rc.6
Those files should be left executable as they are not really "services" but different "run levels".
In the file /etc/inittab comments describe what different run levels are for and that file also explains which scripts are being called at different run levels.
rc.6 is called when you reboot your system.
rc.0 is called when the system is halted (shutdown).
Both these scripts should be allowed to do what they need as they usually kill processes and nicely unmounts file systems.
rc.4 is the script starting your graphical login if you have choosen to use runlevel 4 by default.
rc.M is for the "multiuser" run level, that is the level before run level 4 with only a text login but all network configuration and services running that you have selected.
rc.S is for single user, this is the Linux "failsafe" mode, mostly used to repair broken root file systems.
About shell scripting, utilities and POSIX I could not agree more on what Drew DeVault wrote here: https://drewdevault.com/2018/02/05/I...SIX-shell.html As an aside, other articles of his blog as also interesting.
Like Drew, I am a #!/bin/sh kinda guy ( as opposed to #!/bin/bash )
[OffTopic]I must have missed the discussion on the SBo Mailing list about converting all .SlackBuild Files to #!/bin/bash instead of good-old #!/bin/sh scripts ...
I don't understand that requirement but I am more an SBo user than a developer.[/Offtopic]
Those files should be left executable as they are not really "services" but different "run levels".
In the file /etc/inittab comments describe what different run levels are for and that file also explains which scripts are being called at different run levels.
rc.6 is called when you reboot your system.
rc.0 is called when the system is halted (shutdown).
Both these scripts should be allowed to do what they need as they usually kill processes and nicely unmounts file systems.
rc.4 is the script starting your graphical login if you have choosen to use runlevel 4 by default.
rc.M is for the "multiuser" run level, that is the level before run level 4 with only a text login but all network configuration and services running that you have selected.
rc.S is for single user, this is the Linux "failsafe" mode, mostly used to repair broken root file systems.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.