Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Apr 2008 22:14:39 +0200
From:      Roland Smith <rsmith@xs4all.nl>
To:        Shelby Cain <scain@exgenesis.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Invoking ldconfig without arguments wipes all hints and makes me very sad
Message-ID:  <20080410201439.GA45576@slackbox.xs4all.nl>
In-Reply-To: <1207855812.11735.39.camel@localhost>
References:  <1207855812.11735.39.camel@localhost>

next in thread | previous in thread | raw e-mail | index | archive | help

--sm4nu43k4a2Rpi4c
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Apr 10, 2008 at 02:30:12PM -0500, Shelby Cain wrote:
> Greetings list.  I'm a new user to FreeBSD and I just managed to
> introduce myself to ldconfig's default behavior.  I'm currently locked
> out of my remote server since bash isn't statically compiled and will
> have to get physical access to correct my blunder.  :(

It is unwise to use a port as a root shell. What if /usr or /usr/local is o=
n a
separate partition which isn't mounted in single user mode?

Do you know that there are a lot of statically linked binaries available
in /rescue just for this eventuality? And that there are two shells
amongst them; (t)csh and sh?
=20
> As a new user to FreeBSD, ldconfig's default behavior makes about as
> much sense to me as rm adding "-fr ~" or kill adding "-9 1" in the
> absence of arguments.  I hate to sound ignorant but I have to ask, is
> there any particular reason FreeBSD's ldconfig defaults to this
> seemingly unintuitive and non-newbie-safe behavior?
>=20
> Would a patch that changes the behavior of ldconfig to assume -r in the
> absence of command line arguments and adds a new parameter like
> -e[rase]|-d[estroy]|-w[ipe]|-z[ap]|-l[olnewbie] to enable the original
> behavior be likely to gain any acceptance?

Can you specify what exactly you mean?

Calling ldconfig without arguments doesn't do anything to the hints
file:

slackbox# ll /var/run/ld-elf.so.hints
-r--r--r--  1 root  wheel  287 Apr  8 19:40 /var/run/ld-elf.so.hints
slackbox# cp /var/run/ld-elf.so.hints /var/run/ld-elf.so.hints.orig
slackbox# ldconfig
slackbox# ll /var/run/ld-elf.so.hints
-r--r--r--  1 root  wheel  287 Apr 10 22:03 /var/run/ld-elf.so.hints
slackbox# diff -u /var/run/ld-elf.so.hints.orig /var/run/ld-elf.so.hints
slackbox#=20

So there was no change to the file.

Did you perchance delete the hints file, or unmounted the filesystem
where /var is located?

Roland
--=20
R.F.Smith                                   http://www.xs4all.nl/~rsmith/
[plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
pgp: 1A2B 477F 9970 BA3C 2914  B7CE 1277 EFB0 C321 A725 (KeyID: C321A725)

--sm4nu43k4a2Rpi4c
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.8 (FreeBSD)

iEYEARECAAYFAkf+dS8ACgkQEnfvsMMhpyVvmACeNmunkmeRtqOEs/Xa3qLJvJZe
sEYAn1x1vp7ST3dygQVvj38V1GLCZoJj
=T8RQ
-----END PGP SIGNATURE-----

--sm4nu43k4a2Rpi4c--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080410201439.GA45576>