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

    Callback custom_php_deinstall_command in PFSense 2.3

    Scheduled Pinned Locked Moved Development
    3 Posts 3 Posters 908 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.
    • S
      Sander88
      last edited by

      Hi,

      I'm trying to port a few packages to PFSense 2.3 (pkg). But I can't get the callback 'custom_php_deinstall_command' get to work. It's not being invoked when calling a pkg delete:

      pkg delete pfSense-pkg-mypackage

      Output:
      [1/1] Deinstalling pfSense-pkg-mypackage-VERSION…
      Removing mypackage components...
      Menu items... done.
      Services... done.
      Loading package instructions...
      [1/1] Deleting files for pfSense-pkg-mypackage-VERSION: 100%
      Removing mypackage components…
      Configuration... done.

      Has this callback been removed, renamed or this a bug? The callback works on PFSense 2.1 and 2.2 so it's configured correctly in the XML package file.

      Regards,
      Sander

      1 Reply Last reply Reply Quote 0
      • BBcan177B
        BBcan177 Moderator
        last edited by

        @Sander88:

        I'm trying to port a few packages to PFSense 2.3 (pkg). But I can't get the callback 'custom_php_deinstall_command' get to work. It's not being invoked when calling a pkg delete:

        pkg delete pfSense-pkg-mypackage

        Has this callback been removed, renamed or this a bug? The callback works on PFSense 2.1 and 2.2 so it's configured correctly in the XML package file.

        HI Sander88,

        I was hit by this issue also… Use this tag instead:

         <custom_php_pre_deinstall_command>CODE HERE
                ]]></custom_php_pre_deinstall_command> 
        

        "Experience is something you don't get until just after you need it."

        Website: http://pfBlockerNG.com
        Twitter: @BBcan177  #pfBlockerNG
        Reddit: https://www.reddit.com/r/pfBlockerNG/new/

        1 Reply Last reply Reply Quote 0
        • bmeeksB
          bmeeks
          last edited by

          With the change to pkg to fully manage installs and uninstalls of packages, the old _<custom_php_deinstall_command></custom_php_deinstall_command>_still gets called, but the problem now is it gets called after pkg has already deleted all the PHP and INC files from the system.  So naturally your deinstall routines can't be called because they no longer exist.  I hit the same problem in one of my packages.

          The command BBcan177 referenced gets called before pkg removes all the files, so your uninstall routine can run.

          Bill

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