LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 10-21-2022, 05:33 AM   #61
NaboHipersonico
Member
 
Registered: Sep 2022
Location: /home
Distribution: Debian 12 bookworm xfce
Posts: 116

Original Poster
Rep: Reputation: 24

Quote:
Originally Posted by GazL View Post
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.
 
Old 10-21-2022, 05:40 AM   #62
NaboHipersonico
Member
 
Registered: Sep 2022
Location: /home
Distribution: Debian 12 bookworm xfce
Posts: 116

Original Poster
Rep: Reputation: 24
in the command this:

bash-5.1$ su
Contraseña:
bash-5.1# dmesg | tail
[ 16.513044] caller _nv000720rm+0x1ad/0x200 [nvidia] mapping multiple BARs
[ 17.565893] r8169 0000:0f:00.0 eth1: Link is Up - 1Gbps/Full - flow control rx/tx
[ 17.565910] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[ 17.595143] 8021q: 802.1Q VLAN Support v1.8
[ 17.619550] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ 17.622975] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[ 28.731590] fuse: init (API version 7.34)
[ 30.355475] logitech-hidpp-device 0003:046D:102A.0005: HID++ 1.0 device connected.
[ 131.592152] clocksource: timekeeping watchdog on CPU6: hpet wd-wd read-back delay of 71377ns
[ 131.592161] clocksource: wd-tsc-wd read-back delay of 143733ns, clock-skew test skipped!
bash-5.1#

In the last two lines, it seems to say that there are reading delays, I don't know if it has something to do with it:

[ 131.592152] clocksource: timekeeping watchdog on CPU6: hpet wd-wd read-back delay of 71377ns
[ 131.592161] clocksource: wd-tsc-wd read-back delay of 143733ns, clock-skew test skipped!

Last edited by NaboHipersonico; 10-21-2022 at 05:42 AM.
 
Old 10-21-2022, 10:02 AM   #63
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,915

Rep: Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033
Quote:
Originally Posted by NaboHipersonico View Post
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.
 
1 members found this post helpful.
Old 10-21-2022, 10:24 AM   #64
NaboHipersonico
Member
 
Registered: Sep 2022
Location: /home
Distribution: Debian 12 bookworm xfce
Posts: 116

Original Poster
Rep: Reputation: 24
Quote:
Originally Posted by GazL View Post
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.
 
Old 10-21-2022, 12:05 PM   #65
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,065

Rep: Reputation: Disabled
Quote:
Originally Posted by NaboHipersonico View Post
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.
Forget the videos, read and experiment.
Some links:
https://doc.opensuse.org/documentati...-new-bash.html
https://doc.opensuse.org/documentati...adm-shell.html
https://pubs.opengroup.org/onlinepub...V3_chap02.html
https://www.grymoire.com/Unix/Sh.html
 
4 members found this post helpful.
Old 10-21-2022, 12:38 PM   #66
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,915

Rep: Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033
This! Especially the experiment part.
 
2 members found this post helpful.
Old 10-21-2022, 01:17 PM   #67
henca
Member
 
Registered: Aug 2007
Location: Linköping, Sweden
Distribution: Slackware
Posts: 992

Rep: Reputation: 674Reputation: 674Reputation: 674Reputation: 674Reputation: 674Reputation: 674
Quote:
Originally Posted by NaboHipersonico View Post
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.

regards Henrik
 
4 members found this post helpful.
Old 10-21-2022, 02:14 PM   #68
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,065

Rep: Reputation: Disabled
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.
 
4 members found this post helpful.
Old 10-21-2022, 03:08 PM   #69
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
Thanks for the Link Didier Spaier !

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]

Anyhow ... Thanks again !

-- kjh
 
1 members found this post helpful.
Old 10-21-2022, 03:29 PM   #70
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,065

Rep: Reputation: Disabled
@kjhambrick: You are welcome. As an aside, this small script is immune of any bashism, at least according to shellcheck
 
1 members found this post helpful.
Old 10-21-2022, 03:40 PM   #71
NaboHipersonico
Member
 
Registered: Sep 2022
Location: /home
Distribution: Debian 12 bookworm xfce
Posts: 116

Original Poster
Rep: Reputation: 24

Very good information, thank you very much, of course I will study everything.
 
Old 10-21-2022, 03:42 PM   #72
NaboHipersonico
Member
 
Registered: Sep 2022
Location: /home
Distribution: Debian 12 bookworm xfce
Posts: 116

Original Poster
Rep: Reputation: 24
Quote:
Originally Posted by henca View Post
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.

regards Henrik
Excellent, great information. Thanks a lot.
 
  


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
what is the default powerstate (e.g. S3,S4,S5) for the command 'shutdown -hP' or 'shutdown -hH' or 'shutdown -h' badbetty Slackware 6 11-12-2017 12:18 AM
LXer: Firefox 3.5 Speed Freak: Faster Development, Faster Performance LXer Syndicated Linux News 0 06-10-2009 02:42 AM
LXer: Firefox 3 Beta 4 is 5x faster than IE7, 3x faster than FF2 LXer Syndicated Linux News 0 03-12-2008 05:50 PM
DISCUSSION: Faster and Faster Compilation jeremy LinuxAnswers Discussion 5 12-06-2005 01:41 AM

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

All times are GMT -5. The time now is 01:35 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