[opensuse-factory] Leap 42.2 RC2 - should sh link to bash?
After installing RC2, I noticed something wrong in my org babel sh scripts; and looking into it further, I noticed: me@server:~/tmp> sh sh-4.3$ exit exit me@server:~/tmp> which sh /usr/bin/sh me@server:~/tmp> ls -l /usr/bin/sh lrwxrwxrwx 1 root root 9 Nov 5 11:49 /usr/bin/sh -> /bin/bash m Is sh supposed to just link to bash? Thanks, -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Sun, 6 Nov 2016 14:13:52 -0500 Milan Zimmermann <milan.zimmermann@gmail.com> wrote:
After installing RC2, I noticed something wrong in my org babel sh scripts; and looking into it further, I noticed:
me@server:~/tmp> sh sh-4.3$ exit exit me@server:~/tmp> which sh /usr/bin/sh me@server:~/tmp> ls -l /usr/bin/sh lrwxrwxrwx 1 root root 9 Nov 5 11:49 /usr/bin/sh -> /bin/bash m
Is sh supposed to just link to bash?
Thanks,
cat /etc/os-release NAME=openSUSE VERSION="13.2 (Harlequin)" ls -l /usr/bin/sh lrwxrwxrwx 1 root root 9 Nov 6 06:05 /usr/bin/sh -> /bin/bash It has been like this for a while. Peter -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Sunday 2016-11-06 20:34, Peter Linnell wrote:
After installing RC2, I noticed something wrong in my org babel sh scripts; and looking into it further, I noticed:
me@server:~/tmp> sh sh-4.3$ exit exit me@server:~/tmp> which sh /usr/bin/sh me@server:~/tmp> ls -l /usr/bin/sh lrwxrwxrwx 1 root root 9 Nov 5 11:49 /usr/bin/sh -> /bin/bash m
Is sh supposed to just link to bash?
The real requirement is that the "sh" command, when invoked, provides a shell that behaves like POSIX sh. bash seems to largely fulfill that role, but you can also override it point to dash - another implementation of a POSIX sh - instead. (But some additional measures would be needed to make that permanent.) -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Jan Engelhardt <jengelh@inai.de> wrote:
The real requirement is that the "sh" command, when invoked, provides a shell that behaves like POSIX sh. bash seems to largely fulfill that role, but you can also override it point to dash - another implementation of a POSIX sh - instead. (But some additional measures would be needed to make that permanent.)
The problem with using bash is that bash implements many ksh-isms that encourage people to write non-portable scripts. Another problem is that bash is one of the slowest shell implementations ever. The problem with dash is that it does not implement support for multi byte characters and thus would not permit a platform that uses dash as system shell to become POSIX certified for more that "embedded use". BTW: If someone did add multi-byte support to dash, dash would become even slower than bash. So selecting dash for performance reasons may become a bad idea in the future. If you are interestet, you may like to try out the most recent Bourne Shell (bosh). It is not yet (*) as fast as ksh93, but faster than dash and bosh implements multi-byte support. To make it behave as expected on Linux, it is recommended to be compiled with: smake 'CPPOPTX=-DPOSIX_BOSH_PATH=\"/bin/sh\"' in order to enforce "set -o posix" for /bin/sh. bosh has been successfully tested on Gentoo Linux and OpenSolaris. It replaced ksh93 as the system shell on SchilliX this summer. *) There is a planned rewrite for the "field separation" code that would make it 5-10% faster than ksh93. http://schilytools.sourceforge.net/bosh.html Jörg -- EMail:joerg@schily.net (home) Jörg Schilling D-13353 Berlin joerg.schilling@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.org/private/ http://sourceforge.net/projects/schilytools/files/' -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Sun, 2016-11-06 at 14:13 -0500, Milan Zimmermann wrote:
After installing RC2, I noticed something wrong in my org babel sh scripts; and looking into it further, I noticed:
/bin/sh as defined as being 'the system shell' - which, on openSUSE, has been bash for like ever. So, yes, that symlink is correct. Cheers, Dominique
Thanks Dominique. This is the comment I was looking for (that it is (or not) new that sh links to bash). I have been using variants of (Open)Suse for 10 years and never realized it was like that :( I need to look other places as a cause of my issue. On Sun, Nov 6, 2016 at 2:39 PM, Dominique Leuenberger / DimStar <dimstar@opensuse.org> wrote:
On Sun, 2016-11-06 at 14:13 -0500, Milan Zimmermann wrote:
After installing RC2, I noticed something wrong in my org babel sh scripts; and looking into it further, I noticed:
/bin/sh as defined as being 'the system shell' - which, on openSUSE, has been bash for like ever. So, yes, that symlink is correct.
Cheers, Dominique -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Am 06.11.2016 um 20:39 schrieb Dominique Leuenberger / DimStar:
On Sun, 2016-11-06 at 14:13 -0500, Milan Zimmermann wrote:
After installing RC2, I noticed something wrong in my org babel sh scripts; and looking into it further, I noticed:
/bin/sh as defined as being 'the system shell' - which, on openSUSE, has been bash for like ever. So, yes, that symlink is correct.
Do you recall why it is /bin/bash though? I stumbled across that usrmerge oddity during my mips cross-compilations. Shouldn't it be /usr/bin/bash with a /bin/bash symlink like most other tools? Then /usr/bin/sh could point to /usr/bin/bash. Cheers, Andreas -- SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On 11/08/2016 05:11 AM, Andreas Färber wrote:
Am 06.11.2016 um 20:39 schrieb Dominique Leuenberger / DimStar:
On Sun, 2016-11-06 at 14:13 -0500, Milan Zimmermann wrote:
After installing RC2, I noticed something wrong in my org babel sh scripts; and looking into it further, I noticed:
/bin/sh as defined as being 'the system shell' - which, on openSUSE, has been bash for like ever. So, yes, that symlink is correct.
Do you recall why it is /bin/bash though? I stumbled across that usrmerge oddity during my mips cross-compilations. Shouldn't it be /usr/bin/bash with a /bin/bash symlink like most other tools? Then /usr/bin/sh could point to /usr/bin/bash.
Cheers, Andreas
At a guess its been like that since a time when having /usr as a separate mount may have still been feasible and no one ever bothered changing it. -- Simon Lees (Simotek) http://simotek.net Emergency Update Team keybase.io/simotek SUSE Linux Adeliade Australia, UTC+9:30 GPG Fingerprint: 5B87 DB9D 88DC F606 E489 CEC5 0922 C246 02F0 014B
On 2016-11-07 22:43, Simon Lees wrote:
At a guess its been like that since a time when having /usr as a separate mount may have still been feasible and no one ever bothered changing it.
A separate /usr is still possible. I have it. -- Cheers / Saludos, Carlos E. R. (from 13.1 x86_64 "Bottle" at Telcontar)
On Mon, Nov 7, 2016 at 7:54 PM, Carlos E. R. <robin.listas@telefonica.net> wrote:
A separate /usr is still possible. I have it.
Yes.. the only requirement is that is is mounted by the initrd.. at the right time..otherwise it will appear as working..but it won't be. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On 11/08/2016 12:48 PM, Cristian Rodríguez wrote:
On Mon, Nov 7, 2016 at 7:54 PM, Carlos E. R. <robin.listas@telefonica.net> wrote:
A separate /usr is still possible. I have it.
Yes.. the only requirement is that is is mounted by the initrd.. at the right time..otherwise it will appear as working..but it won't be.
In the context of this discussion that means that its now fine to have bash in /usr/bin whereas in the past before the initrd requirement was mandatory it needed to still be in /bin -- Simon Lees (Simotek) http://simotek.net Emergency Update Team keybase.io/simotek SUSE Linux Adeliade Australia, UTC+9:30 GPG Fingerprint: 5B87 DB9D 88DC F606 E489 CEC5 0922 C246 02F0 014B
On 2016-11-08 03:22, Simon Lees wrote:
On 11/08/2016 12:48 PM, Cristian Rodríguez wrote:
On Mon, Nov 7, 2016 at 7:54 PM, Carlos E. R. <> wrote:
A separate /usr is still possible. I have it.
Yes.. the only requirement is that is is mounted by the initrd.. at the right time..otherwise it will appear as working..but it won't be.
In the context of this discussion that means that its now fine to have bash in /usr/bin whereas in the past before the initrd requirement was mandatory it needed to still be in /bin
Would it break scripts that secify #!/bin/bash? :-? Other things that expect /bin/bash without mounting /usr? -- Cheers / Saludos, Carlos E. R. (from 13.1 x86_64 "Bottle" at Telcontar)
On 11/08/2016 01:02 PM, Carlos E. R. wrote:
On 2016-11-08 03:22, Simon Lees wrote:
On 11/08/2016 12:48 PM, Cristian Rodríguez wrote:
On Mon, Nov 7, 2016 at 7:54 PM, Carlos E. R. <> wrote:
A separate /usr is still possible. I have it.
Yes.. the only requirement is that is is mounted by the initrd.. at the right time..otherwise it will appear as working..but it won't be.
In the context of this discussion that means that its now fine to have bash in /usr/bin whereas in the past before the initrd requirement was mandatory it needed to still be in /bin
Would it break scripts that secify #!/bin/bash? :-? Other things that expect /bin/bash without mounting /usr?
No because /bin/bash would still be a symlink to /usr/bin/bash. As far as i'm aware systemd in openSUSE expects /usr to be in the same partition as / (or mounted in initrd), So its unlikely anything still needs to handle them being separate because its not possible to have a openSUSE system setup like that. -- Simon Lees (Simotek) http://simotek.net Emergency Update Team keybase.io/simotek SUSE Linux Adeliade Australia, UTC+9:30 GPG Fingerprint: 5B87 DB9D 88DC F606 E489 CEC5 0922 C246 02F0 014B
Simon Lees wrote:
On 11/08/2016 12:48 PM, Cristian Rodríguez wrote:
On Mon, Nov 7, 2016 at 7:54 PM, Carlos E. R. <robin.listas@telefonica.net> wrote:
A separate /usr is still possible. I have it. Yes.. the only requirement is that is is mounted by the initrd.. at the right time..otherwise it will appear as working..but it won't be.
In the context of this discussion that means that its now fine to have bash in /usr/bin whereas in the past before the initrd requirement was mandatory it needed to still be in /bin
--- I'm not running initrd and still have separate root and /usr. In the past, system scripts have always been in /bin. Why not do away with "/usr/bin" and merge all to /bin? If you have an initrd and /usr won't mount for some reason, you have no way to recover. But if your recovery tools can run without /usr, you are good to go. I've had that config save my system more than once in the past... -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
"L.A. Walsh" <suse@tlinx.org> wrote:
I'm not running initrd and still have separate root and /usr. In the past, system scripts have always been in /bin. Why not do away with "/usr/bin" and merge all to /bin?
This has been changed in 1988 with SunOS-4.0 ;-) At that time /bin has become a symlink to /usr/bin. As a result, /sbin had to be created to hold the binaries that are needed to mount /usr. Jörg -- EMail:joerg@schily.net (home) Jörg Schilling D-13353 Berlin joerg.schilling@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.org/private/ http://sourceforge.net/projects/schilytools/files/' -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Joerg Schilling wrote: "L.A. Walsh" <suse@tlinx.org> wrote:
I'm not running initrd and still have separate root and /usr. In the past, system scripts have always been in /bin. Why not do away with "/usr/bin" and merge all to /bin?
This has been changed in 1988 with SunOS-4.0 ;-) At that time /bin has become a symlink to /usr/bin.
As a result, /sbin had to be created to hold the binaries that are needed to mount /usr.
Ahh yes... old SunOS... It seems that /bin was back shortly thereafter -- maybe in anticipation of Solaris, which replaced the older SunOS. I worked at Sun from 89-93... Cheers! -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
"Carlos E. R." <robin.listas@telefonica.net> wrote:
On 2016-11-07 22:43, Simon Lees wrote:
At a guess its been like that since a time when having /usr as a separate mount may have still been feasible and no one ever bothered changing it.
A separate /usr is still possible. I have it.
It would depend on the shell. With ksh93, it doesn't work as ksh93 depends on shared libraries that are in /usr. Jörg -- EMail:joerg@schily.net (home) Jörg Schilling D-13353 Berlin joerg.schilling@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.org/private/ http://sourceforge.net/projects/schilytools/files/' -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Joerg Schilling wrote:
"Carlos E. R." <robin.listas@telefonica.net> wrote:
A separate /usr is still possible. I have it.
It would depend on the shell. With ksh93, it doesn't work as ksh93 depends on shared libraries that are in /usr.
So? You think users are incapable of running a script that runs "ldd" over all binaries on the rootfs and ensures the latest needed libs in /lib64? If someone needed a perl script that checks for insecure symlinks (ones that point to "to-be-mounted", out-of-partition destinations) and un-symlinks them and ensures binaries only use libs on same-fs or a parent-fs, I might know where to find one. Hypothetically, such would be good to run before a reboot... -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Milan Zimmermann wrote:
After installing RC2, I noticed something wrong in my org babel sh scripts; and looking into it further, I noticed:
me@server:~/tmp> sh sh-4.3$ exit exit me@server:~/tmp> which sh /usr/bin/sh me@server:~/tmp> ls -l /usr/bin/sh lrwxrwxrwx 1 root root 9 Nov 5 11:49 /usr/bin/sh -> /bin/bash m
Is sh supposed to just link to bash?
it's been like that at least since 10.3 - # l /usr/bin/sh lrwxrwxrwx 1 root root 9 2008-03-29 16:07 /usr/bin/sh -> /bin/bash* -- Per Jessen, Zürich (3.9°C) http://www.dns24.ch/ - free dynamic DNS, made in Switzerland. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
participants (12)
-
Andreas Färber
-
Carlos E. R.
-
Cristian Rodríguez
-
Dominique Leuenberger / DimStar
-
Jan Engelhardt
-
Joerg Schilling
-
L.A. Walsh
-
Linda Walsh
-
Milan Zimmermann
-
Per Jessen
-
Peter Linnell
-
Simon Lees