Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Jan 2001 15:50:21 -0500
From:      "Tony M" <monfiletto@clinic.net>
To:        <mark.rowlands@minmail.net>, "Langa Kentane" <LangaK@discoveryhealth.co.za>, "'questions@freebsd.org'" <questions@FreeBSD.ORG>
Subject:   RE: starting a daemon automatically at startup.
Message-ID:  <EFEOIBBGDKBNGFLCACJMGEBDCDAA.monfiletto@clinic.net>
In-Reply-To: <01011121380900.00305@web1.tninet.se>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?EFEOIBBGDKBNGFLCACJMGEBDCDAA.monfiletto>