Lightsquid package can cause upgrade failure due to failed dependency on squid.



  • Dear port maintainer,

    I was just bit by a flaw while upgrading from pfSense 2.0.1 to 2.02.
    In my particular case, I apparently had a version of squid installed that had been removed from the package repo.
    Since Lightsquid apparently Includes, or requires squid.inc to function, and because the batch reinstall of packages couldn't reinstall squid
    and thus squid.inc not existing, I ended up with a system that was stuck in package install state.

    While attempting to fix the problem, I tried to use the 'reinstall packages' button, and then reboot the router. This made things 100% worse,
    as I no longer had any webconfigurator access.

    Since this package appears to be nearing -Stable, I would highly recommend adding something similar to the following code to allow for a graceful
    failure, if for some reason the squid dependency failed

    
    if (is_file('./squid.inc'))
    {
        // I didn't look, so replace require_once, with require() or include() as appropriate
        require_once('./squid.inc');
        //do stuff
    }
    else
    {
      // add pfsense gui items 
      echo "Squid package is required for this package to operate. Please go to the package manager and install squid.";
    }
    
    

    Of course, this is not the absolute best sanity check, but at least it resolves the problem of missing missing squid.inc during a pfSense upgrade
    resulting in a broken system. Something like below in addition to the above would be better.

    
    //check to make sure a variable, function or class from squid.inc actually exists
    if (isset($variable_name))
    if (function_exists('function_name'))
    if (class_exists('class_name'))
    
    


  • In some cases it's better to remove all packages before firmware update. It will keep all config but will not hang install/upgrade process.


Locked