WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: extension script execution timing and order?  (Read 3694 times)

Offline bigpcman

  • Hero Member
  • *****
  • Posts: 719
extension script execution timing and order?
« on: March 22, 2010, 11:59:27 AM »
Please remind me what the extension script execution timing and order rules are. How can the user control the timing and the order of extension script execution when an extension is installed ?

For instance on boot 10 extensions each having 10 dependencies all having scripts (100 scripts).

and

An OnDemand extension install having 10 dependencies all having scripts.
« Last Edit: March 22, 2010, 12:26:59 PM by bigpcman »
big pc man

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: extension script execution timing and order?
« Reply #1 on: March 23, 2010, 09:31:38 AM »
Shouldn't matter. Any extension that has a startup script, would only need to have as its dependencies that would be necessary for the successful completion of said script.
10+ Years Contributing to Linux Open Source Projects.

Offline bigpcman

  • Hero Member
  • *****
  • Posts: 719
Re: extension script execution timing and order?
« Reply #2 on: March 23, 2010, 11:32:31 AM »
Shouldn't matter. Any extension that has a startup script, would only need to have as its dependencies that would be necessary for the successful completion of said script.

I'm not sure what you mean by "would only need to have as its dependencies that would be necessary for the successful completion of said script".

Are you implying dependencies can't or won't have wrapper scripts of their own?

big pc man

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: extension script execution timing and order?
« Reply #3 on: March 23, 2010, 05:51:25 PM »
Quote
Are you implying dependencies can't or won't have wrapper scripts of their own?

No. As I stated anything can have a startup script, as long as it is satisfied by any dependencies it may require.
10+ Years Contributing to Linux Open Source Projects.

Offline bigpcman

  • Hero Member
  • *****
  • Posts: 719
Re: extension script execution timing and order?
« Reply #4 on: March 23, 2010, 07:27:47 PM »
Quote
Are you implying dependencies can't or won't have wrapper scripts of their own?

No. As I stated anything can have a startup script, as long as it is satisfied by any dependencies it may require.

Thanks for the answer.

So just for my own education, when performing an OnDemand install of an extension that has several dependencies all having some form of wrapper script what order are they executed?

Is each script associated with a dependency executed at the time the dependency is mounted or are all the dependency scripts executed at the same time in alphabetical order followed by the parent extension script execution?
big pc man

Offline bigpcman

  • Hero Member
  • *****
  • Posts: 719
Re: extension script execution timing and order?
« Reply #5 on: March 30, 2010, 04:45:08 PM »
Quote
Are you implying dependencies can't or won't have wrapper scripts of their own?

No. As I stated anything can have a startup script, as long as it is satisfied by any dependencies it may require.

Thanks for the answer.

So just for my own education, when performing an OnDemand install of an extension that has several dependencies all having some form of wrapper script what order are they executed?

Is each script associated with a dependency executed at the time the dependency is mounted or are all the dependency scripts executed at the same time in alphabetical order followed by the parent extension script execution?

I decided to do a little testing just to satisfy my curiosity and the answer appears to be quite simple. Using the "onboot.lst" as an example it looks like extensions are installed one by one in the order they appear in the boot list until an extension with a dep list is encountered at which time the extensions in the dep list are installed in the reverse order they appear in the dep list followed by the installation of the parent extension. Once all the dep files and the parent extension are installed the next extension in the boot list is installed. The script files are executed in the exact same order after all the extensions have been mounted. Each script is executed to completion before the next script is started.

So for instance:
Code: [Select]
onboot.lst

ext0
ext1 (dep ext8, ext7 (ext6 dep ext5, ext4)
ext3

Installs as:  ext 0,4,5,6,7,8,1,3

another example onboot.lst

ext0
ext1 dep (ext6 dep ext5, ext2, ext4) , ext8, ext7
ext3

installs as : 0,7,8,4,2,5,6,1,3

So it looks like the user can control the order of extension installation and associated script execution by manipulating the onboot list and dep list  item entry order.

Tested using tc2.10
« Last Edit: March 31, 2010, 10:22:20 PM by bigpcman »
big pc man

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: extension script execution timing and order?
« Reply #6 on: April 02, 2010, 12:40:01 AM »
That is to be expected with a list and stack data structures.

list is onboot.lst which controls the main application load order,
and stack which I included in tce-load to handle the recursion of dependencies.

This allows startup scripts at any location, as such would be satisfied by any dependencies that it might have.

10+ Years Contributing to Linux Open Source Projects.

Offline bigpcman

  • Hero Member
  • *****
  • Posts: 719
Re: extension script execution timing and order?
« Reply #7 on: April 02, 2010, 09:46:50 PM »
That is to be expected with a list and stack data structures.

list is onboot.lst which controls the main application load order,
and stack which I included in tce-load to handle the recursion of dependencies.

This allows startup scripts at any location, as such would be satisfied by any dependencies that it might have.


Now that I see how it all works I can better appreciate your clever implementation. Plus I now know how to control wrapper script execution order if the need arises. I know order should not matter under ordinary circumstances.
big pc man