Re: [pfSense Support] OpenBGPd package on 1.2.3-release

2010-02-01 Thread Ermal Luçi
On Fri, Jan 29, 2010 at 5:03 PM, Aarno Aukia aarnoau...@gmail.com wrote:

 Hello,

 On Fri, Jan 29, 2010 at 00:06, Scott Ullrich sullr...@gmail.com wrote:
  On Thu, Jan 28, 2010 at 10:57 AM, Aarno Aukia aarnoau...@gmail.com
 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.old2010-01-29 16:53:08.0 +0100
 +++ openbgpd.inc2010-01-29 17:00:55.0 +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);


This is missing a bgpctl reload in an else?!



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

 -
 To unsubscribe, e-mail: support-unsubscr...@pfsense.com
 For additional commands, e-mail: support-h...@pfsense.com

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




-- 
Ermal


Re: [pfSense Support] OpenBGPd package on 1.2.3-release

2010-02-01 Thread Aarno Aukia
Hello Ermal,

On Mon, Feb 1, 2010 at 09:35, Ermal Luçi ermal.l...@gmail.com wrote:
 On Fri, Jan 29, 2010 at 5:03 PM, Aarno Aukia aarnoau...@gmail.com wrote:
 On Fri, Jan 29, 2010 at 00:06, Scott Ullrich sullr...@gmail.com wrote:
  On Thu, Jan 28, 2010 at 10:57 AM, Aarno Aukia aarnoau...@gmail.com
  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.0 +0100
 +++ openbgpd.inc        2010-01-29 17:00:55.0 +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);

 This is missing a bgpctl reload in an else?!

Do you think executing /usr/local/etc/rc.d/bgpd.sh should issue a
bgpctl reload if bgpd is already running ? Although issuing an error
message (and maybe suggesting using bgpctl reload instead) if bgpd was
found already running would be the nice thing to do, I agree:

$ diff -urNp openbgpd.inc.old openbgpd.inc
--- openbgpd.inc.old2010-01-29 16:53:08.0 +0100
+++ openbgpd.inc2010-02-01 11:29:46.0 +0100
@@ -153,7 +153,13 @@ 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, else\n);
+   fwrite($fd,   echo 'bgpd was not started because there is already a
process \bgpd parent\ running. To reload the configuration please
issue \bgpctl reload\.\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);

Regards,
Aarno
-- 
Aarno Aukia
Atrila GmbH
Switzerland

-
To unsubscribe, e-mail: support-unsubscr...@pfsense.com
For additional commands, e-mail: support-h...@pfsense.com

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



Re: [pfSense Support] OpenBGPd package on 1.2.3-release

2010-02-01 Thread Aarno Aukia
Hello,

On Sun, Jan 31, 2010 at 19:10, Scott Ullrich sullr...@gmail.com wrote:
 On Fri, Jan 29, 2010 at 11:03 AM, Aarno Aukia aarnoau...@gmail.com wrote:
 Thanks for committing,

 Committed.  Thanks for submitting.

Please also bump the packages version number, although this was not in
my patch ;)

Thanks,
Aarno
-- 
Aarno Aukia
Atrila GmbH
Switzerland

-
To unsubscribe, e-mail: support-unsubscr...@pfsense.com
For additional commands, e-mail: support-h...@pfsense.com

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



Re: [pfSense Support] OpenBGPd package on 1.2.3-release

2010-01-31 Thread Scott Ullrich
On Fri, Jan 29, 2010 at 11:03 AM, Aarno Aukia aarnoau...@gmail.com wrote:
 Thanks for committing,

Committed.  Thanks for submitting.

Scott

-
To unsubscribe, e-mail: support-unsubscr...@pfsense.com
For additional commands, e-mail: support-h...@pfsense.com

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



Re: [pfSense Support] OpenBGPd package on 1.2.3-release

2010-01-29 Thread Aarno Aukia
Hello,

On Fri, Jan 29, 2010 at 00:06, Scott Ullrich sullr...@gmail.com wrote:
 On Thu, Jan 28, 2010 at 10:57 AM, Aarno Aukia aarnoau...@gmail.com 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.old2010-01-29 16:53:08.0 +0100
+++ openbgpd.inc2010-01-29 17:00:55.0 +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: support-unsubscr...@pfsense.com
For additional commands, e-mail: support-h...@pfsense.com

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



[pfSense Support] OpenBGPd package on 1.2.3-release

2010-01-28 Thread Aarno Aukia
Hello,

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 ?
In addition I discovered support for tcp-md5sig, which only works for
openbgpd-configurations made with the assisstant. I'll try to hack
something up for parsing the raw config and generating a
bgpdsetkey.conf. Any suggestions there ?

Regards,
Aarno
-- 
Aarno Aukia
Atrila GmbH
Switzerland

-
To unsubscribe, e-mail: support-unsubscr...@pfsense.com
For additional commands, e-mail: support-h...@pfsense.com

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



Re: [pfSense Support] OpenBGPd package on 1.2.3-release

2010-01-28 Thread Scott Ullrich
On Thu, Jan 28, 2010 at 10:57 AM, Aarno Aukia aarnoau...@gmail.com wrote:
 Hello,

 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.

 In addition I discovered support for tcp-md5sig, which only works for
 openbgpd-configurations made with the assisstant. I'll try to hack
 something up for parsing the raw config and generating a
 bgpdsetkey.conf. Any suggestions there ?

No suggestions at the moment but I would appreciate anything you can
send over in form of patches.  Have been super busy lately and not
enough time to go around unfortunately.

Scott

-
To unsubscribe, e-mail: support-unsubscr...@pfsense.com
For additional commands, e-mail: support-h...@pfsense.com

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