OPNsense Forum

Archive => 21.7 Legacy Series => Topic started by: lshantz on August 10, 2021, 12:41:25 am

Title: Update to OPNsense 21.7.1-amd64 /bin/bash missing
Post by: lshantz on August 10, 2021, 12:41:25 am
I had an SSD block go bad which took my system down hard. I downloaded the 21.7 image and restored assuming that the bad block would be found and marked bad. When I attempted to use the  backup/restore option all hell broke loose. Lots of strange things, like unable to log in and interfaces not coming up.

Suspecting version incompatibility, I located the 21.1 image and restored. I was able to recover to it, just fine. So it does appear to be some sort of issue with the older backups. ?

Now though I have an odd issue that I need to resolve. I can ssh in, with no trouble, but if I try to su, or sudo su, it says: /usr/local/bin/bash: No such file or directory. how can I get a copy of this file back with no admin privileges? How does it not get installed from a scratch install? (21.1) If I save my backup from this 21.7 image, then install the newer image, I wonder if that works.
Title: Re: Update to OPNsense 21.7.1-amd64 /bin/bash missing
Post by: franco on August 10, 2021, 08:13:09 am
We do not rely on bash in our code so it's not installed.


Cheers,
Franco
Title: Re: Update to OPNsense 21.7.1-amd64 /bin/bash missing
Post by: Patrick M. Hausen on August 10, 2021, 09:12:16 am
You can set root's shell to e.g. /bin/csh from the UI.
Title: Re: Update to OPNsense 21.7.1-amd64 /bin/bash missing
Post by: lshantz on August 11, 2021, 01:01:43 am
Thank you very much for the response. If you do not install bash, what is the default shell you use?

Under system/settings/admin/ I see shell.. but no way to modify it. It is blank. Am I in the wrong spot?
Later: I found under users/root/ shows default of /usr/local/sbin/opnsense-shell, but when attempting to log in it says /bin/bash not found.

So doing a fresh install, then restoring from backup, screws this up?
Title: Re: Update to OPNsense 21.7.1-amd64 /bin/bash missing
Post by: Patrick M. Hausen on August 11, 2021, 05:12:27 am
Under system/settings/admin/ I see shell.. but no way to modify it. It is blank. Am I in the wrong spot?
Later: I found under users/root/ shows default of /usr/local/sbin/opnsense-shell, but when attempting to log in it says /bin/bash not found.
Did you try save/apply? Possibly change, save, change back, save?

root's default shell should be opensense-shell. If you don't want the menu on login, the FreeBSD default shell for root is /bin/csh.
Title: Re: Update to OPNsense 21.7.1-amd64 /bin/bash missing
Post by: fiddletwix on September 13, 2021, 01:16:48 am
We do not rely on bash in our code so it's not installed.


Cheers,
Franco

Just discovered this and appreciate the terse yet direct response. Did I miss this package removal from the release notes?  It broke my automation when I upgraded a few days ago.
Title: Re: Update to OPNsense 21.7.1-amd64 /bin/bash missing
Post by: Greelan on September 13, 2021, 01:28:13 am
See https://forum.opnsense.org/index.php?topic=15395.0

Perhaps bash was installed by another package (which has then changed its approach) and you were relying on that without realising?
Title: Re: Update to OPNsense 21.7.1-amd64 /bin/bash missing
Post by: franco on September 13, 2021, 09:04:55 am
Yes. The package manager distinguishes between manual and automatic packages:

"manual" means it was explicitly installed (by invoking "pkg install bash") for example. These packages are not automatically cleaned up.

"automatic" means it was implicitly installed by a dependency (e.g. by invoking "pkg install wireguard-tools"). When said package is removed, the automatic dependency is cleaned up along with it.

Long story short. If you rely on bash the following is enough to make it permanent:

# pkg install bash

Or when it was already installed:

# pkg set -A0 bash


Cheers,
Franco