Hello,

On Fri, Jan 29, 2010 at 00:06, Scott Ullrich <[email protected]> wrote:
> On Thu, Jan 28, 2010 at 10:57 AM, Aarno Aukia <[email protected]> wrote:
>> bgpd is started twice when booting on 1.2.3-release with the newest
>> package. I suspect once from /usr/local/pkg/openbgpd.inc and once from
>> /usr/local/etc/rc.d/bgpd.sh ? When commenting out the exec("bgpd") in
>> /usr/local/pkg/openbgpd.inc it is only started once. Should the check
>> is_openbgpd_running() also be added to /usr/local/etc/rc.d/bgpd.sh or
>> is there a more favorable way ?
>
> Sounds reasonable.

That would be:
$ diff -urNp openbgpd.inc.old openbgpd.inc
--- openbgpd.inc.old    2010-01-29 16:53:08.000000000 +0100
+++ openbgpd.inc        2010-01-29 17:00:55.000000000 +0100
@@ -153,7 +153,11 @@ function openbgpd_install_conf() {
        $fd = fopen("/usr/local/etc/rc.d/bgpd.sh","w");
        fwrite($fd, "#!/bin/sh\n\n");
        fwrite($fd, "# This file was created by the pfSense package manager.
 Do not edit!\n\n");
-       fwrite($fd, "/usr/local/sbin/bgpd -f /usr/local/etc/bgpd.conf\n");
+       fwrite($fd, "NUMBGPD=`ps auxw | grep bgpd | grep parent | grep -v
grep | wc -l | awk '{print \$1}'`\n");
+       fwrite($fd, "#echo \$NUMBGPD\n");
+       fwrite($fd, "if [ \$NUMBGPD -lt 0 ] ; then\n");
+       fwrite($fd, "  /usr/local/sbin/bgpd -f /usr/local/etc/bgpd.conf\n");
+       fwrite($fd, "fi\n");
        fclose($fd);
        exec("chmod a+rx /usr/local/etc/rc.d/bgpd.sh");
        exec("chmod a-rw /usr/local/etc/bgpd.conf");

Thanks for committing,
Aarno
-- 
Aarno Aukia
Atrila GmbH
Switzerland

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Commercial support available - https://portal.pfsense.org

Reply via email to