From owner-freebsd-questions Thu Jan 11 12:50:58 2001 Delivered-To: freebsd-questions@freebsd.org Received: from green.pwm.clinic.net (green.pwm.clinic.net [207.228.202.2]) by hub.freebsd.org (Postfix) with ESMTP id 6B8FC37B402 for ; Thu, 11 Jan 2001 12:50:30 -0800 (PST) Received: from tony (work-8.bath-me.clinic.net [207.228.206.23]) by green.pwm.clinic.net (8.9.3/8.9.3) with SMTP id PAA83465; Thu, 11 Jan 2001 15:50:21 -0500 (EST) (envelope-from monfiletto@clinic.net) From: "Tony M" To: , "Langa Kentane" , "'questions@freebsd.org'" Subject: RE: starting a daemon automatically at startup. Date: Thu, 11 Jan 2001 15:50:21 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: <01011121380900.00305@web1.tninet.se> X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Importance: Normal Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG why is there ' ' around the address? it screws my rules all up -----Original Message----- From: owner-freebsd-questions@FreeBSD.ORG [mailto:owner-freebsd-questions@FreeBSD.ORG]On Behalf Of Mark Rowlands Sent: Thursday, January 11, 2001 3:38 PM To: Langa Kentane; 'questions@freebsd.org' Subject: Re: starting a daemon automatically at startup. 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 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message