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

    CARP scripts surviving an upgrade / enhancement proposal

    Scheduled Pinned Locked Moved HA/CARP/VIPs
    6 Posts 3 Posters 1.3k 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.
    • W Offline
      webmst
      last edited by

      Hi folks,
      I was wondering if there is an "official way" to preserve some lines of code added at the end of the CARP scripts (rc.carpmaster/rc.carpbackup).

      I've noticed that those files are always rewritten during an ugrade, leading to a loss a functionality that has to be restored manually later.

      Anyway, I suppose that a definitive solution would be to implement a simple GUI "CARP actions customization page" of user-specific code (to be called after system actions in the above said files), i.e the selection of a custom script file (stored in the pfsense configuration file), so that all customizations can survive an upgrade. This would be very useful, as it is becoming common to provide spinoff actions for a CARP status change.

      1 Reply Last reply Reply Quote 0
      • D Offline
        doktornotor Banned
        last edited by

        @webmst:

        I was wondering if there is an "official way" to preserve some lines of code added at the end of the CARP scripts (rc.carpmaster/rc.carpbackup).

        Try System Patches package.

        1 Reply Last reply Reply Quote 0
        • W Offline
          webmst
          last edited by

          Thanks for your fast-as-light answer!

          I had already thought of using System Patches but I had deemed it too complicated, expecially if compared with the practical solution of this problem (vi+paste text at the end of the rc.carpmaster/rc.carpbackup files).

          For this reason, and to create a definitive solution to getting-common necessities, I had preferred to suggest an enhancement for upcoming releases.

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

            Look at what Quagga and OpenBGPD do. There is "plugin" support in packages for hooking into the CARP code in the master/backup scripts. That's as close as you'll get without using the patches package.

            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
            • W Offline
              webmst
              last edited by

              Thank you for the suggestion jimp, infact I had noticed this recent modification in rc.carpmaster/rc.carpbackup as I was adding my code manually, but I hadn't still understood its purpose.

              However, your tip doesn't fit my case; indeed I have no package to notify about the CARP status change, just some code to execute in order to make a configuration change and an update for some dynamic dns entries; as said before - beside a manual edit of the CARP script files - the best for me would be a selection of a custom file in the GUI and a related call hook in rc.carpmaster/rc.carpbackup.

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

                That's what the plugin system is for โ€“ if you want to take advantage of it, make a small/simple package that does nothing but run your code. I highly doubt we'll be adding multiple ways of running custom code in the same area, so either keep patching it or take advantage of the plugin system made for that purpose.

                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.