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

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

    Scheduled Pinned Locked Moved pfSense Packages
    2 Posts 2 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.
    • S
      Sn3ak
      last edited by

      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'))
      
      
      1 Reply Last reply Reply Quote 0
      • marcellocM
        marcelloc
        last edited by

        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.

        Treinamentos de Elite: http://sys-squad.com

        Help a community developer! ;D

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