Welcome Guest ( Log In | Register )




                Web Hosting Guide

2 Pages V   1 2 >  
Reply to this topicNew Topic
How To Start A Program On Startup With Options
djXternal
post Oct 31 2006, 02:27 PM
Post #1


Newbie [ Level 2 ]
Group Icon

Group: Members
Posts: 26
Joined: 26-October 06
Member No.: 16,802


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
Go to the top of the page
 
+Quote Post
yordan
post Nov 1 2006, 03:33 PM
Post #2


Way Out Of Control - You need a life :)
Group Icon

Group: [MODERATOR]
Posts: 2,961
Joined: 16-August 05
Member No.: 7,896
myCENTs:81.60


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.
Go to the top of the page
 
+Quote Post
qwijibow
post Nov 2 2006, 01:19 PM
Post #3


Way Out Of Control - You need a life :)
Group Icon

Group: Members
Posts: 1,366
Joined: 14-September 04
From: Nottingham England
Member No.: 570


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.
Go to the top of the page
 
+Quote Post
Vitall
post Nov 16 2006, 03:46 AM
Post #4


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 2
Joined: 16-November 06
Member No.: 17,296


Just add /opt/lampp/lampp start line to /etc/rc.local file. As simple as that. I'm talking about Fedora core smile.gif
Go to the top of the page
 
+Quote Post
ignite
post Nov 17 2006, 09:26 AM
Post #5


Member [ Level 1 ]
Group Icon

Group: Members
Posts: 34
Joined: 17-November 06
Member No.: 17,334


QUOTE(djXternal @ Oct 31 2006, 04:27 PM) [snapback]90543[/snapback]

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.
Go to the top of the page
 
+Quote Post
bombshop
post Dec 21 2006, 09:20 PM
Post #6


Newbie [ Level 2 ]
Group Icon

Group: Members
Posts: 19
Joined: 21-December 06
Member No.: 18,616


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.
Go to the top of the page
 
+Quote Post
ignite
post Jan 12 2007, 12:08 PM
Post #7


Member [ Level 1 ]
Group Icon

Group: Members
Posts: 34
Joined: 17-November 06
Member No.: 17,334


QUOTE(bombshop @ Dec 21 2006, 11:20 PM) [snapback]94295[/snapback]

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
Go to the top of the page
 
+Quote Post
yordan
post Jan 12 2007, 01:54 PM
Post #8


Way Out Of Control - You need a life :)
Group Icon

Group: [MODERATOR]
Posts: 2,961
Joined: 16-August 05
Member No.: 7,896
myCENTs:81.60


QUOTE(ignite @ Jan 12 2007, 01:08 PM) [snapback]95723[/snapback]

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.
Go to the top of the page
 
+Quote Post
bombshop
post Jan 28 2007, 12:13 AM
Post #9


Newbie [ Level 2 ]
Group Icon

Group: Members
Posts: 19
Joined: 21-December 06
Member No.: 18,616


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
Go to the top of the page
 
+Quote Post
Lewisthemusician
post Jan 28 2007, 12:29 AM
Post #10


Member [ Level 2 ]
Group Icon

Group: Members
Posts: 52
Joined: 5-January 07
Member No.: 19,160


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
Go to the top of the page
 
+Quote Post

2 Pages V   1 2 >
Reply to this topicNew Topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Collapse

> Similar Topics

    Topic Title Replies Topic Starter Views Last Action
No New Posts 5 Niru 3,787 5th November 2009 - 08:04 AM
Last post by: iG-balajee
No New Posts   12 vizskywalker 5,194 27th October 2009 - 09:36 PM
Last post by: iG-carlypan
No New Posts   16 marcin 3,391 9th October 2009 - 08:16 PM
Last post by: iG-Earl J. Photomiester
No New Posts   12 soleimanian 2,466 25th September 2009 - 08:53 PM
Last post by: iG-Tim
No New Posts   18 knight17 6,310 10th August 2009 - 05:29 AM
Last post by: iG-Helping
No New Posts   9 Quatrux 354 5th August 2009 - 12:18 PM
Last post by: iG-
No New Posts   3 dangerdan 670 21st July 2009 - 12:07 PM
Last post by: iG-andy
No New Posts   12 Match 911 30th June 2009 - 02:09 AM
Last post by: takerraj
No New Posts   0 dangerdan 180 7th June 2009 - 04:56 PM
Last post by: dangerdan
No New Posts 13 clovis 3,853 2nd June 2009 - 11:17 AM
Last post by: iG-Sayber
No New Posts   7 Captain Jerry 2,818 29th May 2009 - 07:13 AM
Last post by: iG-James Schumacher
No new   19 Darren 3,423 14th May 2009 - 01:32 AM
Last post by: iG-Rilliath
No New Posts   10 XPkiller 3,269 29th April 2009 - 12:08 AM
Last post by: iG-Stormwing
No New Posts   9 dhanesh 3,176 28th April 2009 - 01:06 AM
Last post by: iG-Faisal Sohail
No new   19 chseng 3,585 12th April 2009 - 06:22 AM
Last post by: kenshin


Web Hosting Powered by ComputingHost.com.