Subject: Running Java program as a daemon...
To: None <>
From: Yosep <yoskim@NMSU.Edu>
List: tech-pkg
Date: 09/09/2003 02:44:56
Hello again.

I have a java program that I want to run as a daemon, since it deals with
multicasting over network.  I wrote a daemon script that calls the java
program in /usr/pkg/bin, and installed it in /usr/pkg/etc/rc.d
I set pre-eliminary things such as adding it to rc configuration file.

The daemon script seemed starting fine upon running "./mydaemon start"
BUT, when I tried to stop it, it wouldn't by complaining that PID file is
not found.  However, the PID file is indeed in the right directory.

I later found out that in order to stop a daemon using default actions
that are provided by the system, I also need to know the name of the
daemon as in Process table.  But, since my daemon is showing as "java
mydaemon", the system fails to match the name of daemon and the name on
the process table, since mydaemon != java mydaemon.

Does anyone have any ideas or suggestions as to what I should do?

Thank you for your time.