All Forums
 Embedded Linux
 Linux FAQ
 How can I start a program automatically at boot?
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

jmalone

61 Posts

Posted - 30 Nov 2004 :  10:58:00  Show Profile  Email Poster
Generally speaking, there are 2 typical ways to start an application automatically at boot time:

Using /etc/inittab
    The easiest way to invoke a process at startup is to use the inittab. The file /etc/inittab is read by the init process and controls init's behaviour. The basic format of this file is:

      id : runlevels : action : process

    Where:

      'id' is a 1-4 character unique identifier
      'runlevels' is the list of runlevels for which the specified action should be taken (no separators between levels)
      'action' is one of the allowed actions for init, such as 'wait', 'respawn' or 'once'
      'process' is the command line for the process to be executed


    Example:

      Placing the line

      snd:3:once:/usr/bin/mpg123 /root/demo_media/music_sample.mp3

      at the end of inittab will make your board play back the included mp3 audio sample at startup. The action 'once' means that the process will be run only once each time runlevel 3 is reached.

    Note: 3 is the default runlevel for the ADS Debian root filesystems.

    See man inittab for more details

Using System V init scripts (Advanced)
    The directory /etc/init.d contains the System V-style init scripts that are called by init at boot time (and when runlevels are changed).

    The directories /etc/rc*.d control which scripts are called at what time (and in what order).

    See Debian's policy documentation for information about using System V runlevels.

  Topic  
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.02 seconds. Snitz Forums 2000