Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
rc-script depends and env variables
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
green_buddy
Tux's lil' helper
Tux's lil' helper


Joined: 08 Jan 2003
Posts: 115
Location: Bay Area, CA

PostPosted: Tue Feb 25, 2003 3:54 pm    Post subject: rc-script depends and env variables Reply with quote

Hi everyone...

One of my rc-scripts depends on the JAVA_HOME environment variable which apparently isn't setup yet when the script is run in the default runlevel. What do I need to put in the depend clause of the rc-script so that the JAVA_HOME environment variable is setup and available for the script to use.

All java-based variables are defined in...
Code:
/etc/env.d/20java


Thanks for any help with this! :D

-green
Back to top
View user's profile Send private message
herring
Apprentice
Apprentice


Joined: 22 Jul 2002
Posts: 187
Location: Norway

PostPosted: Tue Feb 25, 2003 7:04 pm    Post subject: Re: rc-script depends and env variables Reply with quote

Take a look at start() in
Code:

/usr/portage/app-sci/zetagrid/files/zetagrid.init

This script rips JAVA_HOME from profile.env
Back to top
View user's profile Send private message
herring
Apprentice
Apprentice


Joined: 22 Jul 2002
Posts: 187
Location: Norway

PostPosted: Sat Mar 01, 2003 12:23 am    Post subject: Re: rc-script depends and env variables Reply with quote

Code:

.
.
.
start() {
ebegin "Starting my rc-script"
JAVA_HOME="`/bin/grep -e "JAVA_HOME" /etc/profile.env | sed -e "s/^.*'\(.*\)'$/\1/"`"
export PATH=$PATH:$JAVA_HOME/bin
.
.
.


Anyone with a more graceful way of doing it ?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum