Nov 7, 2009
Pages: 1, 2

How To Start A Program On Startup With Options

free web hosting

Read Latest Entries..: (Post #11) by iGuest on Mar 3 2008, 03:16 PM.
please clarify my doubt How To Start A Program On Startup With Options I have a perl script written and is saved at /root/script.Pl.I want to run the script at boot up. It is required to add the script to /etc/rc.Local. Should I copy paste entire script there or just the path? what are the steps to run the script at start up? Thank you in advance-reply by nichol...
read more.
Read the FIRST post of this Topic. - Express your Opinion! Contribute Knowledge :-).

Open Discussion & Free Web Hosting > Computers & Tech > Operating Systems > Linux

How To Start A Program On Startup With Options

djXternal
Well as I;ve said before I'm new to linux, but am learning fast, I'm trying to figure out how to add a program to start at fedora bootup, I need '/opt/lampp/lampp start' to start at bootup, I beleive I need to do something in the init.d folder but I am unsure of what should be done

Comment/Reply (w/o sign-up)

yordan
You could also add a line in /etc/inittab.
it's an old way of doing that kind of things.
The line I would add is :


Yordansays:2:once:/opt/lampp/lampp start >/tmp/lmapp_start_listing.txt 2>&1


Just edit /etc/inittab and add this line at the end. This line has a title ("Yordansays") and asks at initlevel 2 (which is the multi-user level) to start only once (the "Once" field) the command /opt/lampp/lampp start and record the standard output of this command, as well as the standard error of this command, in the file named /tmp/lmapp_start_listing.txt for future debugging if necessary.
You could alternatively use /dev/console instead of the txt file, so the result would go to the console at boot time instead of going in a file.

Comment/Reply (w/o sign-up)

qwijibow
The Preffered way of doing somthing like that is with the 'local' boot script.

The Local Boot Script is an empty script that always runs last dureing bootup.
its there specifically for users to enter any commands they want to run dureing bootup.

In my opinion, its better to put applications like this in local, mainly because any resources that the program may need ( for example networking, or the Graphical User Interface ) will be definalty be up and running.


ALSO....
if you make a mistake in the local script, it does not matter..

however a mistake in innitab could prevent the system from booting.
(easy to fix, but annoying)

the local script is in differant places in differant distro's

have a look in /etc/ and its sub-directories.
maybe /etc/initd.d/local


Good Luck.

Comment/Reply (w/o sign-up)

Vitall
Just add /opt/lampp/lampp start line to /etc/rc.local file. As simple as that. I'm talking about Fedora core smile.gif

Comment/Reply (w/o sign-up)

ignite
QUOTE(djXternal @ Oct 31 2006, 04:27 PM) *

Well as I;ve said before I'm new to linux, but am learning fast, I'm trying to figure out how to add a program to start at fedora bootup, I need '/opt/lampp/lampp start' to start at bootup, I beleive I need to do something in the init.d folder but I am unsure of what should be done


The preffered way, used by distro, is to create start script and locate it in /etc/init.d/
Simpest method is to copy one of existing one and edit to suit your needs.
Then run chkconfig --add name
You now can activate\deactivate your sirvice at any time by setup utility or any other standart method.

Comment/Reply (w/o sign-up)

bombshop
i dont really know if it really works for fedora but it sure works for slackware.
edit your /etc/rc.d/rc.local and add the program and the options you want to run on startup.

Comment/Reply (w/o sign-up)

ignite
QUOTE(bombshop @ Dec 21 2006, 11:20 PM) *

i dont really know if it really works for fedora but it sure works for slackware.
edit your /etc/rc.d/rc.local and add the program and the options you want to run on startup.

It works for sure. But this method have disadvanteges: you can't manually stop this program at any time just typing /etc/init.d/program stop, or by special Red Hat script - service: service program stop. You can't activate/deactivate such a program by system tools like chkconfig or setup Red Hat utility. This program will not run correctly according to system 'run level'.
This method of running program at startup have exactly one advantage - it's simple. wink.gif

Comment/Reply (w/o sign-up)

yordan
QUOTE(ignite @ Jan 12 2007, 01:08 PM) *

It works for sure. But this method have disadvanteges: you can't manually stop this program at any time just typing /etc/init.d/program stop, or by special Red Hat script - service: service program stop. You can't activate/deactivate such a program by system tools like chkconfig or setup Red Hat utility. This program will not run correctly according to system 'run level'.
This method of running program at startup have exactly one advantage - it's simple. wink.gif

Correct. Don't remember for Fedora, but rc.local is in RedHat, and RedHat is usually similar to fedora.
I usually prefer /etc/inittab, but rc.local has to work.
Here is what is said in the rc.local file in RedHat :
QUOTE

#!/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.

So, this script is exactly here for that purpose. You put in this script what you want to be started at the end of the system boot, and it should be perfect.

 

 

 


Comment/Reply (w/o sign-up)

bombshop
QUOTE
It works for sure. But this method have disadvanteges: you can't manually stop this program at any time just typing /etc/init.d/program stop, or by special Red Hat script - service: service program stop. You can't activate/deactivate such a program by system tools like chkconfig or setup Red Hat utility. This program will not run correctly according to system 'run level'.
This method of running program at startup have exactly one advantage - it's simple. wink.gif


I generally use this method to modprobe the modules so i don't really have to terminate the program. But let me make it clear, if i start a program editing rc.local i can't stop it with "kill pid" ??? hmm that sounds pretty awful in some cases but great for some other cases smile.gif if you know what i mean wink.gif

Comment/Reply (w/o sign-up)

Lewisthemusician
i might install linux, the thing is though from what i heard you code everything in command prompt to do stuff like to get an icon shortcut on your desktop to open a program you would have to do a command.

To me this sounds like boring, hard and a bad operating system. I like the way it's free though and i might use debian on linux so i can host my own site biggrin.gif

-Lewis

Comment/Reply (w/o sign-up)

Latest Entries

iGuest
please clarify my doubt
How To Start A Program On Startup With Options


I have a perl script written and is saved at /root/script.Pl.I want to run the script at boot up. It is required to add the script to /etc/rc.Local.

Should I copy paste entire script there or just the path? what are the steps to run the script at start up?

Thank you in advance



-reply by nichol

Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Pages: 1, 2
Similar Topics

Keywords : start, program, startup, options

  1. Do I Need To Set Up Any Special Kernel Options To Enable Cd/dvd Burning?
    CD / DVD Burning (0)
  2. Help Create A Program To Automatically Install Wireless Drivers On Linux
    (1)
    Some of our fellow Ubuntu users are putting together software to automatically detect and install
    wireless drivers for a variety of wireless cards and they need our help. If your wireless connection
    is working, please run the command and post the result on the Ubuntu forums thread linked to below.
    This is the only deterrent to Linux on many laptops.
    http://ubuntuforums.org/showthread.php?t=547444 This was never actually meant to be a Ubuntu
    thing. It doesn't matter which distribution you're using; running that command and posting
    the output would be a great h....
  3. Network Issues With Kde
    connection wont work as startup (8)
    On my new Kubuntu install i have managed to make my WLAN connection set up by using "kdesu konqeror"
    and then adjusting in settings. But for some reason the connection won't start at startup. I
    have to use kdesu to enable and activate both connections. Which is a problem on this computer
    because it is a family box and my parents cant do that and i dont want them to have the ability to
    gain root just in case. Any ideas - this is really annoying.....
  4. Windows Apps In Linux
    what program should i use ? (10)
    i have mandrake linux 10 installed on my laptop...i want to run games (like nfsu2, hl2, cs:s, far
    cry, doom) what program would be best for running thse games ? i have heard of wine - one of the
    programs that came with red hat linux fedora core 2 (also have - just not installed) but i never
    could get it to run games very well...even my little games like jnes (nintendo emulator) also would
    the program be able to run apps like acohol 120 or winamp as well as the games ? and how many of the
    windows programs can you have opened at once ?....

    1. Looking for start, program, startup, options

See Also,

*SIMILAR VIDEOS*
Searching Video's for start, program, startup, options
advertisement



How To Start A Program On Startup With Options

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com