[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: java application on startup

hi there!

Seth R Arnold wrote:
> Well, I am not an expert in such things, but somethings that might work for
> you...
> I *think* what you are aiming for is a way to run the program in the system
> init scripts yourself -- there is an /etc/init.d/skeleton file that you can
> copy to a new file, edit, and then make symbolic links to it in the
> /etc/rc?.d directories. It shouldn't be too difficult..

 yes, but that was secondary. what i was really looking for was a way to run
 that app in the background, although it needed a console for itself.
> Try to use start-stop-daemon if you can. It provides some nice features, if
> I recall correctly.

 that was my first thaught too, as i started to experiment with that yesterday.
> Most folks would just try to put it in the background, if the
> start-stop-daemon program doesn't work, using a "&" at the end of the
> command; eg,
> /usr/local/bin/start_server_command &

 that's what didn't work. it stopped the app.

> If it REQUIRES having a stdin, see if you can redirect from /dev/null; eg,
> /usr/local/bin/start_server_command < /dev/null &

 good idea. i think this will definitely work. i'll try this asap.


 the way i actually solved the problem is the following: i created a script with
 the right classpaths etc. and the full command line which should start my app.
 after trying this an that, somehow i taught, the old screen utility would
 come hany. and it did! what i can recommend to everybody out there: run your
 java startup-programs with screen -m -d -s /your/appscript. it does
 detach itself and runs in the background. very clean i must say. although this
 is a second-hand solution, it's far more easier to put in your rc-scripts and
 you can reattach to that screen whenever you want it (hmm, that should work,
 but doesn't for me).

 -> this is my opinion,
    there are laws against being killed for having one.

Reply to: