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.
I put some stuff into my rc.local stuff and default runlevel is 4 to go to KDE login screen.
During bootup I see some messages but not my rc.local stuff.
When I su to root and run "/etc/rc.d/rc.local" I can see my stuff run.
I then put lots of echos in the /etc/rc.d/ rc.S & inet1 etc and rebooted but still no joy. There are no echos of mine showing that rc.local is run.
rc.S and most others are not changed in any way except for my echo adds. And in rc.M this is the script as is to get my rc.local going
# Start the local setup procedure.
if [ -x /etc/rc.d/rc.local ]; then
. /etc/rc.d/rc.local
fi
I had previously posted on a earlier issue similar and received advice about viewing my bootup messages with dmesg. This currently stops at line 145.
Looking at /var/log messages or syslog is also too short, in my opinion.
user NotAcoolNick suggesting having a look at man bootparam. Which I did. I think I need to change some buffer size or maybe debug.
I was on GRUB bootloader but swapped to lILO ran liloconf then tried to edit my lilo.conf file with words like debug and buff=N1 but when I run lilo -v -v -v they report unrecognised commands of debug etc.
Now its possible I have not understood the man pages, but if others get a chance to look at man bootparam you may agree it does not explain what the various options are.
What are buff=N1 N2 N3 N4 N5 N6 anyway, if relevant?
So here I am doing a post.
My personal problem is I can not see rc.local working at boot and dmesg appears to be too short.
I am not moving away from slackware but my brain hurts. Any tips on whats wrong with my setup will be accepted with blinding speed.
I would call rc.local explicitly from rc.M at the end, rather than with an "if executable..."
That could help troubleshoot.
i have
echo "rc.local executing..."
at the beginning of mine.
You could add a sleep command or two within it to see if that slows it down for you to see.
Another thing, dmesg only shows boot info up to the point the root file system is mounted (i think..) so rc.local stuff wouldn't be in there.
See where these things lead you.
Good luck in case I'm wrong
--Shade
Firstly thanks for the tip on why I can't read local stuff in dmesg etc.
2) Once booted I put a sleep command like sleep 2 into my rc.M and rc.local and run them in su mode with great success using /etc/rc.d/rc.local etc (without a period b4 the /)
I then edited these files and tried in vain withot the if command as either
/etc/rc.d/rc.local or ditto but with a dot b4 the /
AND then is su mode one booted with each option I tried to see if my local stuff had worked.
3) B4 I get too excited, I know that I can add what I want to my rc.S and I have done so to test and it works so if you are not following this post I will have to do this but its messy and I still want to solve this with your or anyone's help.
4) so one of the local commands I test is my hdparm command. I have an old board and I have used the timing commands to get the bestest stable read writes so for my old board its
hdparm -c0d1u1X66 /dev/hda
Of interest is that my doing a simple check of
hdparm -X /dev/hda shows my local as not booted at all as it defaults to pio mode and not a udma mode.
Just to be sure another weird setting I use is the c0
test shows on reboot its c=1
Therefore I know that my rc.local is not loaded at boot or if it is, some darn thing is undoing it.
And to repeat is su mode, once booted I can see my hdparm commands take effect with echos and sleep and so on.
My slack 9 don't show me anything and I know it is running:
get the RC's files to original and put this line on the rc.local file:
/etc/test.sh
and write teste.sh
-------------------------------code starts here
#!/bin/bash
#testing if rc.local is running stuff
echo hello everybody! I'm Running
-----------------------------------code ends here
save it in /etc
and reboot (don't forget to chmod 755 teste.sh)
this may sound rude, but I can run the rc.local file in su mode without a problem in the world and can see my echos and command actually work.
As I understand my problem its getting my rc.local to work on boot.
hanzerik and others
I will test permission problems with this rc.local file by changing the permissions back and forth to see if that makes a difference.
SIDETRACK
I am now thinking I better change to run level 3 and see I can see more info and if runlevel 3 makes any difference.
Thanks for idea of testing everything and I suppose if this fails I may have to do a clean install or change to gnome etc and see if I can break this current cycle of woes.
To repeat, I am no longer desperate as I can run the commands in my rc.S it is just that if this current thingee is broke maybe I have other things broke.
so testing some of my permissions and commands is a darn good idea ?
I'm taking "I can run it in su mode" to mean that you can execute it once you're booted and logged in.
That means that it should have the right permissions set on it.
Did you try my suggestion of having rc.M call /etc/rc.d/rc.local implicitly, rather than with
Code:
# Start the local setup procedure.
if [ -x /etc/rc.d/rc.local ]; then
. /etc/rc.d/rc.local
fi
Just call it directly.
Code:
. /etc/rc.d/rc.local
And yes, I would definitely test all of this booting into runlevel 3 rather than graphical.
What I'm concerned with is that rc.local doesn't seem to be read by rc.M . Calling it specifically may be a solution. But then, we'll want to figure out why calling it with if -x ... doesn't work.
What happens is that when you have runlevel 4 set in inittab, init doesn't run /etc/rc.d/rc.M. Since runlevel 4 is multiuser, when init finishes rc.S it goes stright to whatever script is called by runlevel4 which is /etc/rc.d/rc.4.
If you want rc.local to run, just use the lines from /etc/rc.d/rc.M, copy them into /etc/rc.d/rc.4 before X is started. Voila!
At least this is what seems to be happening. You may be able to get rc.M to run by using runlevel 5 instead of 4. I haven't checked on this though.
I have (in my small mind at least) eliminated change of permissions, run levels and therefore KDE as the culprit.
What I have now found, by putting echos at each line of rc.M that the darn file does appear to do anything after a certain line.
So I moved my rc.local command b4 that line and BINGO the echos for local work and YIPPEE the commands for local work at BOOT
SO i HAVE A NEW PROBLEM why isn't line x executing
here's my entire file, /etc/rc.d/rc.M
you will notice 2 lines to execute rc.local and no echoes occur after CUPS that is I see no echo lines from line 12 onwards and I have commented line 12 onwards to try and get the echos to work
#!/bin/sh
#
# rc.M This file is executed by init(8) when the system is being
# initialized for one of the "multi user" run levels (i.e.
# levels 1 through 6). It usually does mounting of file
# systems et al.
#
# Version: @(#)/etc/rc.d/rc.M 2.23 Wed Feb 26 19:20:58 PST 2003
#
# Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
# Heavily modified by Patrick Volkerding <volkerdi@slackware.com>
#
# Tell the viewers what's going to happen.
echo "Going multiuser..."
# If there's no /etc/HOSTNAME, fall back on this default:
if [ ! -r /etc/HOSTNAME ]; then
echo "darkstar.example.net" > /etc/HOSTNAME
fi
# Set the hostname.
/bin/hostname `cat /etc/HOSTNAME | cut -f1 -d .`
# Initialize the networking hardware. If your network driver is a module
# and you haven't loaded it manually, this will be deferred until after
# the hotplug system loads the module below.
if [ -x /etc/rc.d/rc.inet1 ]; then
. /etc/rc.d/rc.inet1
fi
# Initialize the hotplugging subsystem for PCI, Cardbus, and USB devices:
if [ -x /etc/rc.d/rc.hotplug -a -r /proc/modules ]; then
# Don't run hotplug if 'nohotplug' was given at boot.
if ! grep nohotplug /proc/cmdline 1> /dev/null 2> /dev/null ; then
. /etc/rc.d/rc.hotplug start
fi
fi
# Start networking daemons:
if [ -x /etc/rc.d/rc.inet2 ]; then
. /etc/rc.d/rc.inet2
else
# Start the system logger. Normally this is started by
# rc.inet2 because /usr might be mounted via NFS.
if [ -x /etc/rc.d/rc.syslog ]; then
. /etc/rc.d/rc.syslog start
fi
fi
# Remove stale locks and junk files (must be done after mount -a!)
/bin/rm -f /var/lock/* /var/spool/uucp/LCK..* /tmp/.X*lock /tmp/core /core 2> /dev/null
# Remove stale hunt sockets so the game can start.
if [ -r /tmp/hunt -o -r /tmp/hunt.stats ]; then
echo "Removing your stale hunt sockets from /tmp."
/bin/rm -f /tmp/hunt*
fi
# Update all the shared library links:
if [ -x /sbin/ldconfig ]; then
echo "Updating shared library links: /sbin/ldconfig"
/sbin/ldconfig
fi
# Update the X font indexes:
if [ -x /usr/X11R6/bin/fc-cache ]; then
echo "Updating X font indexes: /usr/X11R6/bin/fc-cache"
/usr/X11R6/bin/fc-cache
fi
echo 9999
# Start the local setup procedure.
/etc/rc.d/rc.local
echo 11
sleep 2
# Start the print spooling system.
if [ -x /etc/rc.d/rc.cups ]; then
. /etc/rc.d/rc.cups start
echo line 89
echo 12
sleep 2
# Start atd (manages jobs scheduled with 'at'):
# if [ -x /usr/sbin/atd ]; then
# /usr/sbin/atd -b 15 -l 1
# fi
echo 13
sleep 2
# Start the APM daemon if APM is enabled in the kernel:
# if [ -x /usr/sbin/apmd ]; then
# if cat /proc/apm 1> /dev/null 2> /dev/null ; then
# echo "Starting APM daemon: /usr/sbin/apmd"
# /usr/sbin/apmd
# fi
# fi
echo 14
sleep 2
# Start the ACPI (Advanced Configuration and Power Interface) daemon:
# if [ -x /etc/rc.d/rc.acpid ]; then
# . /etc/rc.d/rc.acpid start
# fi
echo 15
sleep 2
# Load ALSA (sound) defaults:
# if [ -x /etc/rc.d/rc.alsa ]; then
# . /etc/rc.d/rc.alsa
# fi
echo 16
sleep 2
# Load a custom screen font if the user has an rc.font script.
# if [ -x /etc/rc.d/rc.font ]; then
# . /etc/rc.d/rc.font
# fi
echo 17
sleep 2
# Load a custom keymap if the user has an rc.keymap script.
# if [ -x /etc/rc.d/rc.keymap ]; then
# . /etc/rc.d/rc.keymap
# fi
echo 18
sleep 2
# Start the GPM mouse server:
# if [ -x /etc/rc.d/rc.gpm ]; then
# . /etc/rc.d/rc.gpm start
# fi
echo 19
sleep 2
# If there are SystemV init scripts for this runlevel, run them.
# if [ -x /etc/rc.d/rc.sysvinit ]; then
# . /etc/rc.d/rc.sysvinit
# fi
echo 20
# Start the local setup procedure.
/etc/rc.d/rc.local
echo 21 end end
# All done.
fi
################################end of file##########################
requests
1) Obviously I don't know what I am doing or I would have solved this dilemma. If you spot the obvious or spelling error or anything feel free to say so please.
2) You can guess that I am happy I solved one problem only to find another, its not the start of the end but the end of the start (Churchillian)
Sorry, what I said above was kinda based on speculation and the comments of someone last week having a similar problem.
Do I understand correctly that rc.M does begin, but you get no echoes after starting CUPS? if that's the case then there must be some syntax problem with that command.
So you get echo
9999
11
but no 89?
its 9999
then my internal echos for the rc.local file
then 11 then message cups server and then it jumps to either my login screen for runlevel 3 or KDE login screnn for runlevel 4.
SIDETRACK
originally I had a echo for each command in rc.M and they often had messages that they were starting something X so once I knew echos 1 to 10 were ok I culled the file slightly.
This had got me thinking (well I can type ) my cups is starting but is an USB epsom, should that make any difference?
I was not thinking it would as when I do printing I turn it on and print away as CUPS as truly started and if I were to to a top command I can see the cupsd (daemon)?
I see two things: rc.local is being called twice, although if I understand correctly the second instance is not being run. The other thing could be the problem- there is an extra fi at the end of the script. try commenting that out and see if it works.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.