rc.0 cannot /usr/bin/grep (when /usr is a separate partition)
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
rc.0 cannot /usr/bin/grep (when /usr is a separate partition)
Hi there,
I know there's not a lot of people who still mount /usr on a separate partition...
anyway, for some reason yesterday I ended up configuring 15.0 on a server this way and found out that at shutdown rc.0 will happily unmount /usr and then (unsurprisingly) fail to find /usr/bin/grep.
Error is:
/etc/rc.d/rc.0: line 266: /usr/bin/grep: No such file or directory
Nothing major, as the system has mostly shut down anyway, but I think it might be best to have grep in /bin/ together with all the critical stuff.
it might be best to have grep in /bin/ together with all the critical stuff.
It's already there: /usr/bin/grep is only a symbolic link to the real /bin/grep.
The problem is that bash has a cache of full paths to executables. PATH is set to have /usr/bin before /bin, and the shell has already found grep in /usr/bin. So, it's hashed, and bash "knows" it's in /usr/bin. Maybe change /bin before /usr/bin in PATH in the beginning of rc.6. Or use /bin/grep instead of grep. ('hash -d grep' would be a bash-specific solution to make it forget the path.)
Okay, fair enough, I didn't know a separate /usr was frowned upon, and didn't notice that /usr/bin/grep is a symlink... but what's the reason for having /usr/bin/grep, really?
Okay, fair enough, I didn't know a separate /usr was frowned upon, and didn't notice that /usr/bin/grep is a symlink... but what's the reason for having /usr/bin/grep, really?
There is an effort by some major distributions to remove /bin and put everything under /usr.
It could be that some software is already looking for all utilities like grep under /usr, thus a symlink is required to not break new stuff.
There is an effort by some major distributions to remove /bin and put everything under /usr.
It could be that some software is already looking for all utilities like grep under /usr, thus a symlink is required to not break new stuff.
While I agree with your conclusion, I would like to note that that "merged /usr" was not adopted today only by "some major distributions" but by all other major distributions, excluding Slackware of course.
So, it's not excluded to see even more and more scripts showing "#!/usr/bin/bash" .
Meanwhile, looks like some Slackers still struggle with the ancient "separate /usr" ...
Last edited by LuckyCyborg; 03-31-2023 at 10:10 AM.
While I agree with your conclusion, I would like to note that that "merged /usr" was not adopted today only by "some major distributions" but by all other major distributions, excluding Slackware of course.
...
Yes, "almost" all major distros are doing it. I consider slackware a major distro despite the lower users number
I would say age, philosophy, quality and number of active users
After your rules, if all conditions should be meet, the major distributions today are: RedHat (with its derivatives), Ubuntu (with its derivatives), openSUSE and Debian.
Last edited by LuckyCyborg; 03-31-2023 at 11:07 AM.
After your rules, if all conditions should be meet, the major distributions today are: RedHat (with its derivatives), Ubuntu (with its derivatives), openSUSE and Debian.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.