I really hate struggling with csh in single user mode. At a time when I need to be sharp, I find myself stumbling in the dark, cursing csh, and no man pages available.
So, I make sure I always have the shell that works for me:
Code:
[ritz.1131] $ grep ^root /etc/passwd
root:*:0:0:Charlie &:/root:/bin/ksh
[ritz.1132] $ grep ^/bin/ksh /etc/shells
/bin/ksh
[ritz.1133] $ file /bin/ksh
/bin/ksh: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), statically linked, for FreeBSD 11.3, FreeBSD-style, stripped
This is not at variance with the reasons given for what t
hey say (shell may not be available if /usr not mounted), because a statically linked binary in the root has no dependencies.
The pdksh port has an option for static linking. The "make install" goes into the /usr/local prefix. I copy the binary manually to the root, and manually modify /etc/shells.
I accept that I have to maintain it manually. I keep abreast of both pdksh shell and libc patches (pdksh uses only one system library, libc, so it's not hard to keep watch).
All my FreeBSD systems have been like that since 1997, to no ill-effect.