Loading AIX kernel extensions on reboot

Greetings,

Does anyone know how to load AIX kernel extensions on reboot? I know that Oracle loads it's postwait kernel extension via a executable in /etc/inittab. I'm assuming this executable calls the "sysconfig" system call and loads it. What if I wrote my own? What is the proper way in AIX to load it automatically on system reboot? Should I edit the /etc/objrepos/Config_Rules file? I know that file loads the device drivers, which are kernel extensions themselves.

Any assistance would be greatly appreciated.
Thanks,

--Justin

It depends what you mean by a kernel extension and how you propose to write your own. If you are thinking of just starting up a bit of code a boot time, then have a think about using the rc scripts. There will be lines in /etc/inittab something like this:-

l2:2:wait:/etc/rc.d/rc 2 
l3:3:wait:/etc/rc.d/rc 3 
l4:4:wait:/etc/rc.d/rc 4 
etc.

Each of these calls the script /etc/rc.d/rc with the appropriate run-level value. You can tell the default run-level by looking at the top of /etc/inittab for the record to define initdefault. Mine is:-

init:2:initdefault:

Never change the script /etc/rc.d/rc or your server may not boot.

Reading through /etc/rc.d/rc, you will see a section that changes to the directory of Run-Control scripts and runs firstly all those starting with K giving them the parameter stop, then every one starting with S, passing the parameter of start.

If you have something to run at boot, you would be better to put it in as a script in /etc/rc.d/rc2.d/S99myscript rather than directly update /etc/inittab. I have had occasion where an OS patch-set replaced /etc/inittab and local changes were lost. It caused a real panic until we worked it out.

The scripts are run in the Bourne shell, so you may have to consider that when coding. Setting up your environment (PATH, TZ, Locale, etc.) will probably not be done either, so it may take a while to get right.

I hope that this helps.

Robin
Liverpool/Blackburn
UK

Robin,

Thank you for your reply. I am not talking about user space programs like a script which starts a db or an app, I'm talking about kernel space extensions, or in Linux speak modules. I know /etc/modules on some Linux distributions is used to load modules on boot, I'm just wondering what the equivalent in AIX is?

Thanks,

--Justin

This is a complex topic - and I was thinking you wanted to write your own extension, so I did not say anything yet.

However, where the information is stored for device driver loads at startup is in the odm class Config_Rules .

AIX starts in three phases:
phase 1: before rootvg is varyon
phase 2: varyon of rootvg
phase 3: rootvg is varyon (and top of /etc/inittab is now active; phase 1 and phase 2 is managed by the script /sbin/rc.boot)

To list the three phases of Config_Rules - coursely

for i in 1 2 3
do
    opdget -q phase=$i Config_Rules
done

Also study the file /sbin/rc.boot.

Hope this helps - and if so - Enjoy! :slight_smile:

1 Like