Find the answer to your Linux question:
Results 1 to 4 of 4
I want to start an application when the linux or unix starts every time, it is said I have to modify the /etc/rc.local, I am a newbie, I don't know ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2004
    Posts
    9

    How to start an application when the linux or unix starts


    I want to start an application when the linux or unix starts every time, it is said I have to modify the /etc/rc.local, I am a newbie, I don't know exactly, could anyone give me some help or sample code. Thanks in advance!

  2. #2
    Linux Guru kkubasik's Avatar
    Join Date
    Mar 2004
    Location
    Lat: 39:03:51N Lon: 77:14:37W
    Posts
    2,396
    what distro, there are a few differnt mechanismt for handleing this.
    Avoid the Gates of Hell. Use Linux
    A Penny for your Thoughts

    Formerly Known as qub333

  3. #3
    Just Joined! coolguy-in's Avatar
    Join Date
    Sep 2004
    Posts
    21

    Re: How to start an application when the linux or unix start

    yeah most common way just add the path of your application in /etc/rc.local file
    eg. if i want to run a shell script named "masq" (which is in /opt) everytime system bootsup i will add a line below this example text (default in RED HAT 9)

    ######################example file in RHL 9 #####################
    #!/bin/sh
    #
    # This script will be executed *after* all the other init scripts.
    # You can put your own initialization stuff in here if you don't
    # want to do the full Sys V style init stuff.

    touch /var/lock/subsys/local
    ################################################## ###########

    Now the file look like:
    ######################Modified file in RHL 9 #####################
    #!/bin/sh
    #
    # This script will be executed *after* all the other init scripts.
    # You can put your own initialization stuff in here if you don't
    # want to do the full Sys V style init stuff.

    touch /var/lock/subsys/local
    /opt/masq
    ################################################## ###########

    thats all it will work.....................................

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru
    Join Date
    Mar 2003
    Location
    Wisconsin
    Posts
    1,907
    Some applications you may only want to start when a user logs in, not when the puter actually starts. You put those in ~/.bashrc or ~/.kde/autostart

    Jeremy
    Registered Linux user #346571
    "All The Dude ever wanted was his rug back" - The Dude

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •