From owner-freebsd-questions Thu Jan 11 12:46:13 2001 Delivered-To: freebsd-questions@freebsd.org Received: from rush.telenordia.se (mail.telenordia.se [194.213.64.42]) by hub.freebsd.org (Postfix) with SMTP id 74CA137B400 for ; Thu, 11 Jan 2001 12:45:53 -0800 (PST) Received: (qmail 12504 invoked from network); 11 Jan 2001 21:45:45 +0100 Received: from bb-62-5-7-230.bb.tninet.se (HELO web1.tninet.se) (62.5.7.230) by mail.telenordia.se with SMTP; 11 Jan 2001 21:45:45 +0100 From: Mark Rowlands Reply-To: mark.rowlands@minmail.net To: Langa Kentane , "'questions@freebsd.org'" Subject: Re: starting a daemon automatically at startup. Date: Thu, 11 Jan 2001 21:38:09 +0100 X-Mailer: KMail [version 1.1.99] Content-Type: text/plain; charset="iso-8859-1" References: In-Reply-To: MIME-Version: 1.0 Message-Id: <01011121380900.00305@web1.tninet.se> Content-Transfer-Encoding: 8bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thursday 11 January 2001 08:18, Langa Kentane wrote: > Greetings. > I have just install ntop on a server running FreeBSD 4.1.1-RELEASE. Now I > need to start this with the following flags at boot time: '-dw 3000' > > How do I go about doing this? > Thanks in advance. > I believe the official way...and I am putting this in the hope that some one authoritative will correct this as appropriate because I have seen several opinions offered, is to provide a script in rc.d which will take a "start" and a "stop" option in /usr/local/etc/rc.d create a shell script looking something like this #!/bin/sh case $1 in start) if [ -x /usr/local/etc/myapp/start ]; then /usr/local/etc/myapp/start >/dev/null echo -n ' myapp' fi ;; stop) if [ -x /usr/local/etc/myapp/stop ]; then /usr/local/etc/myapp/stop >/dev/null echo -n ' myapp' fi ;; *) echo "usage: `basename $0` {start|stop}" >&2 exit 64 ;; esac create some directory /usr/local/etc/myapp with two commands stop and start with whatever is appropriate to stop and start the applications in an orderly fashion. Clearly if your application has existing commands these can be utilised from the appropriate directory sample stop script #!/bin/sh echo Stopping myapp in /usr/local/myapp kill `cat /var/log/myapp.pid` now let the flames roll ;-) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message