Startup Scrpts

Jeff Vian jvian10 at charter.net
Mon Jan 31 20:11:04 UTC 2005


On Mon, 2005-01-31 at 17:24 +0000, paul lawrence wrote:
> Hi,
> I am new to the world of linux, for my sins I have been entirely a
> Microsoft person; untill now,  and I need some advice on how to do
> something.  
>  
> I have a server running Fedora Core 3, with Resin.  
>  
> I want to be able to create a startup script that will set some
> environment variables for Java, start up Resin and the call two custom
> scripts I have been given.  I have been playing around with a file
> called resin-a.sh which a web site suggested creating to run the
> commands I want.
>  
> From a promt, if I type the following the variables are set OK, but if
> I include them in the resin-a.sh file and type sh resin-a.sh  they are
> not set.
>  
> export set JAVA_HOME=/usr/java/j2sdk1.4.2_06
> export set RESIN_HOME=/usr/local/resin
> export set PATH=$PATH:/usr/java/j2sdk1.4.2_06/bin
>  
>  

What shell are you running this script as?  I assume bash, but set is
not a commonly used function AFAIK. (unset OTOH is commonly used.)

In bash these lines would be 
   export JAVA_HOME=/usr/java/j2sdk1.4.2_06
   export RESIN_HOME=/usr/local/resin
   PATH=$PATH:/usr/java/j2sdk1.4.2_06/bin
to set the environment variables.
The path line works because $PATH is already an environment variable

Your syntax is using 2 built in shell commands -- export & set -- and
you cannot do that in most cases.

> I also want to somehow include in this script a startup command for
> httpd.sh to start the resin web server and also to call to other
> scripts.

The best place for that would be to add a call in /etc/rc.d/init.d/httpd
to start the scripts, or even better to put a custom script there (maybe
named "resin")to start the resin server so init will launch it for you.

If you created your own script there for startup then it would happen
automagically once all the proper magic is in the script.  See other
scripts there to see the format needed, and use the man pages for
chkconfig and service to see the details.

>  
> Any help would be much appreciated, as I said I am completely new to
> this and its a little confusing.
> Regards
> Paul
> -- 
> fedora-list mailing list
> fedora-list at redhat.com
> To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list




More information about the users mailing list