Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Oct 1996 20:15:42 -0700 (PDT)
From:      "Bryan K. Ogawa" <bkogawa@primenet.com>
To:        sue@welearn.com.au
Cc:        freebsd-questions@freebsd.org
Subject:   Re: It's the little things...
Message-ID:  <199610090315.UAA14002@foo.primenet.com>
References:  <199610082159.HAA24542@mail.zip.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
In localhost.freebsd.questions you write:

>Hi folks

>My first post so of course it's full of questions, sorry :-)

>I installed FreeBSD from CD to a second SCSI disk 6.5 days ago, then
>read everything in sight (handbook, faq, man, o'reilly), rebuilt the
>kernel, set up ppp, xwindows, etc. No probs at all with the hard
>stuff because it's pretty well documented. But the little things are
>driving me berzerk.

>Pick a question:

>Sometimes I can't access all the commands, and sometimes I can, and
>I can't find a pattern to it. When the _first_ login after booting
>is _root_ on console _one_ there seems to be no problem. Or is this
>just coincidence? I know it's a FAQ. I searched the WWW site for
>half an hour and found many prior questions on this, but no answers.

This sounds like your paths are not set the same on your root and
non-root shells, and possibly differently in the sh compatible ones
and csh compatible ones.  The best way to diagnose this is by typing
the following commands, and seeing which work and which don't:

date   -- this is in /bin
ping   -- this is in /sbin
man    -- this is in /usr/bin
iostat -- this is in /usr/sbin

When you notice that some commands don't work, check the PATH
environment variable (setenv in csh/tcsk, set in bash/sh), and type
the above four commands.  Note which ones fail, and compare them with
the information in PATH.

You should probably also check /usr/local/bin , which is where most
other stuff gets put.  Try tcsh -- it should be in /usr/local/bin .

>To be able to su root, do I just add my name to wheel in the group
>file? I did this and rebooted, but it didn't seem to work properly.

Yes.  You do not need to reboot for this change to take effect, but
you need to make sure there are no spaces and that each entry is
separated by a comma, like so:

wheel:*:0:root,bkogawa

>The installation material implies that right after install you can
>and should use su, but that's far from the case.

I almost always prefer using su (specifically, su -m) because it
preserves my environment and nice prompts. :)

>How can I set the prompt (to username and/or working directory... any 
>damn thing other than the machine name)? I'm using tcsh for myself 

the tcsh man page has some information on this.  man tcsh, then look
for page 66 (use the /66 command from the pager).  Examples that work
with tcsh:

put one of the following in your .tcshrc :

set prompt="%B%~%b %# "   # prompt will be in the form "~/rest/of/path > "
set prompt="%B%n%b %# "   # prompt will be in the form "username > "

Personally, I use this:

set prompt = '{%m} %B%~%b %S%T%s %l %# '

which looks like this:

	{foo} ~ 20:08 ttyp2 #  

However, the path (represented by ~) is bolded, and the time (20:08)
is inversed.

>(set up with sysinstall's facility) and the default as root. I've 
>systematically edited and retried every dot file in my dir and can't make it 
>change. The files in /etc that look relevant are blank except for 
>comments.

>I believe I shouldn't change root's shell, but I'd like a command 
>history. Is there any problem with simply logging in as root then typing 
>tcsh? If that's ok, would it also be available (or advisable) in 
>single user mode? And if not, how does root erase the "[" or "]" that 

tcsh will not always be available in single user mode unless you
statically compile tcsh and put the statically-compiled tcsh somewhere
on the root partition.  I recommend just typing tcsh when you need it,
and learning how to use csh and sh (it's not horribly different than
tcsh if you're just typing in stuff).  As far as erasing the "[", it's
a pain.  Generally, I just hit Control-C and start the line over.

>remains after accidentally pressing the up-arrow and erasing most of 
>the resultant junk from the command line?

>How do you install the ports or packages which auto-request the files
>by ftp? It doesn't seem to initiate ppp so I ran user ppp first,
>connected with my ISP, then ran sysinstall. Whoo! Screen went blank
>and keyboard locked until I switched the modem off. Is this the wrong 
>procedure or a misconfig?

For ports which do a remote ftp, I usually telnet to my shell account
directly, ftp from the remote account to my local account, then ftp
from my home machine to my shell account and download the file, then
su to root and move the file into /usr/ports/distfiles by hand.  This
is generally more efficient than trying to ftp to somewhat dodgy sites
via a direct connection over PPP, although I realize that many people
don't have shell accounts nowadays.

To install packages, I download the package via ftp from
ftp.freebsd.org, then use pkg_add to add it.  Note that you must be
root to successfully run pkg_add in most cases.

I noticed that you are located in Australia.  This brings two things to mind:

1.  ftp.freebsd.org may not be the best site for you to use.  Look for
an Australian mirror of FreeBSD for packages.

2.  I would guess that using a shell account on a full-time connected
machine would help even more in this case for sites outside Australia.

>Minicom is very badly behaved. I think it's terminal emulation 
>problems. I've set it to vt100. Funny characters appear on screen, 
>and Minicom keeps responding with its signature (Minicom v.xxx...) and 
>strings that look something like "Muummuunnnuy!nnnnumy". Even when I 
>first told my console to use vt100 instead of cons25 (through tcsh 
>for me, and also during the root login question) it didn't help minicom.
>Not having a viable zmodem further insulates me from the non-Internet 
>world, but that's another issue. Is minicom being silly or am I?

I've had decent success with seyon (requires X), but it is not well
documented (at least, the package isn't).

>What's _the_most_proper_ way to stop everything before turning the
>machine off? I could not find anything written about this!! Surely
>turning the power off is not kosher :-) Should I use shutdown or
>halt? (Indeed, how was I to know that these commands existed?) They
>don't seem to do a great deal, or leave me in single user mode ready
>for login, not knowing if at that point it's safe to turn off power
>or not. This is a most serious omission in the reading matter, or I
>need new glasses.

I use the following command "shutdown -h now".  The -h flag is the one
that tells shutdown to sync the disks and halt the machine, instead of
throwing you into single user mode.  I have successfully used shutdown
-h from single user mode as well.

>What's the deal with MFS? I reckon I don't need half of my 64 megs of
>ram so it'd be useful as /tmp. Am I reading this right? If so, what's
>the syntax to tell the kernel how much ram MFS can have? I think it's
>taking the lot (because I didn't say how much) and that might be a
>bad thing, so I've unmounted MFS though there were no ill effects
>while I was feeling bolder.

>I was naughty and set my swap to only 70 megs. If I donate 32 megs
>to MFS (if that's how it works) then I guess 70 is fine. Otherwise I
>know it's no good. Which device will explode in my face if swap is
>only half its suggested size, and will I still be alive to ask you
>more questions?

The problem with too little swap is that programs may use up all of
swap and then "run out of memory" (especially big ones like X).  I
believe that if this happens, new programs trying to run fail, and old
programs asking for more memory are killed.  I could be wrong.

>My preferred text editor is joe. I found a copy and extracted the 
>contents. Having no idea what I was doing I typed 'make' and found an 
>executable which I put in bin and a .joerc which I put in my own dir. 
>So far it works but am I playing with fire?
[...]

This should work, but has disadvantages, specifically:

1.  It doesn't sound like you installed the manual pages.  You might
want to look for them and toss them in /usr/local/man/man1 .

2.  Some programs require libraries or other data files which they
expect to be in some location.  If you don't install these, the
program might not run or may run poorly, or run, but without certain
features (a good example are help files).

Many makefiles include an "install" operation which will try to
install the proper files in the proper directories.  Generally this
install must be done as root (unless all of the directories you've
specified to install to are writable by you).  To do this, su to root,
then type "make install" from the same directory you made the original
binaries.

Note that the above make install can run arbitrary programs as root.
If for some reason you do not trust the distribution of files you have
received, I recommend checking the Makefiles carefully.

3.  It sounds like you installed joe in /bin .  This isn't forbidden,
but many people consider it better to put locally installed and
maintained things under the /usr/local directory, so that you know
what things came with the operating system and what didn't.  In this
case, the directory to put the executable in would be /usr/local/bin .

4.  You can also look for a port of joe.  I think there's one around.
Generally packages install in a freebsd-directory-format-friendly
manner, and install most relevant files (although I've noticed that
user guides often get misplaced in packages).

-- 
bryan k ogawa  <bkogawa@primenet.com>   http://www.primenet.com/~bkogawa/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199610090315.UAA14002>