Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Error saving raw BGP config

    Scheduled Pinned Locked Moved 2.1 Snapshot Feedback and Problems - RETIRED
    5 Posts 3 Posters 1.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      bkraptor
      last edited by

      When saving some minor edits to an existing OpenBGP raw config I get the following error:
      Fatal error: Call to undefined function write_rcfile() in /usr/local/pkg/openbgpd.inc on line 195

      Checking the config afterwards shows that the config was actually saved.

      I'm running this:
      2.1-BETA0 (i386)
      built on Sat Jul 7 20:01:54 EDT 2012
      FreeBSD 8.3-RELEASE-p3

      I've also submitted a crash report just now.

      1 Reply Last reply Reply Quote 0
      • P
        phil.davis
        last edited by

        write_rcfile is in service-utils.inc
        It seems odd that /usr/local/pkg/openbgpd.inc does not have any require_once statements at all, I expected to see:

        require_once('service-utils.inc');
        

        and maybe some others, so it can find other routines like conf_mount_rw.
        I notice that openospfd.inc also does not have any require_once statements - it uses conf_mount_rw and write_rcfile.
        I guess that some paths to activating these things have already included the necessary things, and there are other paths that miss out on the includes.
        Other package inc files (pfblocker.inc, squid.inc โ€ฆ) have a whole list of require_once, so they can find the routines they need.
        Hopefully someone who understands why OpenBGP and OpenOSPF have worked without require_once statements for so long can make the fixes - I am reticent to make pull requests when I don't understand how it ever worked.

        As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
        If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

        1 Reply Last reply Reply Quote 0
        • jimpJ
          jimp Rebel Alliance Developer Netgate
          last edited by

          Those .inc files for packages are rarely included on their own. The package system will include them and then execute the commands, and the package system generally has most things loaded that could be needed. Especially things like write_rcfile.

          However if you add a require_once("service-utils.inc"); and that works when it's otherwise broken, then by all means, submit a pull request.

          Remember: Upvote with the ๐Ÿ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

          Need help fast? Netgate Global Support!

          Do not Chat/PM for help!

          1 Reply Last reply Reply Quote 0
          • B
            bkraptor
            last edited by

            I added require_once('service-utils.inc'); and the error seems to be gone.

            1 Reply Last reply Reply Quote 0
            • jimpJ
              jimp Rebel Alliance Developer Netgate
              last edited by

              Added some includes there and in ospfd/quagga since they have similar sets of code, and someone could hit the same issue there potentially.

              https://github.com/bsdperimeter/pfsense-packages/commit/b85fee0718d37e8da27ab2530e311cf5ac6d7434

              Remember: Upvote with the ๐Ÿ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

              Need help fast? Netgate Global Support!

              Do not Chat/PM for help!

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.