LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices



Reply
 
Search this Thread
Old 08-16-2004, 04:28 PM   #1
Phaethar
Member
 
Registered: Oct 2003
Location: MN
Distribution: CentOS, Fedora
Posts: 182

Rep: Reputation: 30
Automatically run scripts on startup?


Hey all,

I'm hoping someone can give me some advice on how to fire off some scripts that open in a window after the desktop has finished loading on bootup on a FC2 box. I have a bunch of shell scripts set up on the desktop that constantly monitor some folders for incoming files. I have a script to launch them, and have launchers set up on the desktop to open them in a terminal window so I can see the progress as well as any errors that come up. What I'd like to do is find a way to run these launchers on bootup.

So far, I've tried putting the script info in the rc.d file, as well as the .bash_profile file. Either they don't run at all in the case, or they run too early and don't allow the system to finish booting.

Is there someplace that I can get this set up to have them start up after everything else has loaded?

Thanks.
 
Old 08-16-2004, 06:07 PM   #2
born4linux
Senior Member
 
Registered: Sep 2002
Location: Philippines
Distribution: Slackware, RHEL&variants, AIX, SuSE
Posts: 1,127

Rep: Reputation: 49
~/.xinitrc would be the answer. it can launch your script after starting up the window manager.
 
Old 08-16-2004, 07:44 PM   #3
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
Do you want these scripts to run only when using a kde session. There is a startup folder in ~/.kde. I think you need to create a .desktop kde link in this folder to run them there ( by right clicking in file browser is one way to do this. )

There is also a .xinitrc file that could source these scripts whenever logging in to an xsession. This would have the advantage of allowing you to run different desktop environment.

Perhaps you could write the script to run as a service and use cron or anacron to check periodically if they need to be run.

Which startup file or script you use should be determined by when you want it to run. I.E. only when using kde, only when a particular user is logged in. The .bashrc is run whenever starting a new shell so this one is out. The .bash_profile is run when logging in but is specific to the bash shell. If you use a different default shell, it may not be sourced when logging in. Be sure to check the default shell listed in the /etc/passwd file.

You may want to look at using Superkaramba for the monitoring functions.
 
Old 08-17-2004, 08:47 AM   #4
Phaethar
Member
 
Registered: Oct 2003
Location: MN
Distribution: CentOS, Fedora
Posts: 182

Original Poster
Rep: Reputation: 30
Thanks for the replies so far on this.

Quote:
~/.xinitrc would be the answer. it can launch your script after starting up the window manager.
Could you go into a little more detail on this please? I see the script.. just not anyplace to add items to be started after everything else. I tried just throwing it at the end of the script, but nothing happened..

jschiwal, I'm looking for these scripts to fire off for a particular user, and I'm using only Gnome at this point. I have to believe there's some way to get something like this to start up after everything else comes up. I can't really have it start as a service, because I need to see it start up in a terminal window (or xterm) so I can see any errors that show up, and watch the progress as well.

Thanks again for the help so far on this.. hopefully we can figure out a way to get this to work.
 
Old 09-21-2004, 02:54 PM   #5
BanjoTEKE
LQ Newbie
 
Registered: Sep 2004
Location: Lafayette, Louisiana
Distribution: Mandrake 10
Posts: 7

Rep: Reputation: 0
Here is what I need to do...

I installed x11vnc to run when I type "x11vncstart start"

and BAMN, it starts... I want this to execute at startup... I have a Mandrake 10 linuxbox with ONE user that AUTOLOGS IN... So, where in his home directory can I add this line? I tried .bash_profile and the box booted up to a blue screen with no icons but with a mouse cursor and VNC attachted fine, but It stays at the useless blue screen...

I want this to be the VERY last thing that runs... I basically want to keep the machine in a closet and connect via VNC whenever I need...
 
Old 09-22-2004, 03:40 AM   #6
wiraone
Member
 
Registered: Nov 2003
Location: Diawang-awangan
Distribution: Ubuntu Hoary!
Posts: 319

Rep: Reputation: 30
Is this what you want to do?

http://www.realvnc.com/v4/x0.html
 
Old 09-22-2004, 07:48 AM   #7
BanjoTEKE
LQ Newbie
 
Registered: Sep 2004
Location: Lafayette, Louisiana
Distribution: Mandrake 10
Posts: 7

Rep: Reputation: 0
Problem I had with REALVNC is that it would only bring up the X Windows (Grey SCreen with Menus, not your actual screen)...

x11vnc (Google x11vnc) is better and more useful...
 
Old 09-22-2004, 09:17 AM   #8
wiraone
Member
 
Registered: Nov 2003
Location: Diawang-awangan
Distribution: Ubuntu Hoary!
Posts: 319

Rep: Reputation: 30
If you've it loaded as a module, you won't get the X Windows, but you will get the real screen (be it Gnome or KDE). I've been using it for a while now.
 
Old 09-23-2004, 05:41 AM   #9
the.duckman
LQ Newbie
 
Registered: Sep 2004
Posts: 2

Rep: Reputation: 0
I've got the same damb problem. but Im using realvnc.

I added the vncserver line to /ect/rc.local and it worked but my user for the remote was root.
This is definatly not good for the situation I am in. not tomention the the vnc startup commands were not executed since the was no commands set for the root user.


Is there a .login like the old days (when xwinows wasn't a thorn in my side) anywhere........?


-dm
 
Old 09-23-2004, 11:50 AM   #10
wiraone
Member
 
Registered: Nov 2003
Location: Diawang-awangan
Distribution: Ubuntu Hoary!
Posts: 319

Rep: Reputation: 30
No idea if you've tried the method from my previous post .. if not, why not give it a try and give a feedback.
 
Old 09-24-2004, 03:35 AM   #11
the.duckman
LQ Newbie
 
Registered: Sep 2004
Posts: 2

Rep: Reputation: 0
Ahh you see my situations a bit perculular. and I dont think that link will work for me.

What I wish is do is have vnc start only when a particular user logs in.

The idea is that that user account is automaticly logged in after 30 seconds
if no one else logs in at the welcome screen when the system starts up.

Kindava a default to vnc option.


The box is required to run a specific detection/processing algorithem over large chunks of medical data sent to it sporaticaly.
Due to the sensitive nature of data being sent to the machiene and the non-trusted nature of my uni network the box will be powered off wile not in use. This is done to prevent the kind of misshaps that almost cost some of my colleges there jobs.....


-dm
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I run a command automatically at startup? luwigie Linux - General 8 08-26-2004 10:05 PM
How do I run startup scripts?O gaborn415 Linux - Newbie 1 04-15-2004 09:54 PM
How do I get Fedora to automatically run a command during startup? jlsain Linux - Software 2 03-23-2004 05:03 AM
Where to run scripts automatically on login/logout hilltop*Tech Linux - General 2 02-06-2004 11:59 AM
How can the linux OS run script automatically at startup? tommylkc Linux - Newbie 1 06-26-2002 04:09 AM


All times are GMT -5. The time now is 03:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration