/bin/sh .vs. /sbin/sh

/bin/sh .vs. /sbin/sh

Post by Ed Fran » Fri, 19 Apr 2002 05:34:13



What is the difference between these two shells?  The manpage only
speaks to /bin/sh.  But, the executables are sizeably different.
On my Solaris 8 server, they look like this:

saturn[1]% ls -la /bin/sh
-r-xr-xr-x   4 root     root       95316 Mar 19 15:25 /bin/sh
saturn[2]% ls -la /sbin/sh
-r-xr-xr-x   2 root     root      286884 Mar 19 15:25 /sbin/sh

Any ideas?  Someone from Sun?

ed

 
 
 

/bin/sh .vs. /sbin/sh

Post by Dragan Cvetkovi » Fri, 19 Apr 2002 06:00:55



> What is the difference between these two shells?  The manpage only
> speaks to /bin/sh.  But, the executables are sizeably different.
> On my Solaris 8 server, they look like this:

> saturn[1]% ls -la /bin/sh
> -r-xr-xr-x   4 root     root       95316 Mar 19 15:25 /bin/sh
> saturn[2]% ls -la /sbin/sh
> -r-xr-xr-x   2 root     root      286884 Mar 19 15:25 /sbin/sh

On my system (and everywhere else, I assume):
$ file /bin/sh /sbin/sh
/bin/sh:        ELF 32-bit MSB executable SPARC Version 1, dynamically linked, stripped
/sbin/sh:       ELF 32-bit MSB executable SPARC Version 1, statically linked, stripped

HTH, Dragan

--
Dragan Cvetkovic,

To be or not to be is true. G. Boole
No it isn't.  L. E. J. Brouwer

 
 
 

/bin/sh .vs. /sbin/sh

Post by Andrew Gabri » Fri, 19 Apr 2002 06:10:00




Quote:> What is the difference between these two shells?  The manpage only
> speaks to /bin/sh.  But, the executables are sizeably different.
> On my Solaris 8 server, they look like this:

> saturn[1]% ls -la /bin/sh
> -r-xr-xr-x   4 root     root       95316 Mar 19 15:25 /bin/sh
> saturn[2]% ls -la /sbin/sh
> -r-xr-xr-x   2 root     root      286884 Mar 19 15:25 /sbin/sh

> Any ideas?  Someone from Sun?

/sbin/sh is a static linked shell for use by root, so that
root can still login and repair the problem if something
happens to*up dynamic linking.

The file command will show you...
% file /bin/sh /sbin/sh
/bin/sh:        ELF 32-bit MSB executable SPARC Version 1, dynamically linked, stripped
/sbin/sh:       ELF 32-bit MSB executable SPARC Version 1, statically linked, stripped
%

--
Andrew Gabriel
Consultant Software Engineer

 
 
 

/bin/sh .vs. /sbin/sh

Post by Stuart Lamb » Fri, 19 Apr 2002 07:32:50



>/sbin/sh is a static linked shell for use by root, so that
>root can still login and repair the problem if something
>happens to*up dynamic linking.

Nice in theory, but you still need to have a number of tools statically
linked (or included in /sbin/sh) for this to work. Things like mv, cp,
ln, ls are all very useful; other programs (tar, gzip, etc.) are useful,
but you probably could live without them if you had to.

--
I'm waiting for tech support to call me back. I'm also waiting for the
second coming of Jesus. Wanna take bets on which happens first?

 
 
 

/bin/sh .vs. /sbin/sh

Post by Dave Uhrin » Fri, 19 Apr 2002 07:39:10



> Nice in theory, but you still need to have a number of tools
> statically linked (or included in /sbin/sh) for this to work. Things
> like mv, cp, ln, ls are all very useful; other programs (tar, gzip,
> etc.) are useful, but you probably could live without them if you had
> to.

Kind of hard to live without fsck, though, unless you use "logging":

/usr/sbin/fsck: ELF 32-bit LSB executable 80386 Version 1, dynamically
linked, stripped

and note where it is installed ;-)

My /usr directory is on the / partition for just this reason even
though I use the logging option to mount.

 
 
 

/bin/sh .vs. /sbin/sh

Post by Darren Dunha » Fri, 19 Apr 2002 08:44:07




>> Nice in theory, but you still need to have a number of tools
>> statically linked (or included in /sbin/sh) for this to work. Things
>> like mv, cp, ln, ls are all very useful; other programs (tar, gzip,
>> etc.) are useful, but you probably could live without them if you had
>> to.

There are a few in /usr/sbin/static.

Quote:> Kind of hard to live without fsck, though, unless you use "logging":
> /usr/sbin/fsck: ELF 32-bit LSB executable 80386 Version 1, dynamically
> linked, stripped
> and note where it is installed ;-)
> My /usr directory is on the / partition for just this reason even
> though I use the logging option to mount.

For what reason?  It seems to me that anything that would make it
unusable in the split /usr case would make it unusable in your case
too..

I am *not* arguing the merits of a combined /usr (I prefer it in fact),
just that I don't think the fact that fsck is on /usr is a big reason
for it.

--

Unix System Administrator                    Taos - The SysAdmin Company
Got some Dr Pepper?                           San Francisco, CA bay area
          < How are you gentlemen!! Take off every '.SIG'!! >

 
 
 

/bin/sh .vs. /sbin/sh

Post by Rich Tee » Fri, 19 Apr 2002 08:45:41




> >/sbin/sh is a static linked shell for use by root, so that
> >root can still login and repair the problem if something
> >happens to*up dynamic linking.

> Nice in theory, but you still need to have a number of tools statically
> linked (or included in /sbin/sh) for this to work. Things like mv, cp,
> ln, ls are all very useful; other programs (tar, gzip, etc.) are useful,
> but you probably could live without them if you had to.

Agreed; hence:


        .    ..   cp   ln   mv   rcp  tar

        /usr/sbin/static/cp:    ELF 32-bit MSB executable SPARC Version 1, statically linked, stripped
        /usr/sbin/static/ln:    ELF 32-bit MSB executable SPARC Version 1, statically linked, stripped
        /usr/sbin/static/mv:    ELF 32-bit MSB executable SPARC Version 1, statically linked, stripped
        /usr/sbin/static/rcp:   ELF 32-bit MSB executable SPARC Version 1, statically linked, stripped
        /usr/sbin/static/tar:   ELF 32-bit MSB executable SPARC Version 1, statically linked, stripped

(No, I don't know why /usr/sbin/static is under /usr, rather than being
called /sbin/static.  /sbin/static makes more sense to me, given that
some people like to have a separate /usr partition.)

--
Rich Teer

President,
Rite Online Inc.

Voice: +1 (250) 979-1638
URL: http://www.veryComputer.com/

 
 
 

/bin/sh .vs. /sbin/sh

Post by Akop Pogosia » Fri, 19 Apr 2002 08:54:03




>>/sbin/sh is a static linked shell for use by root, so that
>>root can still login and repair the problem if something
>>happens to*up dynamic linking.
> Nice in theory, but you still need to have a number of tools statically
> linked (or included in /sbin/sh) for this to work. Things like mv, cp,
> ln, ls are all very useful; other programs (tar, gzip, etc.) are useful,
> but you probably could live without them if you had to.

/usr/sbin/static includes staticly linked copies of cp, ln, mv, rcp,
tar. I am not sure why they didn't include there utilities there as well.

-akop

 
 
 

/bin/sh .vs. /sbin/sh

Post by Stuart Lamb » Fri, 19 Apr 2002 09:27:02


[on static tools]

Quote:>/usr/sbin/static includes staticly linked copies of cp, ln, mv, rcp,
>tar. I am not sure why they didn't include there utilities there as well.

You learn something new every day.

--
I'm waiting for tech support to call me back. I'm also waiting for the
second coming of Jesus. Wanna take bets on which happens first?

 
 
 

/bin/sh .vs. /sbin/sh

Post by aa » Fri, 19 Apr 2002 11:33:10




> >/sbin/sh is a static linked shell for use by root, so that
> >root can still login and repair the problem if something
> >happens to*up dynamic linking.

> Nice in theory, but you still need to have a number of tools statically
> linked (or included in /sbin/sh) for this to work. Things like mv, cp,
> ln, ls are all very useful; other programs (tar, gzip, etc.) are useful,
> but you probably could live without them if you had to.

There are additional tools in /usr/sbin/static (cp, ln, mv, rcp, tar)
assuming that package SUNWsutl is installed.

If not, there is enough in /sbin (namely mount) to be able to
mount /usr from somewhere else, including the network.

All these are useful in a disaster or admin error situations,
without having to resort to the trouble of locating a cdrom drive and the
Solaris bootable media.

 
 
 

/bin/sh .vs. /sbin/sh

Post by Dave Uhrin » Fri, 19 Apr 2002 13:20:09



> I am *not* arguing the merits of a combined /usr (I prefer it in
> fact), just that I don't think the fact that fsck is on /usr is a big
> reason for it.

There are a limited number of partitions available with a standard
filesystem.  Placing /usr onto the / partition makes room for /u03 or
whatever you wish to call your added partition.

If after a crash you can mount your / partition and cannot mount the
/usr partition because of uncorrectible errors then your system is
going to have to be fixed by booting from CDROM.  You may as well have
/usr on the / partition since your basic utilities are there, along
with their required libs.

 
 
 

/bin/sh .vs. /sbin/sh

Post by Casper H.S. Di » Fri, 19 Apr 2002 17:01:34



>For what reason?  It seems to me that anything that would make it
>unusable in the split /usr case would make it unusable in your case
>too..

If you merge / & /usr, the kernel can *always* mount it because it
can almost always mount root, even if, e.g., your device tree is hosed.

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

 
 
 

/bin/sh .vs. /sbin/sh

Post by Joerg Schilli » Fri, 19 Apr 2002 17:42:06






>    .    ..   cp   ln   mv   rcp  tar

>    /usr/sbin/static/cp:    ELF 32-bit MSB executable SPARC Version 1, statically linked, stripped
>    /usr/sbin/static/ln:    ELF 32-bit MSB executable SPARC Version 1, statically linked, stripped
>    /usr/sbin/static/mv:    ELF 32-bit MSB executable SPARC Version 1, statically linked, stripped
>    /usr/sbin/static/rcp:   ELF 32-bit MSB executable SPARC Version 1, statically linked, stripped
>    /usr/sbin/static/tar:   ELF 32-bit MSB executable SPARC Version 1, statically linked, stripped

>(No, I don't know why /usr/sbin/static is under /usr, rather than being
>called /sbin/static.  /sbin/static makes more sense to me, given that
>some people like to have a separate /usr partition.)

/sbin carries a mount binary, so there is no problem to acccess binaries
from /usr/sbin/stattic later....

What really is missing in /sbin is drvconfig and friends in order
to allow you to e.g. move a disk to a different machine where
the /devices tree would not look the same.

--



URL:  http://www.fokus.gmd.de/usr/schilling    ftp://ftp.fokus.gmd.de/pub/unix

 
 
 

/bin/sh .vs. /sbin/sh

Post by bit-buc.. » Fri, 19 Apr 2002 21:33:46



[...]

: (No, I don't know why /usr/sbin/static is under /usr, rather than being
: called /sbin/static.  /sbin/static makes more sense to me, given that
: some people like to have a separate /usr partition.)

Or better yet, just put them all in /sbin.

fpsm
--
| Fredrich P. Maney              my_last_name AT my_last_name DOT org |
|   Do NOT send me HTML formatted E-mail or copies of netnews posts!  |
|  Address in header is a spamtrap. Use one in signature for replies. |
|  Please review http://www.maney.org/fred/site/uce/ before emailing. |

 
 
 

/bin/sh .vs. /sbin/sh

Post by Darren Dunha » Sat, 20 Apr 2002 01:43:35




>> I am *not* arguing the merits of a combined /usr (I prefer it in
>> fact), just that I don't think the fact that fsck is on /usr is a big
>> reason for it.

> There are a limited number of partitions available with a standard
> filesystem.  Placing /usr onto the / partition makes room for /u03 or
> whatever you wish to call your added partition.

Of course.  I agree!! :-) I give! (really, I like comboroot).

Quote:> If after a crash you can mount your / partition and cannot mount the
> /usr partition because of uncorrectible errors then your system is
> going to have to be fixed by booting from CDROM.  You may as well have
> /usr on the / partition since your basic utilities are there, along
> with their required libs.

My thought was just that anything that was likely to corrupt /usr to the
point that you couldn't mount it read-only would likely have corrupted
your root filesystem to the same extent if they had been one big
filesystem.  In both cases it would have been "break out the CD" time.

--

Unix System Administrator                    Taos - The SysAdmin Company
Got some Dr Pepper?                           San Francisco, CA bay area
          < How are you gentlemen!! Take off every '.SIG'!! >

 
 
 

1. root's shell, /sbin/sh, /bin/sh and /usr/ksh

|Our users want to change the root shell to /bin/ksh.

On computers where a user who needs root access wants to use a
shell other than /sbin/sh, one option is to create another root
account with the desired shell.  For example (in the /etc/passwd
file, with corresponding entries in the /etc/shadow file):

root:x:0:1:Super-User:/:/sbin/sh
rootksh:x:0:1:Super-User:/:/usr/bin/ksh

But you do have to remember to change both root passwords when
you want to change the root password.

--
------------------------------------------------------------------------

Unsolicited bulk or commercial email is not welcome.             netcom.com
No warranty of any kind is provided with this message.

2. natd foro Solaris v2.6 X86

3. Any difference between /sbin/sh and /bin/sh?

4. ufsrestore + 4mm DDS = SLOW ! ???

5. diff /sbin/sh and /bin/sh?

6. GNUstep (make_services)

7. /sbin/sh and /bin/sh

8. 386 vs 686 rpms

9. difference between /bin/sh and /sbin/sh

10. /sbin/sh and /bin/sh

11. why /bin/sh and not /sbin/sh

12. /sbin/sh and /sbin/sh

13. #!/bin/sh #!/usr/bin/sh can I do both for 2 diff machines