Date: Wed, 16 Sep 2020 20:42:14 +0000 From: Brooks Davis <brooks@freebsd.org> To: freebsd-arch@freebsd.org Subject: Appropriate path for mount/fsck sub-programs? Message-ID: <20200916204214.GA87473@spindle.one-eyed-alien.net>
next in thread | raw e-mail | index | archive | help
--opJtzjQTFsWo+cga Content-Type: text/plain; charset=us-ascii Content-Disposition: inline The mount and fsck commands have the ability to exec a mount_<fs> or fsck_<fs> program to do the actual work. Currently they do this with: execvP(execname, _PATH_SYSPATH, argv); Where _PATH_SYSPATH is "/sbin:/usr/sbin" unless RESCUE is defined in which case it's "/rescue:/sbin:/usr/sbin". This isn't very friendly to filesystems in ports and results in things like sysutils/e2fsprogs adding a link to /sbin. I think the path should be expanded to include /usr/local/sbin at a minimum. If it wasn't for the /rescue hack I'd be tempted to suggest just switching to `execvp` and using PATH. I see a few options (semi-sorted by level of change): 0) Do nothing 1a) Add /usr/local/sbin to _PATH_SYSPATH (it's only used in mount and fsck). 1b) The same, but a new variable. 2) Switch to _PATH_DEFPATH (that also add .../bin directories). 3) Use PATH, optionally prepending /rescue 4) Use exevp and teach crunched_main.c to prepend /rescue to PATH. I'd like opinions on what people think makes sense here. I think (0) aligns poorly with current project directions, but how far to go is a question to answer before implementing something. -- Brooks --opJtzjQTFsWo+cga Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJfYnimAAoJEKzQXbSebgfAHWsH/1PX98wE0LCZJWLuV8Xu6Afm F4Lr8vH9gtvaLvjNgrNswBMun5NbbtYeiEqeLTI+3psJ3v3DbpGwQtcU6VtD/SQp 3VY6W+CZfb2WYc+Y3pkp+SQp9rEFJL1CjUBM056Ytk/nXgtViRYIaGLum9/RFCrR El4mn48MHr/Xh+7HaSh8lyk+Oo+5XERnMynHK3cM0dFjybXkRaKd8jzxEA5Esd82 Z+EKtlMrqa6wSv1KZpVM4CFCkH3f5XcjWe1KzfRq/cRAj7xkQixrhKzLTWgVI5YT 8N9pW/j91XB1wFzCy29Kw1kbjljWEvT76SwqiH8WYH/bk7nIybORi18brY+mNx8= =Q4QX -----END PGP SIGNATURE----- --opJtzjQTFsWo+cga--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200916204214.GA87473>