POV-Ray : Newsgroups : povray.macintosh : UNIX Ignorance Server Time
28 Mar 2024 17:27:03 EDT (-0400)
  UNIX Ignorance (Message 1 to 8 of 8)  
From: Russell Towle
Subject: UNIX Ignorance
Date: 26 Apr 2006 19:45:00
Message: <web.445005d4ae6f0d6539b2bf190@news.povray.org>
Ok, well, I can say this: UNIX POV works great on the Mac, and if one uses X
Windows (Apple's X11.app), one can settle into a routine of render, modify
scene file, change resolution if necessary, re-render, just as one usually
does, and it seems easy enough.

It is not nearly as nice as the Mac GUI versions, Official or MegaPov.

Still, I was beginning to congratulate myself for being a studly geek, or
something along those lines, when I finally discovered the "usr" folder on
my iMac.

And I must say I am more than a little peeved that I was not relieved of my
ignorance in the Mac-specific install documents which came bundled with the
UNIX version. They were full of talk about installing POV in the "usr"
folder but never once mentioned that, on the Mac, this folder is invisible
to the Finder!

Hence, I thought, "Oh well, they must mean my "Users" folder, and they must
mean I should install somewhere in my Home folder, in my Users folder."

Wrong!

Also, the UNIX version, in its install instructions, recommends installing
as Root. Why? Why in the world invoke this horrific power? One can just as
easily install as the default Administrator.

But I say this, of course, being pretty darn ignorant of what UNIX is and
how it works.

Yeek.

RT


Post a reply to this message

From: Christian Walther
Subject: Re: UNIX Ignorance
Date: 27 Apr 2006 05:08:27
Message: <44508a0b$1@news.povray.org>
Russell Towle wrote:
> And I must say I am more than a little peeved that I was not relieved of my
> ignorance in the Mac-specific install documents which came bundled with the
> UNIX version. They were full of talk about installing POV in the "usr"
> folder but never once mentioned that, on the Mac, this folder is invisible
> to the Finder!

What Mac-specific documents are those? I can't find any Mac-specific 
documentation in the Unix source release.

> Also, the UNIX version, in its install instructions, recommends installing
> as Root. Why? Why in the world invoke this horrific power? One can just as
> easily install as the default Administrator.

Of course you can install into your own home folder without being root, 
but I assume we're talking about /usr/local here.

If you are really able to write in /usr as a non-root user, then 
something's seriously wrong. But I doubt that this is the case. When you 
try to copy something into a folder for which you don't have write 
permission using the Finder, it presents you an authentication panel, 
and providing your administrator password there effectively makes you 
root (for that single operation). That's why it works - you are not 
avoiding the "horrific power" of root.

The same thing happens when you install software using the Installer 
application, or when you say "sudo make install" on the command line 
(which is what you're supposed to do here - you can't use "su" on Mac OS 
X because you can't log in as root): by authenticating as an 
administrator, you give root privileges to the Installer or to the 
"make" utility, enabling it to install files in /usr or wherever it likes.

  -Christian


Post a reply to this message

From: nemesis
Subject: Re: UNIX Ignorance
Date: 27 Apr 2006 06:40:00
Message: <web.44509e85831086c7f2ff13290@news.povray.org>
"Russell Towle" <rto### [at] inreachcom> wrote:
> Ok, well, I can say this: UNIX POV works great on the Mac, and if one uses X
> Windows (Apple's X11.app), one can settle into a routine of render, modify
> scene file, change resolution if necessary, re-render, just as one usually
> does, and it seems easy enough.

well, while we're at it, be sure to edit with vim, ok? ;)

> It is not nearly as nice as the Mac GUI versions, Official or MegaPov.

i recognize a gluton for punishment when i see one... :)

> "usr"
> folder but never once mentioned that, on the Mac, this folder is invisible
> to the Finder!

don't use the Finder then.  Use a command-line shell like good ol' Unix
tradition demands.  Your geek points will raise as well... :)

> Hence, I thought, "Oh well, they must mean my "Users" folder, and they must
> mean I should install somewhere in my Home folder, in my Users folder."

The traditional Unix filesystem is like this:

/ -> root directory ("folder").  it is just used as a hub for the others and
many more can just easily be "plugged-in"
/bin -> essential binaries/executables
/lib -> essential libs
/usr/bin -> system-wide installable apps
/usr/lib -> system-wide installable libs
/usr/local -> this is generally reserved for people compiling their own
programs or libs
/home -> yep
/var -> program logs and other data dumped by programs go here
/etc -> configuration files for programs and more
/dev -> special files representing physical devices

so, when you install a program in Unix in the standard way, executables are
placed in /usr/bin, any shared libs it uses go to /usr/lib and system-wide
configuration go to /etc, while user specific generally go as a "hidden"
file in your user /home directory, like ~/.povray -- files beginning with a
dot are "hidden" in Unix, ie, they don't get listed by the default ls
command just when the -a flag is used.  Hidden files are just text files
and you can edit then by something like vim ~/.povray

> installing
> as Root. Why? Why in the world invoke this horrific power? One can just as
> easily install as the default Administrator.

root is the default "Administrator" in the Unix world.  The account you talk
about may have some of its power, but probably with a lesser privilege
level.  Enough to allow you to install to those directories...


Post a reply to this message

From: Russell Towle
Subject: Re: UNIX Ignorance
Date: 28 Apr 2006 01:05:00
Message: <web.4451a1e8831086c739b2bf190@news.povray.org>
Christian Walther <cwa### [at] gmxch> wrote:
> Russell Towle wrote:
his folder is invisible
> > to the Finder!
>
> What Mac-specific documents are those? I can't find any Mac-specific
> documentation in the Unix source release.

First, thanks for responding; second, you are right of course, there is
nothing Mac-specific. There is a moment of almost Mac-specific when the
configure script or whatever recognizes the i686.

Again, I am ignorant. Despite having gone to UNIX tutorial sites and looked
through and tried some examples.


> > Also, the UNIX version, in its install instructions, recommends installing
> > as Root. Why? Why in the world invoke this horrific power? One can just as
> > easily install as the default Administrator.
>
> Of course you can install into your own home folder without being root,
> but I assume we're talking about /usr/local here.

Forgive my ignorance and somewhat misplaced attemtp at humor. But to me,
when I tried to install the UNIX version, well, there was no "usr" folder.
That kind of threw me. Then at last I created a Root account, password, and
did it the way the Install instructions suggested. This led to problems, or
rather, what I perceived as problems: having to type in my password to run
POV, etc.


> If you are really able to write in /usr as a non-root user, then
> something's seriously wrong. But I doubt that this is the case. When you
> try to copy something into a folder for which you don't have write
> permission using the Finder, it presents you an authentication panel,
> and providing your administrator password there effectively makes you
> root (for that single operation). That's why it works - you are not
> avoiding the "horrific power" of root.


I am beginning to understand that there *is* a finely-tuned complex of
permissions.


> The same thing happens when you install software using the Installer
> application, or when you say "sudo make install" on the command line
> (which is what you're supposed to do here - you can't use "su" on Mac OS
> X because you can't log in as root): by authenticating as an
> administrator, you give root privileges to the Installer or to the
> "make" utility, enabling it to install files in /usr or wherever it likes.


Thank you so much, Christian, for helping me understand this.

Ultimately, when I finally installed successfully, I created a folder,
pasted its path into the install script, and skipped su or sudo or
anything, just make install, as I recall.

To me, though, it was shocking, and I had to laugh at myself, when I found
that the 'usr' folder which had caused me so much grief was there all
along!

Hmm. Not a studly geek after all.


Post a reply to this message

From: Russell Towle
Subject: Re: UNIX Ignorance
Date: 28 Apr 2006 01:10:01
Message: <web.4451a380831086c739b2bf190@news.povray.org>
> > It is not nearly as nice as the Mac GUI versions, Official or MegaPov.
>
> i recognize a gluton for punishment when i see one... :)

What? What? A GUI is "punishment"? I will take a moment and grok that.

All right, all right, yes, after a fashion, it is punishment.



> > "usr"
> > folder but never once mentioned that, on the Mac, this folder is invisible
> > to the Finder!
>
> don't use the Finder then.  Use a command-line shell like good ol' Unix
> tradition demands.  Your geek points will raise as well... :)


Hey I've been using a shell. But as I recall, when my geekiness reached a
certain pinnacle, and I typed "ls" into the command line and pressed enter,
I nver saw "usr". But if it is preceded by a period, even "ls" would not
show it, right?

> > Hence, I thought, "Oh well, they must mean my "Users" folder, and they must
> > mean I should install somewhere in my Home folder, in my Users folder."
>
> The traditional Unix filesystem is like this:
>
> / -> root directory ("folder").  it is just used as a hub for the others and


OK, Nemesis, please clarify: is "usr" typically the name of this root
folder, parent to all other directories?


>
> so, when you install a program in Unix in the standard way, executables are
> placed in /usr/bin, any shared libs it uses go to /usr/lib and system-wide
> configuration go to /etc, while user specific generally go as a "hidden"
> file in your user /home directory, like ~/.povray -- files beginning with a
> dot are "hidden" in Unix, ie, they don't get listed by the default ls
> command just when the -a flag is used.  Hidden files are just text files
> and you can edit then by something like vim ~/.povray

> > installing
> > as Root. Why? Why in the world invoke this horrific power? One can just as
> > easily install as the default Administrator.
>
> root is the default "Administrator" in the Unix world.  The account you talk
> about may have some of its power, but probably with a lesser privilege
> level.  Enough to allow you to install to those directories...


Well, in my ignorance, I have scouted around the internet, and I read one
convincing piece which said basically, don't do anything as Root if you can
avoid it. One could inadvertently do all kinds of terrible things.

Your remarks make things much clearer. Thank you!

RT


Post a reply to this message

From: PM 2Ring
Subject: Re: UNIX Ignorance
Date: 28 Apr 2006 02:00:05
Message: <web.4451ae57831086c776ba2c900@news.povray.org>
Hi Russell,

I use POV on Simply Mepis Linux, not a Mac. I think I made a few minor
mistakes when I installed POV (I was still very new to Linux), but it
functions ok. I've been using Linux for less than a year, so I'm no expert.
:)

Are you familiar with TLDP? Check out the home page for all the Linux
documentation you can eat, but for starters here's a good page on the Unix
file system, including a tree diagram you can print & stick on your wall:

http://www.tldp.org/LDP/intro-linux/html/sect_03_01.html

> Hey I've been using a shell. But as I recall, when my geekiness reached a
> certain pinnacle, and I typed "ls" into the command line and pressed enter,
> I nver saw "usr". But if it is preceded by a period, even "ls" would not
> show it, right?

Yes, you need to use ls -a to list hidden files & directories in the current
directory. And all hidden files have a period as the first character of
their name. But the system /usr directory shouldn't be hidden, AFAIK.

> > The traditional Unix filesystem is like this:
> >
> > / -> root directory ("folder").  it is just used as a hub for the others and
>
>
> OK, Nemesis, please clarify: is "usr" typically the name of this root
> folder, parent to all other directories?

No. The root directory has no actual file name: it is simply referenced by
the slash character. Go into a shell and type

 ls -a /

This will list the root directory, including any hidden files &
sub-directories.
usr will be one of these directories in any sensible Unix-like OS.

> Well, in my ignorance, I have scouted around the internet, and I read one
> convincing piece which said basically, don't do anything as Root if you can
> avoid it. One could inadvertently do all kinds of terrible things.

Yes, you should only operate as root to install and sometimes, to configure
things. If malware can't get into your root account, it won't be able to
install nasties. Make sense?


Post a reply to this message

From: Russell Towle
Subject: Re: UNIX Ignorance
Date: 29 Apr 2006 17:00:01
Message: <web.4453d2df831086c739b2bf190@news.povray.org>
> > I nver saw "usr". But if it is preceded by a period, even "ls" would not
> > show it, right?
>
> Yes, you need to use ls -a to list hidden files & directories in the current
> directory. And all hidden files have a period as the first character of
> their name. But the system /usr directory shouldn't be hidden, AFAIK.


I see, thank you very much.

The thing of it is, POV UNIX works fine for me. I was just a little ...
shocked ... that this "usr" folder was hideen from me in Mac OSX. Now I
discover one can actually see the "usr" directory in the Mac "Finder," if
one uses menu "Go," and chooses "To Folder."

If I had know it was already there, my install of UNIX POV would have been,
well, smoother.

Thanks to all for good advice.

POV is wonderful. So many people have worked so hard to make it what it is.
It makes quite a story.

RT


Post a reply to this message

From: nemesis
Subject: Re: UNIX Ignorance
Date: 29 Apr 2006 18:20:01
Message: <web.4453e578831086c7be77c3280@news.povray.org>
"Russell Towle" <rto### [at] inreachcom> wrote:
> What? What? A GUI is "punishment"? I will take a moment and grok that.

well, to me, most times it is a very limiting way to talk to computers.  but
that's just me and anyway, this was not what i said.

You said:
"UNIX POV works great on the Mac..."

and then:
"It is not nearly as nice as the Mac GUI versions, Official or MegaPov."

which led me to conclude that even though not being "as nice as the GUI
version", you're still using it.  So you must be a gluton for punishment
indeed... ;)

> Hey I've been using a shell. But as I recall, when my geekiness reached a
> certain pinnacle, and I typed "ls" into the command line and pressed enter,
> I nver saw "usr".

ok, ls, if not given a directory as parameter, lists the content of the
"Current Working Directory", which is the directory you're at right now.
You can discover what it is -- generally your home folder -- by typing the
aptly named "pwd" command. :)

and please, remember that all folders in a Unix filesystem are "plugged in"
to the root folder, that is "/".  So, the full path to the "usr" directory
is "/usr".  Same for "/home/myself" etc.

So, to see the contents of the "usr" directory:
ls /usr

However, if you're just installing the software, i don't think seeing the
contents will be of much help:  are you thinking of manually copying the
executable files and libraries around?  This is a bad idea, let the
installer do that for you.  Are you compiling from source?  "make" will
build and "make install" will install everything...

> " But if it is preceded by a period, even "ls" would not
> show it, right?

No.  "ls -a" shows all, even hidden files.  It will not show, though,
content for which you have no privilege for viewing, although that's not a
problem for root/admin...

> OK, Nemesis, please clarify: is "usr" typically the name of this root
> folder, parent to all other directories?

i guess i've already clarified that. / is the root. /usr is the full path of
directory usr in directory /.  I think the difficulty here is that / when
used as the first character in a directory path, represents the root
folder, while anywhere else it is just a path separator. :P

Just to add something more to the confusion:  . represents the current
directory and .. represents its parent directory.  So, you can reference
directories *relativaly*, without specifying the full path, like this:
cd ../ -> goes up one directory
cd ../../ -> goes up two directory
ls ../../foo -> list contents of directory foo two directories upwards

For security reasons, by default, Unix does not search for executables or
libs in the current directory, represented by ".".  So, if you're currently
in your home folder, and you decided to place the povray executable there,
and you try to start it like "povray" and receives something like "command
not found", don't be alarmed.  It is there, but since Unix prevents you
from running programs which could be malicious code placed there, you must
reference it either by the full absolute path -- like "/home/myself/povray"
-- or relatively, like "./povray" which reads "run the povray executable in
the . (current) folder".

Also, generally the symbol "~" when the first in a directory path is
expanded to   your home directory, like "/home/myself".  So you could as
well reference it like "~/povray"...

well, explaining these Unix details for newbies is always fun. :)

> Well, in my ignorance, I have scouted around the internet, and I read one
> convincing piece which said basically, don't do anything as Root if you can
> avoid it. One could inadvertently do all kinds of terrible things.

well, sure.  As root, you are the master of your domain, you're God, you are
The One. :)

you can even mistakenly bring the whole system down by accidentely typing
"rm -f /" which will wipe out the whole filesystem.  Why?  Because you're
root and the Unix philosophy is such that when root says one thing, it is
law.  root is never wrong and may have reasons to wipe out the whole system
for no aparent reason.    So, the system will not ask you something like
"Are you sure of that?" like is so common in GUI apps.  That's why you
specified the "-f" (force) switch in the first place, isn't it? :)

Well, personally, i hope the real one God does not commit typos... :P


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.