LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-31-2023, 06:47 AM   #1
a_biardi
LQ Newbie
 
Registered: Nov 2012
Distribution: Slackware
Posts: 9

Rep: Reputation: Disabled
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.
 
Old 03-31-2023, 06:58 AM   #2
LuckyCyborg
Senior Member
 
Registered: Mar 2010
Posts: 3,500

Rep: Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308
Quote:
Originally Posted by BDFL : Wed Dec 9 21:10:40 UTC 2020 on ChangeLog
I recommend *not* making /usr a separate partition
https://slackware.osuosl.org/slackwa.../ChangeLog.txt


Considering that you go against the BDFL's recommendations, I guess that the best is to make your own grep package, tuned as you like.

Last edited by LuckyCyborg; 03-31-2023 at 08:10 AM.
 
1 members found this post helpful.
Old 03-31-2023, 07:08 AM   #3
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,781

Rep: Reputation: 1459Reputation: 1459Reputation: 1459Reputation: 1459Reputation: 1459Reputation: 1459Reputation: 1459Reputation: 1459Reputation: 1459Reputation: 1459
Quote:
Originally Posted by a_biardi View Post
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.)
 
Old 03-31-2023, 07:12 AM   #4
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,354

Rep: Reputation: 4066Reputation: 4066Reputation: 4066Reputation: 4066Reputation: 4066Reputation: 4066Reputation: 4066Reputation: 4066Reputation: 4066Reputation: 4066Reputation: 4066
Quote:
Originally Posted by LuckyCyborg View Post
https://slackware.osuosl.org/slackwa.../ChangeLog.txt


Considering that you go against the BDFL's recommendations, I guess that the best is to make your own grep package, tuned as you like.
Dec 9 2020 ?
the -current changelog was reset on 2022-02-02, so I guess you meant
Code:
https://slackware.osuosl.org/slackware64-15.0/ChangeLog.txt
;-)
 
2 members found this post helpful.
Old 03-31-2023, 08:11 AM   #5
LuckyCyborg
Senior Member
 
Registered: Mar 2010
Posts: 3,500

Rep: Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308
Quote:
Originally Posted by marav View Post
Dec 9 2020 ?
the -current changelog was reset on 2022-02-02, so I guess you meant
Code:
https://slackware.osuosl.org/slackware64-15.0/ChangeLog.txt
;-)
Fixed! Thanks for correction!
 
Old 03-31-2023, 09:07 AM   #6
a_biardi
LQ Newbie
 
Registered: Nov 2012
Distribution: Slackware
Posts: 9

Original Poster
Rep: Reputation: Disabled
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?
 
Old 03-31-2023, 09:39 AM   #7
giomat
Member
 
Registered: Jul 2017
Posts: 337

Rep: Reputation: 238Reputation: 238Reputation: 238
Quote:
Originally Posted by a_biardi View Post
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.
 
Old 03-31-2023, 10:06 AM   #8
LuckyCyborg
Senior Member
 
Registered: Mar 2010
Posts: 3,500

Rep: Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308
Quote:
Originally Posted by giomat View Post
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.
 
1 members found this post helpful.
Old 03-31-2023, 10:45 AM   #9
giomat
Member
 
Registered: Jul 2017
Posts: 337

Rep: Reputation: 238Reputation: 238Reputation: 238
Quote:
Originally Posted by LuckyCyborg View Post
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
 
1 members found this post helpful.
Old 03-31-2023, 10:52 AM   #10
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,354

Rep: Reputation: 4066Reputation: 4066Reputation: 4066Reputation: 4066Reputation: 4066Reputation: 4066Reputation: 4066Reputation: 4066Reputation: 4066Reputation: 4066Reputation: 4066
Quote:
Originally Posted by giomat View Post
Yes, "almost" all major distros are doing it. I consider slackware a major distro despite the lower users number
The question is: what are the criteria that make a distro a major distro?

I think Slackware is an important distribution (age, philosophy, quality) in the Linux ecosystem, but I don't see how it is a "major" distribution

Last edited by marav; 03-31-2023 at 10:56 AM.
 
1 members found this post helpful.
Old 03-31-2023, 11:01 AM   #11
giomat
Member
 
Registered: Jul 2017
Posts: 337

Rep: Reputation: 238Reputation: 238Reputation: 238
I would say age, philosophy, quality and number of active users
 
1 members found this post helpful.
Old 03-31-2023, 11:05 AM   #12
LuckyCyborg
Senior Member
 
Registered: Mar 2010
Posts: 3,500

Rep: Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308
Quote:
Originally Posted by giomat View Post
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.
 
2 members found this post helpful.
Old 03-31-2023, 11:08 AM   #13
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,354

Rep: Reputation: 4066Reputation: 4066Reputation: 4066Reputation: 4066Reputation: 4066Reputation: 4066Reputation: 4066Reputation: 4066Reputation: 4066Reputation: 4066Reputation: 4066
Quote:
Originally Posted by LuckyCyborg View Post
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.
+ Arch
 
2 members found this post helpful.
Old 03-31-2023, 11:10 AM   #14
LuckyCyborg
Senior Member
 
Registered: Mar 2010
Posts: 3,500

Rep: Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308
Quote:
Originally Posted by marav View Post
+ Arch
And a special mention for Gentoo.
 
2 members found this post helpful.
Old 03-31-2023, 11:10 AM   #15
giomat
Member
 
Registered: Jul 2017
Posts: 337

Rep: Reputation: 238Reputation: 238Reputation: 238
Add Gentoo and my list is pretty much done
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error: Cannot find 'ssh-keygen' in '/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin' venu.navat Linux - Software 3 03-08-2012 04:00 AM
echo $PATH = /home/g3rc4n/bin:/usr/local/bin:/usr/bin:/bin:/usr/games ? i_heart_pandas Linux - Software 7 09-18-2009 08:33 AM
sudo /usr/bin/chroot /home/chroot /bin/su - xxx| /bin/su: user xxx does not exist saavik Linux - General 3 07-04-2007 10:30 AM
path in services wrong for clamav updated frm 0.75 to 0.80 usr/bin vs usr/local/bin Emmanuel_uk Linux - Newbie 3 04-22-2005 01:02 AM
/usr/bin/X11/ and /usr/X11R6/bin/ the same? linuxtesting2 Linux - Newbie 2 11-16-2004 10:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration