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 04-19-2004, 12:18 AM   #1
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
rc.local won't run at boot on 9.1


rc.local won't run at boot on 9.1

Hullo

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.

thanks for help you can offer.
 
Old 04-19-2004, 12:31 AM   #2
Shade
Senior Member
 
Registered: Mar 2003
Location: Burke, VA
Distribution: RHEL, Slackware, Ubuntu, Fedora
Posts: 1,418
Blog Entries: 1

Rep: Reputation: 46
That's weird.

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
 
Old 04-19-2004, 01:38 AM   #3
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Original Poster
Rep: Reputation: Disabled
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.

Any clues?
 
Old 04-19-2004, 01:42 AM   #4
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Original Poster
Rep: Reputation: Disabled
Shade

Another small matter, as you have an echo command in your local , where are you reading this file from to see the echo?

Are you seeing this echo at boot up?
 
Old 04-19-2004, 08:29 AM   #5
hanzerik
Member
 
Registered: Jan 2002
Location: Cheyenne Wyoming
Distribution: Debian/Raspbian/Mint
Posts: 717

Rep: Reputation: 32
Are you sure it is executable? chmod 755 /etc/rc.d/rc.local
 
Old 04-19-2004, 08:49 AM   #6
frandalla
Member
 
Registered: Oct 2003
Location: Tokyo - Japan
Distribution: Slackware
Posts: 348
Blog Entries: 1

Rep: Reputation: 37
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)
 
Old 04-19-2004, 09:22 AM   #7
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Original Poster
Rep: Reputation: Disabled
frandalla

I am confused with what you want me to test.

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 ?

Hope I am not confusing the experts out there.
 
Old 04-19-2004, 01:13 PM   #8
Shade
Senior Member
 
Registered: Mar 2003
Location: Burke, VA
Distribution: RHEL, Slackware, Ubuntu, Fedora
Posts: 1,418
Blog Entries: 1

Rep: Reputation: 46
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.

--Shade
 
Old 04-19-2004, 02:59 PM   #9
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
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.
 
Old 04-19-2004, 10:42 PM   #10
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Original Poster
Rep: Reputation: Disabled
gnashley

hmm, well that may be the case for most people I know no different, but with all of my echos commands I KNOW that rc.M starts at boot.

But I think I have now found most of my problem which is a new reply
 
Old 04-19-2004, 10:53 PM   #11
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Original Poster
Rep: Reputation: Disabled
dear ALL

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

################################################ start file here######

#!/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..."

# Screen blanks after 15 minutes idle time.
/bin/setterm -blank 15

# 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

# Ensure basic filesystem permissions sanity.
chmod 755 / 2> /dev/null
chmod 1777 /tmp /var/tmp

# 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)
 
Old 04-20-2004, 04:47 AM   #12
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
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?
 
Old 04-20-2004, 08:59 AM   #13
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Original Poster
Rep: Reputation: Disabled
gnashley

Thats ok glad we are still chatting.

Yes

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)?

Any clues?
 
Old 04-20-2004, 12:55 PM   #14
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
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.
 
Old 04-20-2004, 01:34 PM   #15
portux
Member
 
Registered: Apr 2003
Location: Portugal
Distribution: Slackware 10.1
Posts: 42

Rep: Reputation: 15
If I read right that fi belongs to CUPS if
 
  


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
always have to re-run rc.local calcon Slackware 4 04-02-2005 10:32 AM
Run tomcat on a local machine through apache indika Linux - Software 0 01-11-2005 02:48 AM
fedora c2; rc.local didn't run??? GrumpyGnome Linux - Newbie 2 07-03-2004 08:44 PM
rc.local not being run gw1500se Mandriva 6 05-31-2004 02:49 PM
run vnc-server as other user in rc.local jvdbossc Linux - Newbie 2 05-26-2004 02:10 AM

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

All times are GMT -5. The time now is 04:16 AM.

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