-   Fedora (
-   -   Automatically run scripts on startup? (

Phaethar 08-16-2004 04:28 PM

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?


born4linux 08-16-2004 06:07 PM

~/.xinitrc would be the answer. it can launch your script after starting up the window manager.

jschiwal 08-16-2004 07:44 PM

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.

Phaethar 08-17-2004 08:47 AM

Thanks for the replies so far on this.


~/.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.

BanjoTEKE 09-21-2004 02:54 PM

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...

wiraone 09-22-2004 03:40 AM

Is this what you want to do?

BanjoTEKE 09-22-2004 07:48 AM

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...

wiraone 09-22-2004 09:17 AM

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.

the.duckman 09-23-2004 05:41 AM

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........?


wiraone 09-23-2004 11:50 AM

No idea if you've tried the method from my previous post .. if not, why not give it a try and give a feedback.

the.duckman 09-24-2004 03:35 AM

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.....


All times are GMT -5. The time now is 06:07 AM.