gcj: SignalListener, process pid, ...

Erik Poupaert erik.poupaert@freestyler-toolkit.org
Sun Sep 28 12:43:00 GMT 2003


For long-running processes (serverside programs) on linux, I need to "signal" them
with -HUP to reread their config files, and "-TERM" to stop operating. How can I
respond to signals in gcj? I mean, is there a class like "SignalListener" anywhere?
Do I need to wrap something with CNI? Has anybody done that already?

Further, I need these programs to write a pidfile (in /var/run, conventionally), so
that they fit in with the start-stop-daemon things on linux. From there I can
register these serverside programs in /etc/init.d so that they operate just like
ordinary linux serverside programs.

I really don't want to stray from "/etc/init.d" for long-running serverside programs.
I mean, the concept really works well and I think one should go that way.

The proper place where gcj would make pids available would be java.lang.System, but
it's not there? Another wrapper?

Has anybody already created a CNI-based posix-oriented library that makes the
classical unix concepts available in gcj (environment vars, signals, pid, essential
areas in libc,...). I wonder how you can write decent server programs for unix/linux,
without it?

I mean I am aware of the the argument of "multiplatform" things, but such argument
starts from a wrong assumptions, i.e., that linux and windows would be equivalent
server platforms and that it would somehow make sense to deploy applications on a
windows server. I think a safer assumption would be to accept that it doesn't make
sense.



More information about the Java mailing list