Subject: Re: Daemon
To: None <netbsd-users@NetBSD.ORG>
From: Yosep <yoskim@NMSU.Edu>
List: netbsd-users
Date: 07/02/2003 11:57:22
Hello!

I've just created what I think is a daemon, however, I am not sure how it
actually works.  Here is what I have done.

I put an executable shell script in my /usr/pkg/sbin. I also made a
myfiled and put it in /usr/pkg/etc/rc.d directory.  Since, I would like to
run the daemon using a PID file, I captured a PID of a session running in
background and put it in /var/run/ directory.  Thus, myfiled looks like
the following

#
# $NetBSD$
#

# PROVIDE: myfiled
# REQUIRE: DAEMON
# BEFORE:  LOGIN

.. /etc/rc.subr

name="myfiled"
rcvar=${name}
command="/usr/pkg/sbin/${name}"
pidfile="/var/run/myfile.pid"

load_rc_config $name
run_rc_command "$1"


Am I doing this right?  And if I am doing it right, how can I put this to
work?  I am not quite sure how to start a daemon or stop it.  I tried
something like /usr/pkg/etc/rc.d beacond start ... but didnt work.

Any help would be greatly appreicated, and also any suggestions to online
documentations on dealing with daemon would be great!
thanks a lot.


=============
   |\/\/|   |  Yosep Kim
   |,,,,|   |  NMSU Computer Lab Assistant
   |    |   |  Computer Science, B.S.
  [|^  ^|]  |  New Mexico State Unversity
    \__/    |  http://web.nmsu.edu/~yoskim
=============
 PHIL 4:13