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

    /usr/local/sbin/pfSense-upgrade deletions

    Scheduled Pinned Locked Moved Development
    15 Posts 8 Posters 2.8k 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
      skogs
      last edited by

      Was on 2.4.5.r.20200225.2100 and going to 2.4.5.r.20200229.0000

      Web config updates failing
      console updates failing; from console at least got an error message:

      /bin/sh: cannot open /usr/local/sbin/pfSense-upgrade: No such file or directory
      

      Just sort of stabbing in the dark:

      touch pfSense-upgrade
      chmod +x pfSense-upgrade
      

      Obviously the above didn't work, console upgrade still did nothing; but no error message this time.

      /cf/conf/upgrade_log.latest.txt has nothing new since several days ago bumping up to 225.2100
      No errors or mentions of deleting the update file

      System ceased finding new updates after 0000 timeframe.
      Did a fresh install, and bumping 2.4.4p3 to 2.4.5.r.20200229.0900 also wound up deleting the file.
      So I've got two instances of update attempts in a row that deleted the update file. Kind of a bummer.

      For the record the original contents of the file in 2.4.4p3 are below, but I'm guessing it got deleted during an attempted update so ymmv:

      #!/bin/sh
      #
      # pfSense-upgrade.wrapper
      #
      # part of pfSense (https://www.pfsense.org)
      # Copyright (c) 2015-2016 Rubicon Communications, LLC (Netgate)
      # All rights reserved.
      #
      # Licensed under the Apache License, Version 2.0 (the "License");
      # you may not use this file except in compliance with the License.
      # You may obtain a copy of the License at
      #
      # http://www.apache.org/licenses/LICENSE-2.0
      #
      # Unless required by applicable law or agreed to in writing, software
      # distributed under the License is distributed on an "AS IS" BASIS,
      # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      # See the License for the specific language governing permissions and
      # limitations under the License.
      
      pfsense_upgrade=$(realpath -q $(dirname $0)/../libexec/$(basename $0))
      lockfile="/tmp/$(basename $0).lock"
      
      if [ ! -f ${pfsense_upgrade} ]; then
      	echo "ERROR: Unable to find ${pfsense_upgrade}"
      	exit 1
      fi
      
      if [ "$(id -u)" -ne "0" ]; then
      	echo "ERROR: It must run as root"
      	exit 1
      fi
      
      # lockf return codes, from sysexits(3)
      EX_TEMPFAIL=75	# The specified lock file was already locked by another process.
      EX_CANTCREAT=73	# The lockf utility was unable to create the lock file, e.g.,
      		# because of insufficient access privileges.
      EX_OSERR=71	# A system call (e.g., fork(2)) failed unexpectedly.
      EX_SOFTWARE=70	# The command did not exit normally, but may have been signaled
      		# or stopped.
      
      # Special return code to detect when pfSense-upgrade was upgraded and must
      # be called again to make sure latest version is running
      EX_UPGRADE=99
      
      while true; do
      	unset run_again
      	/usr/bin/lockf -s -t 5 ${lockfile} ${pfsense_upgrade} "$@"
      	rc=$?
      
      	unset error
      	case "$rc" in
      		${EX_TEMPFAIL})
      			echo "Another instance is already running... Aborting!"
      			exit $EX_TEMPFAIL
      			;;
      		${EX_CANTCREAT})
      			echo "ERROR: Unable to create lockfile ${lockfile}"
      			exit $EX_CANTCREAT
      			;;
      		${EX_OSERR})
      			echo "ERROR: An unexpected OS error happened"
      			error=$EX_OSERR
      			;;
      		${EX_SOFTWARE})
      			echo "ERROR: An unexpected error happened"
      			error=$EX_SOFTWARE
      			;;
      		${EX_UPGRADE})
      			run_again=1
      			;;
      	esac
      
      	[ -f "${lockfile}" ] \
      		&& rm -f ${lockfile}
      
      	[ -n "${error}" ] \
      		&& exit $error
      
      	[ -n "${run_again}" ] \
      		&& continue
      
      	exit $rc
      done
      
      1 Reply Last reply Reply Quote 0
      • P
        pponce
        last edited by

        Same issue I'm seeing.
        trying to go from 2.4.5.r.20200226.1800 to 2.4.5.r.20200228.1800

        /bin/sh: cannot open /usr/local/sbin/pfSense-upgrade: No such file or directory
        

        Any idea how to get fix?

        1 Reply Last reply Reply Quote 0
        • B
          bigsy
          last edited by

          Looks like it's known about - https://redmine.pfsense.org/issues/10303

          1 Reply Last reply Reply Quote 1
          • P
            pponce
            last edited by pponce

            Thanks for pointing me there. The suggested workaround steps worked for me.

            pkg update && pkg upgrade -y
            
            1 Reply Last reply Reply Quote 1
            • S
              skogs
              last edited by

              Confirm seems to have completed a valid update cycle this time.
              I didn't test the webconfig.

              went from 2.4.4p3 to 0229.1500 successfully with the pkg update && pkg upgrade -y and a manual reboot.

              T 1 Reply Last reply Reply Quote 1
              • T
                tmushy @skogs
                last edited by

                @skogs Solved my issue Thank you

                1 Reply Last reply Reply Quote 0
                • stephenw10S
                  stephenw10 Netgate Administrator
                  last edited by

                  Also seeing this in current 2.4.5 and 2.5 snapshots. I was also able to recover by running pkg upgrade manually.

                  We are looking into this.

                  Steve

                  1 Reply Last reply Reply Quote 0
                  • cybrnookC
                    cybrnook
                    last edited by

                    Hit this as well. Recourse was to manually install again and recover from xml backup. (Did that before seeing this)

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

                      See https://redmine.pfsense.org/issues/10303

                      The better fix, for those who hit it already, is to run pkg install pfSense-upgrade

                      It's been addressed in the repo, so if you didn't hit it yet, you shouldn't hit it now when upgrading.

                      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 1
                      • yon 0Y
                        yon 0
                        last edited by

                        @skogs said in /usr/local/sbin/pfSense-upgrade deletions:

                        pkg update && pkg upgrade -y

                        pkg install pfSense-upgrade
                        Updating pfSense-core repository catalogue...
                        Fetching meta.txz: 100% 944 B 0.9kB/s 00:01
                        Fetching packagesite.txz: 100% 2 KiB 1.8kB/s 00:01
                        Processing entries: 100%
                        pfSense-core repository update completed. 7 packages processed.
                        Updating pfSense repository catalogue...
                        Fetching meta.txz: 100% 940 B 0.9kB/s 00:01
                        Fetching packagesite.txz: 100% 141 KiB 10.3kB/s 00:14
                        Processing entries: 100%
                        pfSense repository update completed. 522 packages processed.
                        All repositories are up to date.
                        Updating database digests format: 100%
                        The following 1 package(s) will be affected (of 0 checked):

                        New packages to be INSTALLED:
                        pfSense-upgrade: 0.79 [pfSense]

                        Number of packages to be installed: 1

                        13 KiB to be downloaded.

                        Proceed with this action? [y/N]: y
                        [1/1] Fetching pfSense-upgrade-0.79.txz: 100% 13 KiB 13.7kB/s 00:01
                        Checking integrity... done (0 conflicting)
                        [1/1] Installing pfSense-upgrade-0.79...
                        [1/1] Extracting pfSense-upgrade-0.79: 100%
                        [2.4.5-RC][admin@face]/root: pfSense-upgrade -6
                        pfSense-upgrade: Command not found.

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

                          When you install a new program like that, you have to type rehash or exit and re-enter the shell.

                          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
                          • yon 0Y
                            yon 0
                            last edited by

                            pfSense-upgrade -6

                            Updating repositories metadata...
                            Updating pfSense-core repository catalogue...
                            pfSense-core repository is up to date.
                            Updating pfSense repository catalogue...
                            Fetching meta.txz: . done
                            Fetching packagesite.txz: .... done
                            pkg-static: https://pkg.pfsense.org/pfSense_v2_4_5_amd64-pfSense_v2_4_5/packagesite.txz: Operation timed out
                            Unable to update repository pfSense
                            Error updating repositories!

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

                              This thread is not for problems like that. It's for the specific issue of pfSense-upgrade getting removed.

                              Start a new thread.

                              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
                              • yon 0Y
                                yon 0
                                last edited by

                                use this command is good for upgarde.
                                pkg update && pkg upgrade -y

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

                                  See above, that is not the recommended procedure.

                                  Locking this, it's been solved already.

                                  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.