Koozali.org: home of the SME Server

How does the sme 5.6 boot prosess work ?

Arne

How does the sme 5.6 boot prosess work ?
« on: December 09, 2003, 01:30:25 PM »
Hello everybody !

In these "maintain your e-smith yourself times" I try to find out a little bit more about how my e-smith 5.6 is working.

During the boot up I belive it performs the /etc/initab script first like any other Linux.

But then it continues over to runlevel 7 and some rather e-smith spesial boot up procedures, I thing.

In the /etc/rc7.d directory there is a really spesial e-smith set of scripts that start up the different services, I t hink.

I have some problems to understand these scripts. What are those scripts that comes after theese /etc/rc7.d scripts and that is starting up the individual services ??

Here is the text from one og the /etc/rc7.d files:



. /etc/rc.d/init.d/functions

METASERVICE=e-smith-service
SERVICE=$( basename $0 | sed -e 's/^[SK][0-9][0-9]*//' )

export HOME="/root"

case ${SERVICE} in
    ${METASERVICE})     echo "We don't really want to exec ${METASERVICE}" 1>&2
                        exit 2
                        ;;
esac

INITSCRIPT="/etc/rc.d/init.d/${SERVICE}"

STATUS=$( /sbin/e-smith/db /home/e-smith/configuration getprop ${SERVICE} status )

case $1 in
    *start)
        if [ "${STATUS}" != "enabled" ]
        then
            exit 99
        fi
        ;;
esac


if [ -f ${INITSCRIPT} ]
then
    if [ -x ${INITSCRIPT} ]
    then
        exec ${INITSCRIPT} $@
    else
        exec /bin/sh ${INITSCRIPT} $@
    fi
fi

echo "$0: Couldn't find/execute init script ${INITSCRIPT}" 1>&2
exit 1


They are all idetical, as far as I can see. Believe that the name of the individual script is passed as a parameter to some furher chain of scripts.


Does anyboudy of you know how this startup proedure work and what is called up furter on after the /etc/rc7.d scripts ??

I must admit I do not understand the script above, so I will be thankfull for all help.


Best reg Arne.

Arne

Re: How does the sme 5.6 boot prosess work ?
« Reply #1 on: December 09, 2003, 04:41:41 PM »
Have been working a bit, looking into it. Seems like this line only performs
a normal startup of services:

INITSCRIPT="/etc/rc.d/init.d/${SERVICE}"

Then there is this more "special" one:

STATUS=$( /sbin/e-smith/db /home/e-smith/configuration getprop ${SERVICE} status )


I wonder if not here come some of that special thing that makes e-smith to be a e-smith: /sbin/e-smith/db /home/e-smith/configuration

The services seems to be started first in a ordinary way, and then there
is a some kind of configuration script (?) /sbin/e-smith/db that make some kind of configuration according to the datas in one file /home/e-smith/configuration

If anybody of uou knows more about this, I would be courios to know !!

Arne

Re: How does the sme 5.6 boot prosess work ?
« Reply #2 on: December 10, 2003, 02:56:08 AM »
I belive most Linux distributions is buildt up around a rather modular design. There is typical a kernel and a kernel enverinment, and then the different system moduls exist more like "independent satelites" or individual modules around this. So if you are working on one configuration issue you can primarly focus on this issue. You can releatively easy also replace one set of system modules, lets say the ftp server or the mail server with some kind of simular module, and the primarly configuration issue will be related to this module and possible a limited number on other modules that this module depend on.

In e-smith there is on the orher side a some kind of sentralized and overall configuration system that makes it all work very good and very easy, but that also makes the e-smith more difficult to change or customize if you don't have a overview how this set of perl based configuration scripts work.

To trace how this configuration scripts work and and what they do as an overall configuration system, I think it will be interesting to trace down the things that hapend during the system start up prosess where I will expect that this overall configuration system will be involved in the one way or the other. By tracing down which scripts is calling each other during the start up prosess this should be possible to find.

I think there is also some other interesting places to look.

At the etc/rc.d/rc.local script and at the cron jobs there might also be "something", I think.

I think that it is obviuos that the point at the startup prosess where this sentralized configuration system starts to get a hand with it all is at that point where the e-smith is entering the runlevel 7, which is not a standard Linux rulevel.

In standard Linux distributions I believe that the individual services is started via a set of softlinks in the directory /etc/rc.d/rc3.d that will be the normal start up directory for a server running in rulevel 3. Theese softlinks is then pointing to the real startup scripts in /etc/rc.d/init.d

In the e-smith distribution these things seems to be done rather diffrent, and from there entering runlevel 7 and the softlinks in /etc/rc.d/rc7.d things seems to be happening in a diferent way. The softlinks in /etc/rc.d/rc7.d is not pointing to the individual start up scripts like an ordinary Linux distribution, they are pointing to some special e-smith start up functions, that I believe have something to do with all this "over all configuration system".

I have also written a few words about these things in this question:
http://forums.contribs.org/index.php?topic=19214.msg76002#msg76002

If anybody of you knows more about these things or if you can se something that I write that is incorrect, I would be courios to know.

I think this overall configuration system does get involved during the start up in the second line here:

INITSCRIPT="/etc/rc.d/init.d/${SERVICE}"

STATUS=$( /sbin/e-smith/db /home/e-smith/configuration getprop ${SERVICE} status )

The first line is just a ordinary start up of services I belive even though via som "unstandard" e-smith commands. The second line, I belive gets involved the overall configuration system via this program or perl script: /sbin/e-smith/db

This program (script) seems to be chaining up to other scripts that takes over the configuration issue during the start up process.

It is all written in clear text in perl scripts, as far as I can see, but all hints comments that can tell how things work seems to be removed from these script modules.

Best reg Arne.