Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

loading modules at startup ?

Status
Not open for further replies.

Grub3r

Technical User
Aug 17, 2006
49
NO
Hello folks,

I would like to load 8021q at startup but i have no idea which script to edit to make this happen.

I've read that i should edit modules.conf
The system is FC5.


Any help would be greatly appreciated.



Regards Dan
 
What is 8012q? A device driver? For what kind of device?

For example, if it was for your network card, you might add a line to modules.conf such as:

[tt]alias eth0 8012q[/tt]

Annihilannic.
 
This is a module for 8021q support.

I can manually start module by command: modprobe 8021q, but not automatically at system start. This module should start before the network devices are set up at startup.

QatQat: Shall check this out.




Regards Dan
 
Ya, it is VLAN module that I came across while playing with VMNUL. I thought grub3r was doing the same.

Annihilannic, I read your link and it indeed mentions some problems to load 8021q module.

According to that red-hat article, you may need to create an alias

alias vlan 8021q


Yet I must say that the article refers to a fairly old version of FC
I have not had any problem with FC5 in loading the module to use with VMNUL, which makes me assume that they must have fixed the problem in recent red-hat releases.

Cheers

QatQat

Life is what happens when you are making other plans.
 
Ok,
thanks guys, if I'm not mistaken, I've tried this workaround earlier. Will sure try it again to be sure.



Regards Dan
 
Hi,

All processes that have be started at boot time must have a managing script in /etc/rc.d/init.d ( man chkconfig )
here is a sample managing script :
the line # chkconfig: 45 60 60
indicates that the script is to be running in levels 4 and 5
the start priority is 60 ( the file generated by chkconfig in levels 4 and 5 is S60rc.docbroker )
the stop priority is 60 ( the file generated by chkconfig in levels other tahn 4 and 5 is K60rc.docbroker )
Adjust this two numbers to place your script before network starting
On my box, network is starting in run level 2 (S10network)
# chkconfig: 45 05 60 will generate S05xxxx lexically before S10network)

Code:
#!/bin/sh
#
# chkconfig: 45 60 60
# description: demarrage du docbroker documentum
# processname: rc.docbroker
# pidfile: /var/run/rc.docbroker.pid

#------------------------------------------------------------


# recuperer les variables d'environnement Documentum
. /home/dm53.env
START53="$DOCUMENTUM/dba/dm_launch_dmocbroker"
STOP53="$DOCUMENTUM/dba/dm_stop_dmocbroker"
PROCESS=dmdocbro[k]er
FICPID=/var/run/rc.docbroker.pid
# sourcer les fonction standards redhat
. /etc/init.d/functions

case "$1" in
start)
        daemon --user dmadmin $START53
        PID=$(ps -ef |grep $PROCESS|awk '{print $2}')
        echo $PID >/var/run/rc.docbroker.pid
        ;;
stop)
        daemon --user dmadmin $STOP53
        if [ -f $FICPID ]
        then
                rm $FICPID
        fi
        ;;
status)
        ps -ef | grep -w $PROCESS|grep -v grep
        exit $?
        ;;
esac


When your script is written in /etc/rc.d/init.d, run :
chkconfig --add to generate starting and stopping scripts in right levels
chkconfig --del to remove starting and stopping scripts in right levels ( the script in /etc/rc.d/init.d is preserved )
chkconfig --list ( to list all processes on or off in different run levels

 
hi aau,


kernel modules are a different thing from processes (or daemons); you will not find any kernel module loaded by a script in /etc/init.d/

You may have some daemons that, in order to run, need 8021q kernel module to be loaded.
in this case, yes, you will have a script launching the daemon from /etc/init.d.


Cheers

QatQat




Life is what happens when you are making other plans.
 
Hi,

Sorry for my wrong post, I did not understand this subtil difference

Best regards
 
I've tried to add: alias vlan 8021q to modprobe.conf and it didn't help.

Is there any other way of loading the module at boot?

thanks in advance.



Regards Dan
 
try check modules dependancies

Code:
less /lib/modules/2.6.15-1.2054/modules.dep | grep 8021q

If you really do have all deps available on your system (which I believe, if modprobe succesfully loads you module manually) then you could try understand what is happening at boot.

rerun modprobe 8021q after linux boot

Code:
tail --lines 500 /var/log/messages | grep 8021q > /tmp/8021q.tail

Examining the /tmp/8021q.tail file, if we are lucky we may get lines related to the succesful manual loading of 8021q as well as lines about the module not being loaded at startup.

Should 500 lines not be enough change it to a higher number.

QatQat



Life is what happens when you are making other plans.
 
Hello QatQat,
I modprobed the 8021q again after system start.

Code:
less /lib/modules/2.6.15-1.2054/modules.dep | grep 8021q

gave me this:
Code:
/lib/modules/2.6.15-1.2054/kernel/net/8021q/8021q.ko:

tail-line gave me nothing.

I tried
Code:
lsmod | grep 8021q
which gave me:
Code:
8021q          18633 0


The real problem is not to load the module at startup, but:

when I load module manually after boot, and set up vlan interfaces by applying appropriate files to /etc/sysconfig/network-scripts/, everything seems ok but after system boot the system tries to set up vlan interfaces and fails because of 8021q is not longer loaded.

How to other people confront that kind of problems?!

Do I have to recompile the kernel with 8021q support
(haven't done that before)



Regards Dan
 
OK,

that is only the module itself and no dependancies; eventually I run the same myself and it looks like that module really does not have any dependancy.

Normally you should not have this behavior.
Recompiling the kernel when you can use a loadable module is like going back to a 5 years ago linux monolitic kernel.
I do not recommend you do it, especially if you have not done it before and you are working on a production server.

I will do some research and see if there is some literature about this weird behavior.

CHeers

QatQat




Life is what happens when you are making other plans.
 
Hello and thanks QatQat,

I've found a section in /etc/init.d/network that is about VLAN support:

Code:
        case "$VLAN" in
          yes)
            if [ -d /proc/net/vlan ] || modprobe 8021q >/dev/null 2>&1 ; then
                test -z "$VLAN_NAME_TYPE" && VLAN_NAME_TYPE=DEV_PLUS_VID_NO_PAD
                action $"Setting 802.1Q VLAN parameters: " /sbin/vconfig set_name_type "$VLAN_NAME_TYPE"
            else
                echo $"No 802.1Q VLAN support available in kernel."
            fi
            ;;
        esac

Then comes other interfaces
Maybe this have something to do with starting and stopping.



Regards Dan
 
you gave me an idea.
Have you checked that you have your virtual interfaces configured?

if not you need to run
Code:
vconfig add eth0 1
vconfig add eth0 2
etc..


The listing you found should be the part of network that will start your VLAN and configure it using vconfig. yet if there is no interface configuration it may not start at all.
It will load 8021q module for you by executing modprobe;

If your interfaces already exist, and still no luck at reboot why do not create a script that execute modprobe for you and add it to your runlevel directory using chkconfig?

This, although will not solve the fact that the module does not load automatically at startup, will re-load it manually each time you re-boot the machine.
I suggest you use a low startup priority (i.e. high number). aau has provided you with detailed information on how to do this in his reply.

Rough solution but functional.


CHeers

QatQat

Life is what happens when you are making other plans.
 
The interfaces are configured, so I don't think this should cause any problems.

will try to understand the script part.


thanks again.

Regards Dan
 
Hi again,
can't fully understand the script structure.
Which part of the script do I have to edit to get the modprobe to load a module.

Thanks in advance.

Regards Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top