Running executables during boot

Asked by jpeulen

How can add certain file to be loaded automatically when I start the computer?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Cesare Tirabassi
Solved:
Last query:
Last reply:
Revision history for this message
Cesare Tirabassi (norsetto) said :
#1

What are the "certain file" you are talking about?
Kernel modules? Executables? Something else?

Revision history for this message
jpeulen (jpeulen) said :
#2

Hi Cesare
Executable files were meant here.
Because to be honest I do NOT know what a Kernel Module is. :-(
Where can I read about what Kernel Modules are? I mean in language I
understand? :-)
Regards Jan.

On Tue, 2007-06-12 at 11:00 +0000, Cesare Tirabassi wrote:
> Your question #8029 on gnome-panel in ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/gnome-panel/+question/8029
>
> Status: Open => Needs information
>
> Cesare Tirabassi requested for more information:
> What are the "certain file" you are talking about?
> Kernel modules? Executables? Something else?
>
> _______________________________________________________________________
> To answer this request for more information, you can either reply to
> this email or enter your reply at the following page:
> https://answers.launchpad.net/ubuntu/+source/gnome-panel/+question/8029

Revision history for this message
Best Cesare Tirabassi (norsetto) said :
#3

In broad terms a Linux kernel module is the equivalent of a Windows device driver.
What you could do is make a script which is launching your executables and have this script be executed at boot.
To do so you need to:

Write a script (lets call it foo as an example).
Make the script executable: chmod +x foo
Move it in the /etc/init.d/ directory: mv foo /etc/init.d/foo (make sure there is no other foo there)
Run the update-rc.d utility to register the script:

update-rc.d foo defaults

Reboot and check that everything is ok.

As an example for the script, lets say you have 3 executables to run: foo1, foo2 and foo3; foo1 and foo2 are in your home directory (jan), foo3 is in /sbin and lets also assume that foo2 wants to have the option -o pippo.
You will make your script like this:

#!/bin/bash

set -e

/home/jan/foo1
/home/jan/foo2 -o pippo
/sbin/foo3

exit 0

If you need help with the basics of script writing I can recommend this guide:

http://www.freeos.com/guides/lsst/index.html

Revision history for this message
jpeulen (jpeulen) said :
#4

Thanks Cesare Tirabassi, that solved my question.