 |
|
 |
|
|
 |
Why /bin/ps and /usr/ucb/ps? |
 |
 |
|
|
09-10-04 10:54 PM
Just curious what the stuff under /usr/ucb is for? I was looking at
the ps utility and apparently they are the same fiel in 2 different
places:
db-0204:/bin #ls -ld ps
-r-xr-xr-x 45 root bin 5424 Aug 7 2003 ps
db-0204:/bin #ls -l /usr/ucb/ps
-r-xr-xr-x 45 root bin 5424 Aug 7 2003 /usr/ucb/ps
db-0204:/bin #ldd /bin/ps
libc.so.1 => /lib/libc.so.1
libdl.so.1 => /lib/libdl.so.1
/usr/platform/SUNW,Ultra-Enterprise/lib/libc_psr.so.1
db-0204:/bin #ldd /usr/ucb/ps
libc.so.1 => /lib/libc.so.1
libdl.so.1 => /lib/libdl.so.1
/usr/platform/SUNW,Ultra-Enterprise/lib/libc_psr.so.1
Thanks for any info,
CC
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Why /bin/ps and /usr/ucb/ps? |
 |
 |
|
|
09-10-04 10:54 PM
rhugga@yahoo.com (Keg) writes in comp.sys.sun.admin:
|Just curious what the stuff under /usr/ucb is for? I was looking at
|the ps utility and apparently they are the same fiel in 2 different
|places:
For users and scripts that expect the BSD style options, in cases such
as ps & ls where they are incompatible with the SvsV options found in
the /usr/bin versions.
--
________________________________________
________________________________
Alan Coopersmith * alanc@alum.calberkeley.org * Alan.Coopersmith@Sun.COM
http://www.csua.berkeley.edu/~alanc/ * http://blogs.sun.com/alanc/
Working for, but definitely not speaking for, Sun Microsystems, Inc.
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Why /bin/ps and /usr/ucb/ps? |
 |
 |
|
|
09-10-04 10:54 PM
Alan Coopersmith wrote:
> rhugga@yahoo.com (Keg) writes in comp.sys.sun.admin: |Just curious
> what the stuff under /usr/ucb is for? I was looking at |the ps
> utility and apparently they are the same fiel in 2 different |places:
>
>
> For users and scripts that expect the BSD style options, in cases
> such as ps & ls where they are incompatible with the SvsV options
> found in the /usr/bin versions.
>
And in fact the're not "the same file in 2 different places". See the
link count on that file?
$ ls -ld ps
-r-xr-xr-x 45 root bin 5424 Aug 7 2003 ps
^^
It's the same file in 45 different places. /usr/bin/ps (and gcore, and
pmap, and nohup, and 40-odd more) are in fact hardlinks. The file is
"really" /usr/lib/isaexec (inasmuch as there's any "really" with hard
links). isaexec is a sort of wrapper, which will run a 32 bit version
of a program (which lives in /usr/bin/sparcv7 ) or a 64 bit version
(which lives in /usr/bin/sparcv9) depending on which OS you're running .
If you compare the ps and UCB ps commands that are *really* run, you'll
see they are different:
$ ls -l /usr/bin/sparcv9/ps /usr/ucb/sparcv9/ps
-r-xr-xr-x 1 root bin 38464 Jan 18 2003 /usr/bin/sparcv9/ps
-r-sr-xr-x 1 root sys 28592 Jan 18 2003 /usr/ucb/sparcv9/ps
--
Tony
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Why /bin/ps and /usr/ucb/ps? |
 |
 |
|
|
09-10-04 10:54 PM
Alan Coopersmith <alanc@alum.calberkeley.org> wrote:
> rhugga@yahoo.com (Keg) writes in comp.sys.sun.admin:
> |Just curious what the stuff under /usr/ucb is for? I was looking at
> |the ps utility and apparently they are the same fiel in 2 different
> |places:
> For users and scripts that expect the BSD style options, in cases such
> as ps & ls where they are incompatible with the SvsV options found in
> the /usr/bin versions.
It's there for historical reasons. SunOS 4.x was based on BSD unix.
Solaris 2.x (= SunOS 5.x) was based on SYSV, with a bunch of commands
having different syntax and behavior. To ease the transition, the
/usr/ucb directory was created to hold the incompatible BSD versions.
People who really wanted BSD could put /usr/ucb before /usr in their
PATH.
--
* Patrick L. Nolan *
* W. W. Hansen Experimental Physics Laboratory (HEPL) *
* Stanford university *
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Why /bin/ps and /usr/ucb/ps? |
 |
 |
|
|
09-10-04 10:54 PM
In article <chsp6u$d0d$1@news.Stanford.EDU>,
"Patrick L. Nolan" <pln@cosmic.stanford.edu> writes:
|> Alan Coopersmith <alanc@alum.calberkeley.org> wrote:
|> > rhugga@yahoo.com (Keg) writes in comp.sys.sun.admin:
|> > |Just curious what the stuff under /usr/ucb is for? I was looking at
|> > |the ps utility and apparently they are the same fiel in 2 different
|> > |places:
|>
|> > For users and scripts that expect the BSD style options, in cases such
|> > as ps & ls where they are incompatible with the SvsV options found in
|> > the /usr/bin versions.
|>
|> It's there for historical reasons. SunOS 4.x was based on BSD unix.
|> Solaris 2.x (= SunOS 5.x) was based on SYSV, with a bunch of commands
|> having different syntax and behavior. To ease the transition, the
|> /usr/ucb directory was created to hold the incompatible BSD versions.
|> People who really wanted BSD could put /usr/ucb before /usr in their
|> PATH.
Related note: with Solaris 1 ps could read core files, now it can't,
and with Solaris 9 there is no longer a crash command to see the
process table from a core file. After much frustration with mdb, can
someone tell me and easy way to print the entire process table from a
core dump?
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Why /bin/ps and /usr/ucb/ps? |
 |
 |
|
|
09-10-04 10:54 PM
"Patrick L. Nolan" <pln@cosmic.stanford.edu> wrote in message news:<chsp6u$d0d$1@news.Stanfo
rd.EDU>...
> Alan Coopersmith <alanc@alum.calberkeley.org> wrote:
>
>
> It's there for historical reasons. SunOS 4.x was based on BSD unix.
> Solaris 2.x (= SunOS 5.x) was based on SYSV, with a bunch of commands
> having different syntax and behavior. To ease the transition, the
> /usr/ucb directory was created to hold the incompatible BSD versions.
> People who really wanted BSD could put /usr/ucb before /usr in their
> PATH.
Oh thanks all. That is good info to know. I didn't start using Solaris
until version 2.4. I knew that directory was there I just never
bothered to inquire what is was for before until I needed to use
something in their the other day.
Thanks,
CC
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Why /bin/ps and /usr/ucb/ps? |
 |
 |
|
|
09-11-04 07:49 AM
Keith Michaels <krm@sdc.cs.boeing.com> wrote:
> Related note: with Solaris 1 ps could read core files, now it can't,
> and with Solaris 9 there is no longer a crash command to see the
> process table from a core file. After much frustration with mdb, can
> someone tell me and easy way to print the entire process table from a
> core dump?
# mdb -k
Loading modules: [ unix krtld genunix specfs dtrace ufs sd md isp ip sctp s1394 usba nca
crypto random lofs nfs sppp ipc ptm logindmux ]
> ::ps
S PID PPID PGID SID UID FLAGS ADDR NAME
R 0 0 0 0 0 0x00000001 00000000018347c0 sched
R 3 0 0 0 0 0x00020001 000003000034baf0 fsflush
R 2 0 0 0 0 0x00020001 000003000034c6b8 pageout
R 1 0 0 0 0 0x42004000 000003000034d280 init
R 24309 23700 24309 24309 138953 0x42014000 000003000f8a44e8 bash
[...]
That's on the live system - from a crash dump is exactly the same process,
just pass it to the name of the dump.
::dcmds within mdb will give you a list of all of the valid commands.
Scott
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Why /bin/ps and /usr/ucb/ps? |
 |
 |
|
|
09-11-04 07:49 AM
On 2004-09-10, Patrick L. Nolan <pln@cosmic.stanford.edu> wrote:
> It's there for historical reasons. SunOS 4.x was based on BSD unix.
> Solaris 2.x (= SunOS 5.x) was based on SYSV, with a bunch of commands
> having different syntax and behavior. To ease the transition, the
> /usr/ucb directory was created to hold the incompatible BSD versions.
But /usr/ucb was also in SunOS 4.1.3, wasn't it? Does that predate the
plan to go to SysVish Solaris(2)?
--
Paul Kimoto
This message was originally posted on Usenet in plain text. Any images,
hyperlinks, or the like shown here have been added without my consent,
and may be a violation of international copyright law.
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Why /bin/ps and /usr/ucb/ps? |
 |
 |
|
|
09-11-04 12:49 PM
krm@sdc.cs.boeing.com (Keith Michaels) writes:
>Related note: with Solaris 1 ps could read core files, now it can't,
>and with Solaris 9 there is no longer a crash command to see the
>process table from a core file. After much frustration with mdb, can
>someone tell me and easy way to print the entire process table from a
>core dump?
In SunOS 4.1.x and before ps worked by ploughing through kernel
memory so "extending" it to read core files was a no-brainer.
It's also why "ps" stopped working after you installed a new /vmunix
and didn't reboot immediately.
::ps doesn't work for you in mdb?
Casper
[ Post a follow-up to this message ]
|
|
|
 |
|
|
|
|
Sponsored Links |
 |
 |
|
|
 |
All times are GMT. The time now is 07:22 AM. |
 |
|
|
 |
|
 |
|
|
 |
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
|
|
|
|
|
 |
|
 |
|