From owner-freebsd-questions Sun Jan 14 22: 2:10 2001 Delivered-To: freebsd-questions@freebsd.org Received: from xena.gsicomp.on.ca (cr677933-a.ktchnr1.on.wave.home.com [24.43.230.149]) by hub.freebsd.org (Postfix) with ESMTP id 7B20B37B401 for ; Sun, 14 Jan 2001 22:01:52 -0800 (PST) Received: from hermes (hermes.gsicomp.on.ca [192.168.0.18]) by xena.gsicomp.on.ca (8.9.3/8.9.3) with SMTP id BAA67983; Mon, 15 Jan 2001 01:00:55 -0500 (EST) (envelope-from matt@gsicomp.on.ca) Message-ID: <001401c07eb8$d5094290$1200a8c0@gsicomp.on.ca> From: "Matthew Emmerton" To: "Odhiambo Washington" Cc: "FBSD-Q" References: <20010113220443.A528@poeza.iconnect.co.ke> <005e01c07d97$b7fdef60$1200a8c0@gsicomp.on.ca> <20010114104750.A4581@poeza.iconnect.co.ke> <00bc01c07e43$8e0429c0$1200a8c0@gsicomp.on.ca> <20010115085056.B9478@poeza.iconnect.co.ke> Subject: Re: Starting daemons in rc.local Date: Mon, 15 Jan 2001 01:03:04 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Hi Matthew, > > Thank you once again for reverting to me. I'm writing to inform you that > I also tried to adapt the example script in rc(8) man page for > 4.2-STABLE but I realized that even though the processes started, they > were not creating the process pid in /var/run. So really i am now into > looking at a way of having the magic pid created.... > > Does anyone know how to achieve this for any process??? Most daemons will look for an environment variable or a command line option specifying where a pid file should be created. If the daemon doesn't support this, then modify the if block in the start section of your script to look like this (in your case you'll have to do this for both radiusd and filterd): if [ -f /sbin/radiusd]; then /sbin/radiusd -d /etc/raddb -a /var/adm/radacct && echo -n "radius" ps -ax | grep radiusd | head -1 | awk ' { print $1 } ' > /var/run/radiusd.pid fi Keep in mind that this method is not entirely foolproof. -- Matt Emmerton To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message