/usr/ucb/shutdown vs. /usr/sbin/shutdown

/usr/ucb/shutdown vs. /usr/sbin/shutdown

Post by co.. » Sat, 13 Feb 1999 04:00:00



   O.K. - so whats the deal with that?

# uname -sr
SunOS 5.6

The following scenerio has been dramatized for USENET

   One does a 'shutdown -i 0 -y' and one recieves:

Usage: shutdown [ -krhfn ] shutdowntime  [ message ]

   So one scratches one's head and does a 'man shutdown', seeing:

SYNOPSIS
     /usr/sbin/shutdown [ -y ] [ -g grace-period ]
          [ -i init-state ] [ message ]

   "Perhaps I typo'd" one thinks to oneself and issues said
   shutdown command once again - and is once again greeted with:

Usage: shutdown [ -krhfn ] shutdowntime  [ message ]

   After many curses and much gnashing of teeth, one finally
   figures it out - there are *two* shutdowns, the one under
   /usr/ucb/ being first in one's path, while the one for
   which the man page is intended resides in /usr/sbin like
   any decent, self-respecting shutdown command would.

   SO ...

   Just what *is* the logic behind this tom-foolery, anyhow?

   I'd appreciate any enlightenment any kind soul out there
   could provide for me.

Beers,

Corey

--

      "Windows was created to keep the stupid people away from Unix.
      An "MS advocate" is therefore already beneath contempt."
                -- Tom Christiansen

 
 
 

/usr/ucb/shutdown vs. /usr/sbin/shutdown

Post by Timothy J. L » Sat, 13 Feb 1999 04:00:00


|   After many curses and much gnashing of teeth, one finally
|   figures it out - there are *two* shutdowns, the one under
|   /usr/ucb/ being first in one's path, while the one for
|   which the man page is intended resides in /usr/sbin like
|   any decent, self-respecting shutdown command would.
|
|   SO ...
|
|   Just what *is* the logic behind this tom-foolery, anyhow?
|
|   I'd appreciate any enlightenment any kind soul out there
|   could provide for me.

Use "man -s1b shutdown" to get the man page on the /usr/ucb
version.  The 1b section of the manual describes the BSD
compatibility commands in /usr/ucb .

It is probably not a good idea to put /usr/ucb in your PATH
before /usr/bin and /usr/sbin on Solaris, since some scripts
and other programs may assume "System V" behavior of certain
commands.  Using aliases or some such to use the BSD versions
of programs like df or ps would be safer.

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

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

 
 
 

/usr/ucb/shutdown vs. /usr/sbin/shutdown

Post by hume.spamfil.. » Sat, 13 Feb 1999 04:00:00


:    One does a 'shutdown -i 0 -y' and one recieves:
: Usage: shutdown [ -krhfn ] shutdowntime  [ message ]

You're running /usr/ucb/shutdown with the arguments for /usr/sbin/shutdown.
(As you already noticed.  :) )

/usr/ucb exists for backwards compatibility.  Any or all of it could go
away at any time, so don't get used to any of the stuff in there.  I find
it generally causes more trouble than its worth anyways.  You might want
to take /usr/ucb out of your PATH altogether.

:       "Windows was created to keep the stupid people away from Unix.
:       An "MS advocate" is therefore already beneath contempt."
:                 -- Tom Christiansen

Hee!

--
Brandon Hume    - hume -> bofh.halifax.ns.ca, http://www.bofh.halifax.ns.ca/

 
 
 

/usr/ucb/shutdown vs. /usr/sbin/shutdown

Post by co.. » Sun, 14 Feb 1999 04:00:00




<snip>
>|   SO ...
>|
>|   Just what *is* the logic behind this tom-foolery, anyhow?
>|
>|   I'd appreciate any enlightenment any kind soul out there
>|   could provide for me.

>Use "man -s1b shutdown" to get the man page on the /usr/ucb
>version.  The 1b section of the manual describes the BSD
>compatibility commands in /usr/ucb .

   Cool, thanks - I was totally unaware of that section of
   the man pages ...  where do I find info regarding what
   sub-sections are for what?  Looking in /usr/share/man
   I see quite a few instances of the same section numbers
   w/ different letters appended - for example, for man1,
   aside from 1b, there is 1c, 1m, etc .  I haven't been
   particularly successfull in locating the docs for this
   at docs.sun.com.

Beers,

Corey

--

   "Give me a cold beer, a hot woman and a computer with linux on it,
   and you can keep the beer and the chick."
       -- seen on USENET

 
 
 

/usr/ucb/shutdown vs. /usr/sbin/shutdown

Post by co.. » Sun, 14 Feb 1999 04:00:00




<snippity-snip>

>/usr/ucb exists for backwards compatibility.  Any or all of it could go
>away at any time, so don't get used to any of the stuff in there.  I find
>it generally causes more trouble than its worth anyways.  You might want
>to take /usr/ucb out of your PATH altogether.

   THanks for the heads-up, I intend to do just that - I have
   no clue why /usr/ucb was placed ahead of /usr/sbin for
   root's path anyhow ... must've been the previous admin.

Beers,

Corey

--

  "Give me a cold beer, a hot woman and a computer with linux on it,
   and you can keep the beer and the chick."
       -- seen on USENET

 
 
 

/usr/ucb/shutdown vs. /usr/sbin/shutdown

Post by Timothy J. L » Sun, 14 Feb 1999 04:00:00



|<snip>
|>|   SO ...
|>|
|>|   Just what *is* the logic behind this tom-foolery, anyhow?
|>|
|>|   I'd appreciate any enlightenment any kind soul out there
|>|   could provide for me.
|>
|>Use "man -s1b shutdown" to get the man page on the /usr/ucb
|>version.  The 1b section of the manual describes the BSD
|>compatibility commands in /usr/ucb .
|>
|
|   Cool, thanks - I was totally unaware of that section of
|   the man pages ...  where do I find info regarding what
|   sub-sections are for what?

"man intro" tells you about what the various 1 sections like
1b, 1c, 1f, 1s, and 1m are for.

"man -s3 intro" tells you about the various 3 sections (3b, 3c,
etc.).

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

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

 
 
 

/usr/ucb/shutdown vs. /usr/sbin/shutdown

Post by Reinier Pos » Tue, 16 Feb 1999 04:00:00



>   THanks for the heads-up, I intend to do just that - I have
>   no clue why /usr/ucb was placed ahead of /usr/sbin for
>   root's path anyhow ... must've been the previous admin.

/usr/ucb is part of the effort to ease the SunOS 4->5 transition.
Avoid if possible.

--
Reinier Post

 
 
 

/usr/ucb/shutdown vs. /usr/sbin/shutdown

Post by Roger Marqui » Tue, 16 Feb 1999 04:00:00



>   THanks for the heads-up, I intend to do just that - I have
>   no clue why /usr/ucb was placed ahead of /usr/sbin for
>   root's path anyhow ... must've been the previous admin.

We always put /usr/ucb at the beginning of the path 1) for
compatibility with BSD Unix (Linux, FreeBSD, SunOS, etc.) in a
heterogenous environment, 2) the BSD variants of many popular tools
(chown, ps, df, ls, ...) are preferable to their SYSV alternatives
and 3) there are no alternatives for some utilities under /usr/ucb
(vipw, whoami, biff, ...)

--
Roger Marquis
Roble Systems Consulting
http://www.roble.com/

 
 
 

/usr/ucb/shutdown vs. /usr/sbin/shutdown

Post by Philip Bro » Tue, 16 Feb 1999 04:00:00




>>   THanks for the heads-up, I intend to do just that - I have
>>   no clue why /usr/ucb was placed ahead of /usr/sbin for
>>   root's path anyhow ... must've been the previous admin.

>We always put /usr/ucb at the beginning of the path 1) for
>compatibility with BSD Unix (Linux, FreeBSD, SunOS, etc.) in a
>heterogenous environment,

you're a CONSULTANT, and you do this? I really hope you are talking
about USER paths.

Quote:> 2) the BSD variants of many popular tools
>(chown, ps, df, ls, ...) are preferable to their SYSV alternatives
>and 3) there are no alternatives for some utilities under /usr/ucb
>(vipw, whoami, biff, ...)

- "usermod"
- "who am i", or "id"
- (depending on shell) "set mail=/var/mail/$USER"
  (or $LOGNAME, if you prefer)

Note to folks in general: If you want to use BSD so much, then stick to BSD
systems.  Otherwise, its a good idea to actually learn the system you are
using properly.

--
[trim the no-bots from my address to reply to me by email!]
 --------------------------------------------------
Secret nONsONaTIAL monologue...
H52QdPK4iQPijBgQeMKIUQOCjRg0IN6IYWMGhJszBevIARHGjBuLZTaKCZNx4x0xb0CsWYlQ
jpwxINDAPKMRBB0xYgiqEVMGj0qWbsIQnOMyD4g5ITcaBOGRDYg6C+OwWalAAQ

 
 
 

/usr/ucb/shutdown vs. /usr/sbin/shutdown

Post by hume.spamfil.. » Wed, 17 Feb 1999 04:00:00


: We always put /usr/ucb at the beginning of the path 1) for
: compatibility with BSD Unix (Linux, FreeBSD, SunOS, etc.) in a

Solaris is not Linux, FreeBSD or SunOS.  If you want the machines to behave
the same, use the same OS.

: heterogenous environment, 2) the BSD variants of many popular tools
: (chown, ps, df, ls, ...) are preferable to their SYSV alternatives

Preferable by whose measure?  Even the commands you mention... the differences
between them and the "proper" SYSV versions are so slight as to be called
piddling.  Certainly not enough to elevate them to "preferable".

: and 3) there are no alternatives for some utilities under /usr/ucb
: (vipw, whoami, biff, ...)

Somebody else already pointed out the "alternatives" for these commands.

Honestly, if you're going to use different OSes, learn to deal with the
differences.  I've never seen the useability or integrity of a Solaris box
so compromised as when someone tries to turn it into a Linux box.

--
Brandon Hume    - hume -> bofh.halifax.ns.ca, http://www.bofh.halifax.ns.ca/

 
 
 

/usr/ucb/shutdown vs. /usr/sbin/shutdown

Post by Casper H.S. Dik - Network Security Engine » Wed, 17 Feb 1999 04:00:00


[[ PLEASE DON'T SEND ME EMAIL COPIES OF POSTINGS ]]


>: and 3) there are no alternatives for some utilities under /usr/ucb
>: (vipw, whoami, biff, ...)
>Somebody else already pointed out the "alternatives" for these commands.

And adding /usr/ucb to $PATH last helps there too.

Quote:>Honestly, if you're going to use different OSes, learn to deal with the
>differences.  I've never seen the useability or integrity of a Solaris box
>so compromised as when someone tries to turn it into a Linux box.

Hear, hear.

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.

 
 
 

/usr/ucb/shutdown vs. /usr/sbin/shutdown

Post by Thomas H Jones I » Wed, 17 Feb 1999 04:00:00





>>We always put /usr/ucb at the beginning of the path 1) for
>>compatibility with BSD Unix (Linux, FreeBSD, SunOS, etc.) in a
>>heterogenous environment,

>you're a CONSULTANT, and you do this? I really hope you are talking
>about USER paths.

heh... probably changes the root shell to a dynamically linked BASH.

-tom

 
 
 

/usr/ucb/shutdown vs. /usr/sbin/shutdown

Post by Thomas H Jones I » Wed, 17 Feb 1999 04:00:00





>: heterogenous environment, 2) the BSD variants of many popular tools
>: (chown, ps, df, ls, ...) are preferable to their SYSV alternatives

>Preferable by whose measure?  Even the commands you mention... the differences
>between them and the "proper" SYSV versions are so slight as to be called
>piddling.  Certainly not enough to elevate them to "preferable".

Most likely, they are 'preferable' because he doesnt have to learn/remember
the flag differences between bsd and sysv versions of the command.

Quote:>: and 3) there are no alternatives for some utilities under /usr/ucb
>: (vipw, whoami, biff, ...)

>Somebody else already pointed out the "alternatives" for these commands.

>Honestly, if you're going to use different OSes, learn to deal with the
>differences.  I've never seen the useability or integrity of a Solaris box
>so compromised as when someone tries to turn it into a Linux box.

not to mention that, if if the commands TRULY dont exist anywhere in the
SYSV system binaries directories (eg, /bin, /sbin), then having a path of
"/usr/sbin:/usr/bin:/usr/ucb" is still going to make them available. or, if
you only need certain of the /usr/ucb commands, add aliases in your profile.

-tom

 
 
 

/usr/ucb/shutdown vs. /usr/sbin/shutdown

Post by co.. » Wed, 17 Feb 1999 04:00:00






>>>We always put /usr/ucb at the beginning of the path 1) for
>>>compatibility with BSD Unix (Linux, FreeBSD, SunOS, etc.) in a
>>>heterogenous environment,

>>you're a CONSULTANT, and you do this? I really hope you are talking
>>about USER paths.

>heh... probably changes the root shell to a dynamically linked BASH.

Hah!

Jeeze, don't be so * the guy...

Maybe he changes the root sh to a *statically* linked bash.

Beers,

Corey

--

   "Ambition is a poor excuse for not having sense enough to be lazy."
        -- Charlie McCarthy

 
 
 

/usr/ucb/shutdown vs. /usr/sbin/shutdown

Post by R. Kneidinge » Thu, 18 Feb 1999 04:00:00







> >>>We always put /usr/ucb at the beginning of the path 1) for
> >>>compatibility with BSD Unix (Linux, FreeBSD, SunOS, etc.) in a
> >>>heterogenous environment,

> >>you're a CONSULTANT, and you do this? I really hope you are talking
> >>about USER paths.

> >heh... probably changes the root shell to a dynamically linked BASH.

> Hah!

> Jeeze, don't be so * the guy...

> Maybe he changes the root sh to a *statically* linked bash.

> Beers,

> Corey

> --

>    "Ambition is a poor excuse for not having sense enough to be lazy."
>         -- Charlie McCarthy

  I know, that Im making a fool out of myself, but I dont claim to be a
sysadmin. I just want to learn ! So please no harsh or rude comments, if
possible:

Whats wrong with a dynamically or statically linked bash as root shell ?
Please tell me, so maybe I can avoid some serious stupidities.

TIA,
Rudi

 
 
 

1. /usr/ucb/shutdown & Shutdown scripts

I have a Solaris 8 system, along with AIX & Linux systems.  I prefer to to
shut the system down with the '/usr/ucb/shutdown' command, because it uses
the same syntax as my other systems.  However, when I run 'shutdown -r
now', which reboots, the system does not execute the runlevel 0 scripts. I
assume this is because it is not running the /etc/rc6 script. However, the
/usr/ucb/ flavor of shutdown is supplied by Sun, so I would _hope_ that it
would simply enter runlevel 6 the same as a /usr/sbin/shutdown -i 6 would.
 Is this a known behavior, or do I have a problem?

2. WebTV

3. /usr/bin/ls /usr/ucb/ls /usr/local/bin/ls

4. Partition Quesion...

5. /usr/bin/mail vs. /usr/ucb/mail

6. Make and RCS

7. Odd behavior, /usr/bin/ps vs. /usr/ucb/ps

8. Monitor specs needed for old SGI monitor

9. /usr/ccs/bin/ld Vs. /usr/ucb/ld

10. /usr/sbin/traceroute ha1 ksh: /usr/sbin/traceroute: not found

11. /usr busy on shutdown; can't shutdown

12. allowing users to /usr/sbin/shutdown their machines

13. gnu vs xpg4 vs ucb vs /usr/bin