Callback custom_php_deinstall_command in PFSense 2.3



  • 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


  • Moderator

    @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> 
    


  • 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


Log in to reply