Fedora Linux Support Community & Resources Center
Old 3rd October 2006, 05:57 AM
ekdya Offline
Registered User
Join Date: Aug 2006
Posts: 134
auto starting my app. at startup

I have a C++ code which fires, does its thing, and waits for input.
I need to get it up and running automatically from boot up.
I am able to open xterm with the following line in the .bash_profile
# run the following programs

but my C++ application "proj" is in $HOME/path/to/proj
who can I do this since it waits on input from the command line. I tried
xterm | path/to/proj
xterm & path/to/proj

non worked.

Reply With Quote
Old 3rd October 2006, 07:25 AM
ekdya Offline
Registered User
Join Date: Aug 2006
Posts: 134
if I move the line
to .bashrc which is read by xterm every time it is fired, it works but then when I open another xterm to do othere things, it fires my proj which is not what I want, I want only one instant of the proj running.
Reply With Quote
Old 3rd October 2006, 06:19 PM
fedora-rookie Offline
Registered User
Join Date: Aug 2005
Posts: 14
hey why don't you add it in the startup programs for the session and setup and automatic login - or you can add it to rc.local
Reply With Quote
Old 3rd October 2006, 07:25 PM
Posts: n/a
You have to be more clear about when you want this to run.
Do you want this to only run while you are logged-in, or
do you want this to run whenever your system is booted up ?

IF when logged in, you can just use a test to see if it's already running, and
then start with a bash command like ...
pgrep proj >/dev/null || path/to/proj

If you want it to run all the time - even when logged out, then create a service - it's pretty simple.
# cd /etc/rc.d/init.d
copy & edit a simple service script to meet your needs like ...
# cp readahead myproj
# sed -i -e 's/5 96 99/345 30 80/g' myproj
# sed -i -e 's,/usr/sbin/readahead,path/to/proj,' myproj
# gedit myproj
<< change the 'start()' function to start proj with correct args >>

Then install the service with
# chkconfig --add myproj
# chkconfig --level 345 myproj on
and start it for the first time with ,,,
# service myproj start

It will start upon boot to init level 3,4,5 from then on.
Reply With Quote

app, auto, starting, startup

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting my network drive to auto-mount on startup wizza Hardware & Laptops 10 29th October 2009 03:24 PM
Fedora 11 DHCPD Not Auto Starting danodemano Using Fedora 0 17th August 2009 06:05 PM
how to stop wireless auto-starting in Fedora 10 darrensunley Servers & Networking 2 22nd December 2008 06:05 PM
Auto starting apps timcorless Using Fedora 5 15th November 2006 01:01 PM
Auto Starting Service weave Installation, Upgrades and Live Media 1 21st February 2006 04:45 PM

Current GMT-time: 14:26 (Friday, 18-08-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat