You may want to look at what is needed by an non-interactive shell. Since stdout or stderr isn't redirected, the process is probably returning an error to your JVM which then falls over. You may need to wrap "nohup" around it, but for it to be non-interactive, you'll need to find out what the shell environment needs during boot up. If bash is your shell, there are a lot of nice things to do with bash that are good for those types of things. The basic "sh" shell isn't as flexible. If you are calling that directly, you'll need to figure out what it needs (which is probably redirecting stdout, stdin, and stderr). You'll have the same problem if you try to set something in the background and it attempts to write to stdout, stdin, or stderr. The background process will usually stop (unless you have your shell setup differently). So have your /etc/init.d/mservice script setup the environment then call the java program with all of the stdin, stdout, and stderr accounted for. You may want to look at using Log4J to account for your printing out to STDOUT or a log file, etc.
I used to have that problem adding things to my /etc/init.d/boot.local back in the days.
Jonathan Paul Cowherd Linux and Java Administrator Genscape, Inc. Email: email@example.com Office: (502) 583-3730 Mobile: (502) 314-0444
-----Original Message----- From: Jerry Feldman [mailto:firstname.lastname@example.org] Sent: Tuesday, September 17, 2002 4:47 PM To: email@example.com Subject: Re: [suse-programming-e] What kills a service process during boot ?
The time it is run from startup is very important. You must make sure that any dependent communications service have been run successfully prior to the running of your service. This is done via the Snn symlink. The higher the number the later on boot that this will start.
On 17 Sep 2002 at 22:32, Ofer Biran wrote:
I have a java service set exactly according to init.d/skelton (this is on Suse 7.2 for 390). When init.d/myservice is run outside boot - it's OK.
run during boot - it starts OK (get to the printout of listen on ServerSocket)- but then it is killed !
Then... I tried a very simple shell script service that just echo (i=1,2,3...) and sleep between. It works of course forever outside boot - but in boot, it prints (into a file - I used startproc -l) till 3 and
So what's the story here ??? I tried all combination of startproc / direct exec / various rc.3/Sxxmyservice - no change - the process starts OK but doesn't survive the boot. It's also reported among failed services in run level 3 - but [desparately] I added sleep after the startproc - then it
some more... and killed... just this time without being reported among the
Any help / idea will be appreciated !
Send and receive Hotmail on your mobile device: http://mobile.msn.com
-- To unsubscribe, email: firstname.lastname@example.org For additional commands, email: email@example.com Archives can be found at: http://lists/archive/suse-programming-e