Find the answer to your Linux question:
Results 1 to 9 of 9
i am a new user of linux and don't really know how to write scripts in linux can anyone tell me how to automatically start a program as the OS ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2005
    Posts
    12

    automatically start a program when linux boots


    i am a new user of linux and don't really know how to write scripts in linux
    can anyone tell me how to automatically start a program as the OS starts up?
    i found something that explains how, like its on the rc0.d or rc1.d or something like that...and it talks about running scripts...can anyone also tell me how to run programs using scripts?

  2. #2
    Just Joined!
    Join Date
    Aug 2005
    Posts
    60
    Yah, you can put the command in rc#.d, generally you want to put it in rc.d, the rc#.d refers to the "run level" you would use. Basicly, say you want to "run" linux with minimum services and such, you would setup rc1.d with a minimal run script. And you want to run user level services, rc5.d is the common run level.

    Pretty flexible part of Linux, but rc.d is always run.

    When you put it into the script, you would put it into the script like you would command line. Now if its a script like TeamSpeak server you would want to run it as a process, not a normal command line because it will stop the bootup of your linux box. THere should be documentation on how to do that.

  3. #3
    Just Joined!
    Join Date
    Jun 2005
    Location
    Massachusetts
    Posts
    27
    I'm not sure exactly how to do it cause I'm still fighting with it myself but hope this helps.
    http://www.linuxforums.org/forum/viewtopic.php?t=52539

  4. #4
    Linux Engineer
    Join Date
    Apr 2005
    Location
    Belgium
    Posts
    1,429
    You can also have programs start with kde. Just put them in the default KDE autostart folder. I think it is ~/.autostart or something.
    ** Registered Linux User # 393717 and proud of it ** Check out www.zenwalk.org
    ** Zenwalk 2.8 - Xfce 4.4 beta 2- 2.6.17.6 kernel = Slack on steroids! **

  5. #5
    Just Joined!
    Join Date
    Aug 2005
    Posts
    12
    isn't it that KDE starts up on log-on?
    the system where i am trying to do this has multiple users
    so it must run even before anyone has logged in.

  6. #6
    Linux Engineer
    Join Date
    Apr 2005
    Location
    Belgium
    Posts
    1,429
    Ok, then you must put it in /etc/rc.d/ and pick the appropriate runlevel (5 for FC).
    ** Registered Linux User # 393717 and proud of it ** Check out www.zenwalk.org
    ** Zenwalk 2.8 - Xfce 4.4 beta 2- 2.6.17.6 kernel = Slack on steroids! **

  7. #7
    Just Joined!
    Join Date
    Aug 2005
    Posts
    12
    if you don't mind...what is "FC"?
    and i just want to clarify, if there are no users logged-on, does the system assume as "root"?

  8. #8
    Linux User nalg0rath's Avatar
    Join Date
    Sep 2004
    Location
    Stockholm
    Posts
    303
    FC = Fedora Core (a distibution) http://fedora.redhat.com/

    I don't think that it assumes that you're the root user, but you have (roughly) the same privilegies as the root user.

  9. #9
    Just Joined!
    Join Date
    Aug 2005
    Posts
    12
    ummm...it's because the program that i'm trying to run on boot needs to run by the root user...i just checked it, and it's already in a script. i copied it in /etc/rc.d/init.d and added it in chkconfig...is it ok if i do that?

    i can't restart the system to check because it is used as a server and the program i'm trying to run is the one that supports the interconnection in the network

Posting Permissions

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