SUMMARY: java script startup in rc3.d

From: Carole Thompson <carole_at_robles.callutheran.edu>
Date: Mon, 08 Dec 1997 08:14:02 -0800

The original post:
I want to start up a java script from rc3.d but what I'm doing is not
working. Is anyone doing something similar, and tell me what does work?

Many thanks. Two things were wrong with my original script: my pointer
to the csh was incorrect, and the command required a nohup command which
protects it from dying when the script exits. Others also suggested
setting environment variables, and specifying a java related CLASSPATH

The script which now works correctly:
#!/usr/bin/csh

cd /cwis/eres/www;
nohup /cwis/java/bin/java EresChatServer 6900 /dev/console 2>&1 &
sleep 60;
exit


Dejan Muhamedagic <dejan_at_yunix.com>
Your java program doesn't fork, i.e. it doesn't detaches itself from
controling terminal so you should use nohup to start it, like:
nohup /cwis/java/bin/java EresChatServer 6900 < /dev/console >
/dev/console 2>&1 &
in order to prevent HUP signal getting to it.

Simon Tardell <Simon.Tardell_at_physto.se>
...the children of your script will be HUPped after the script has
exited. To avoid this, start the child with nohup. The other is that you
should make sure that, if (I guess this is not an issue for you) the
child daemonizes, that it has enough time to do so, before it is hupped.
Introducing a short sleep at the end of the startup script will take
care of that.

Ian Piumarta <piumarta_at_prof.inria.fr>
Might this be a problem with missing environment variables? Will java
work even if CLASSPATH isn't set? You might want to try adding a couple
of "setenv"s to the start of your init.d script to set up the variables,
duplicating any java-related environment vars that are defined in your
interactive shell

Santosh Krishnan x2815 <santosh_at_heplinux1.uta.edu>
When you boot up your server, I don't think the CLASSPATH variable gets
set until all the rc scripts have been run. Therefore, you will have to
specify the classpath as a command line argument to java. This should
allow your program to run.

"ali_at_platinum.com" <ali_at_platinum.com>
I don't think there is a /sbin/csh in standard installation of Digital
unix. you might want to check if /sbin/csh is available. I know there is
a /sbin/sh but I have not seen /sbin/csh.

Other respondents:
"Pam Woods, Systems Manager" <axsymgr_at_UAA.ALASKA.EDU>
Kris Chandrasekhar <Kris.Chandrasekhar_at_digital.com>
Received on Mon Dec 08 1997 - 17:22:01 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:37 NZDT