WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Alternative to /opt/bootlocal.sh  (Read 3812 times)

Offline helander

  • Full Member
  • ***
  • Posts: 183
Alternative to /opt/bootlocal.sh
« on: June 17, 2009, 03:36:47 AM »
I would like to propose alernative option to add operations to be performed at system startup.
The idea is to have this controlled thru tce:s and requires no other actions than selecting the tce in question to be installed.
As an example if you would like to create different TC "flavors", each flavor could then be defined by the set of tce:s it includes.

A solution could be:

   Place whatever scripts you want to execute during startup in the directory
   
       /usr/local/bootlocal
      
   inside your tce.
   
   In /etc/init.d/tc-config you add, close to the invocation of /opt/bootlocal.sh, code that look what files (with x flag set) that exists in /usr/local/bootlocal and executes them.
   

/Lars

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Alternative to /opt/bootlocal.sh
« Reply #1 on: June 17, 2009, 05:00:48 AM »
If an extension is in a tce directory and so loaded on boot, its install script is also run on boot.
The only barriers that can stop you are the ones you create yourself.

Offline mikshaw

  • Sr. Member
  • ****
  • Posts: 368
Re: Alternative to /opt/bootlocal.sh
« Reply #2 on: June 17, 2009, 06:40:52 AM »
Quote
In /etc/init.d/tc-config you add, close to the invocation of /opt/bootlocal.sh, code that look what files (with x flag set) that exists in /usr/local/bootlocal and executes them.

/usr/local/tce.installed already has this function.  Look in tc-config, it's the very last thing done before bootlocal.sh is run.  Personally I prefer this to using bootlocal.sh, because bootlocal.sh is backgrounded, which means that potentially the user could be already logged in by the time the script finishes.

Offline helander

  • Full Member
  • ***
  • Posts: 183
Re: Alternative to /opt/bootlocal.sh
« Reply #3 on: June 17, 2009, 08:38:24 AM »
OK, so what I wanted was already in place  :). Thanks for pointing out the solution.

/Lars

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Alternative to /opt/bootlocal.sh
« Reply #4 on: June 17, 2009, 10:17:21 AM »
10+ Years Contributing to Linux Open Source Projects.