From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96078620310330.tru64-unix-managers.marc@archive.invalid> From: Carole Thompson Date: Mon, 08 Dec 1997 16:14:02 +0000 To: tru64-unix-managers Subject: SUMMARY: java script startup in rc3.d X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96078620310330 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 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 ...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 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 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@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" Kris Chandrasekhar