LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-28-2005, 07:42 AM   #1
dragoroberto
LQ Newbie
 
Registered: Feb 2005
Posts: 9

Rep: Reputation: 0
Execute Shell Scripts on startup


Hi,

I would like to execute 3 separate shell scripts at startup (using linux mandrake 10). How can I do this?

Thanks,
Roberto
 
Old 02-28-2005, 07:44 AM   #2
linuxxed
Member
 
Registered: Feb 2004
Posts: 273

Rep: Reputation: 30
/etc/rc.local
 
Old 02-28-2005, 07:47 AM   #3
dragoroberto
LQ Newbie
 
Registered: Feb 2005
Posts: 9

Original Poster
Rep: Reputation: 0
Say, I need to execute ...
1) xx.sh
2) yy.sh
3) zz.sh
ONLY FOR MY USER 'dragoroberto'.

How could I do this?

Thanks,
Roberto
 
Old 02-28-2005, 08:01 AM   #4
ahh
Member
 
Registered: May 2004
Location: UK
Distribution: Gentoo
Posts: 293

Rep: Reputation: 31
Add
Code:
xx.sh &
yy.sh &
zz.sh &
to the .xinitrc in dragorobertos home directory.
 
Old 02-28-2005, 08:07 AM   #5
dragoroberto
LQ Newbie
 
Registered: Feb 2005
Posts: 9

Original Poster
Rep: Reputation: 0
I have no such file (.xinitrc) in my home directory!!! Help me please!!!
 
Old 02-28-2005, 08:13 AM   #6
ahh
Member
 
Registered: May 2004
Location: UK
Distribution: Gentoo
Posts: 293

Rep: Reputation: 31
I don't use Madrake myself, but this should work I think.

Create a file called .xinitrc in your home directory (note the dot before the filename).
Assuming you use KDE add to the file:-
Code:
xx.sh &
yy.sh &
zz.sh &
startkde
Then next time you start X these programs should run.

man xinit will give you more details.
 
Old 02-28-2005, 08:45 AM   #7
dragoroberto
LQ Newbie
 
Registered: Feb 2005
Posts: 9

Original Poster
Rep: Reputation: 0
no ... that didn't work!!!

The script loaded, but no KDE!!
I want the script to run on seperate Konsole windows because these shell scripts are very long, and take long to finish their task.

Thanks,
Robertow

Last edited by dragoroberto; 02-28-2005 at 08:48 AM.
 
Old 02-28-2005, 09:07 AM   #8
ahh
Member
 
Registered: May 2004
Location: UK
Distribution: Gentoo
Posts: 293

Rep: Reputation: 31
If KDE didn't start it is probably because the
Code:
startkde
is wrong for your system.

The "&" after the script name is telling them to run in the background so you dont have to wait for them to finish before the next command is run.

As I said, I don't run Mandrake so you will have to look in your start up scripts to find the command used to start KDE and replace "startkde" with your command.

As an alternative, doesn't KDE have an Autostart folder for programs you want to run at start up?
 
Old 02-28-2005, 09:34 AM   #9
dragoroberto
LQ Newbie
 
Registered: Feb 2005
Posts: 9

Original Poster
Rep: Reputation: 0
What I managed to do is this:

I created a SHELL script in my home directory (STARTUP.sh):
cd /services/forecastSystem
konsole -e ./xx.sh &
konsole -e ./yy.sh &
konsole -e ./zz.sh &

I also added this string in the .bash_profile:
cd /home/dragoroberto
konsole -e ./STARTUP.sh

My shells scripts DO load, but I can't figure out how I could make them visible -- they are hidden and working in the background.

Thanks,
Roberto
 
Old 02-28-2005, 09:46 AM   #10
ahh
Member
 
Registered: May 2004
Location: UK
Distribution: Gentoo
Posts: 293

Rep: Reputation: 31
I think your problem may be that .bash_profile is run when you log in. This would be before the X session has started so there is no GUI for konsole to run in.

If you use KDM have a look to see if you have a .xsession file in your home directory, if not make one and add
Code:
konsole -e /services/forecastSystem/xx.sh &
konsole -e /services/forecastSystem/yy.sh &
konsole -e /services/forecastSystem/zz.sh &
to it.

These should then run after X has started.

I think it is really just a question of finding out which files Mandrake uses to control your X session. It varies between distros and also depends on how you start X.

Last edited by ahh; 02-28-2005 at 09:50 AM.
 
  


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
Implications when giving out a shell account to execute halflife server scripts nistelrooy Linux - General 4 02-24-2006 01:00 AM
execute shell-scripts at kde startup supersucker Linux - Newbie 10 10-28-2005 11:47 AM
Startup scripts not bothering to execute... systemparadox Slackware 3 01-26-2005 01:56 PM
how to execute shell scripts from cgi script rajatgarg Linux - General 1 07-08-2004 02:39 PM
How to get Konqueror to execute shell scripts in a new console on double click nitrambass Mandriva 0 06-22-2004 11:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:17 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration