LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 11-05-2009, 02:48 PM   #1
anish2343
LQ Newbie
 
Registered: Nov 2009
Posts: 2

Rep: Reputation: 0
Exclamation Execution of a script -Urgent help needed??


I have installed Apache in my Linux5.1 machine.I have root access in that.I have also installed siteminder in that.Now everytime when i restart the apache its unable to load a env file from siteminder.Then i need to execute a script seperatly.What i need is to execute a script ". ./nete_wa_env.sh" evrytime when i login as "root"


Can somebody help me on it...

Last edited by anish2343; 11-05-2009 at 02:54 PM.
 
Old 11-05-2009, 03:26 PM   #2
velomoose
LQ Newbie
 
Registered: May 2005
Location: Colorado, USA
Distribution: OpenSUSE 11.1, Centos 5.3, Ubuntu Studio 8.04, 9.10
Posts: 9

Rep: Reputation: 0
When you login, a .bashrc or a profile style .bashrc file is called in the default bash shell. If your shell script sets up environment variables, you can add these to the root profile for startup. This is typically located in the /root/.bashrc file or you may try adding the shell script to the /etc/profile.d/ directory.
 
Old 11-05-2009, 03:27 PM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 23,811

Rep: Reputation: 6974Reputation: 6974Reputation: 6974Reputation: 6974Reputation: 6974Reputation: 6974Reputation: 6974Reputation: 6974Reputation: 6974Reputation: 6974Reputation: 6974
Quote:
Originally Posted by anish2343 View Post
I have installed Apache in my Linux5.1 machine.I have root access in that.I have also installed siteminder in that.Now everytime when i restart the apache its unable to load a env file from siteminder.Then i need to execute a script seperatly.What i need is to execute a script ". ./nete_wa_env.sh" evrytime when i login as "root"

Can somebody help me on it...
If you really want to, put it in root's .profile (or .bashrc), so it'll execute everytime you log in. Bad idea, though, since if you log it twice or more per day as root, you'll keep running multiple copies.

A better thing to do, would be to put it at the bottom of the apache startup script, so it'll run whenever Apache is restarted....
 
Old 11-05-2009, 03:42 PM   #4
anish2343
LQ Newbie
 
Registered: Nov 2009
Posts: 2

Original Poster
Rep: Reputation: 0
Is it advisable to have a wrapper scrip which call my env file along with the startup script of apache.If so can you please give me the syntax or command to create one...
 
Old 11-06-2009, 08:24 AM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 23,811

Rep: Reputation: 6974Reputation: 6974Reputation: 6974Reputation: 6974Reputation: 6974Reputation: 6974Reputation: 6974Reputation: 6974Reputation: 6974Reputation: 6974Reputation: 6974
Quote:
Originally Posted by anish2343 View Post
Is it advisable to have a wrapper scrip which call my env file along with the startup script of apache.If so can you please give me the syntax or command to create one...
No idea what you're asking for, in terms of a "wrapper scrip which call my env file".

In your first post, you said you already HAVE a shell script, that needs to be run, after you start up Apache. As I suggested, why don't you just put that same script file, in the Apache startup script???? Open the /etc/init.d/apache2 file, find the start routine, and put a call in there to run your shell script. That's it.
 
  


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
Help with script execution in bashrc globemast Linux - Newbie 4 11-07-2007 03:42 AM
script execution yakoub Linux - Software 3 11-12-2006 01:26 AM
Script execution salmanucit Linux - Software 1 12-08-2005 08:51 AM
script execution on halt linuxhippy Slackware 4 04-01-2005 07:09 PM
script execution Johng Programming 2 08-21-2004 04:58 PM

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

All times are GMT -5. The time now is 10:26 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
Open Source Consulting | Domain Registration