1829606 Members
1315 Online
109992 Solutions
New Discussion

script execution order

 
Srimalik
Valued Contributor

script execution order

Hi All,
I have a software whose installation does not require a reboot. but the softwatre with which it is being installed with the same swinstall session.

The configure script for the scripts is being called after the reboot.

In the configure(SD) script I am creating links in rc2.d which points to a script in /sbin/init.d which is supposed to start a daemon for the application.

Now the problem is:

When the system is rebooted by the swinstall session, the configure scripts is called after the reboot by SD, hence the links are created in rc2.d but the daemon is not starting.

The OS is not even calling the script which is pointed by the links.

Any ideas :
Why is it happining ? why the OS is not executing the rc script even if I am creating the links before the rc initialization starts?

or is it a case that the rc initialisation and the configuration are both running simultaneously and the rc executor makes some kind of list of files before executing the scripts and the newly added links are not taken into account?

Thanks
Sri
abandon all hope, ye who enter here..
7 REPLIES 7
MarkSyder
Honored Contributor

Re: script execution order

Have you looked for error messages in /etc/rc.log?

What happens if you try to run the program manually?

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
Srimalik
Valued Contributor

Re: script execution order

There are no error messages...

We have a valid start_msg in our script,,,and that too is not printed in rc.log

this means that the initialization is not callin this script with start_msg argument.

abandon all hope, ye who enter here..
Ninad_1
Honored Contributor

Re: script execution order

Usually there is a corresponding file in /etc/rc.config.d in which you set a parameter to enable/disable running of the script in say rc2.d during startup.
Is there any such file which is set to not run the script at startup ?

Regards,
Ninad
Srimalik
Valued Contributor

Re: script execution order

No...there is no such script :(

The interesting thing is that when I take a second reboot ..every thing works fine :)..because the links are already present there .


It seems to me that the rc system first makes a list of all the scripts for a particular runlevel and then executes them.

so, somehow the rc system makes that list before swconfig is run ( my configure script is executed ), hence the newly created links are not present in the list as they are not created yet and hence ignored when the first reboot occurs.

At the time of second reboot, the list will include the links and everhing will work fine

Please let me know your comments.
abandon all hope, ye who enter here..
Srimalik
Valued Contributor

Re: script execution order

I say this because there is a links in rc2.d (S210swconfig)....which points to /sbin/init.d/swconfig as both the services are in same run levels there can be problems..

comments please..
abandon all hope, ye who enter here..
Srimalik
Valued Contributor

Re: script execution order

Hi All,

The solution is to move the link creation code to postinstall script as the list of scripts to be executed for this runlevel is created before the links are created in configure.

Thanks
Sri
abandon all hope, ye who enter here..
Dennis Handly
Acclaimed Contributor

Re: script execution order

>The solution is to move the link creation code to postinstall script

That would be one solution. But violates the spirit of postinstall/configure. I.e. your solution wouldn't work on the old diskless workstations.

You may just have your configure script start up your rc script.