![]() |
| January 2000 | Get BSD | New to BSD? | Search BSD | Submit News | FAQ | Contact Us | Join Us |
|
Welcome to the year 2000! I'm spending January first holed up in my apartment with all my computers shut down, hoping the power stays on long enough for my alarm to wake me up in time for the Tournament of Roses parade.
"If you can read this..." :)
But enough monologue.
This month we have a veritable Santa's Bag full of questions and mailbags, plus an index of questions from previous editions of the column.
What's the incantation to get BSD and Windows to share my PC's clock properly?
Help me get my mouse working with X on FreeBSD.
Why does the Bourne shell not let me redirect both stdout and stderr to the same place?
How do I unify passwords and such on a heterogeneous network?
I have FreeBSD CDs and a laptop with no CD-ROM. Help.
How do I use scon to configure the text console on OpenBSD 2.5?
My home ISP gives me one address via DHCP. How can I get all my other home systems onto the net?
I need help understanding what to put in /etc/exports.
Why do people compare "X$foo" in the shell instead of just "$foo"?
Woe is me, I have a 250 meg parallel port Zip drive. Help!
Smooth user vs. guest logins for a netatalk setup.
I can't run dhclient because it says there are no bpf devices.
Help, I switched from NetBSD to FreeBSD and graphics printing stopped working.
How do I get MS-DOS parallel port code to run on NetBSD/i386?
First mailbag of the new millennium!
Q:
What's the incantation to get BSD and Windows to share my PC's clock properly?
A:
When I need to do this, I build a new kernel with the following line added
to the config file:
options RTC_OFFSET=(minutes west of GMT)
Why is this hard-coded into the kernel? Well, parts of the kernel can query the time before any user-editable config files are read. Other possible routes for setting the local timezone before that code executes, but without patching the kernel, would be to poke bits into the boot block, or to steal some space in the CMOS memory and store the timezone there. Of these I'd prefer the boot block method, but I don't know of anyone actually doing this to implement clock compatibility with Windows.
Q:
Help me get my mouse working with X on FreeBSD.
A:
If you are using syscons (the default console driver), you can configure
FreeBSD to support a mouse pointer on each virtual screen.
In order to avoid conflicting with X, syscons supports a virtual device called
/dev/sysmouse.
All mouse events received from the real mouse device are written to the
sysmouse device, using the MouseSystems protocol.
If you wish to use your mouse on one or more virtual consoles, and use X,
the following configuration is recommended:
/etc/rc.conf:
moused_type=ps/2 # or whatever your actual type is
moused_port=/dev/psm0 # or whatever your real port is
moused_flags=
/etc/XF86Config
Section Pointer
Protocol "MouseSystems"
Device "/dev/sysmouse"
.....
Some people prefer to use /dev/mouse under X. To make this work, /dev/mouse should be linked to /dev/sysmouse:
# cd /dev
# rm -f mouse
# ln -s sysmouse mouse
A big Answerman cheer goes out to Ronnie Bell (ronbell@cais.com) for sending in both the question and the answer he found on his own, less than an hour later.
Q:
Why does the Bourne shell not let me redirect both stdout and stderr to the same place?
A:
If you try it like this (with any of the Bourne family of shells):
% fargle 2>&1 >/dev/null
Then you should have swapped the redirections, like this:
% fargle >/dev/null 2>&1
The earlier syntax redirects stderr to come out on the original stdout, and stdout to go to /dev/null. While of dubious practical value, this is one of those things that Bourne shells let you do, but csh family shells do not.
The Bourne shell processes redirections left to right, and aliasing operators like >& simply arrange for a dup() to happen at the right time. So if you haven't redirected stdout before you clone it, you'll clone the old stdout instead of the redirected one. (If you go crazy with these, the shell will patiently execute them all in order, and you'll get whatever you specified, though it may not be what you wanted :) .)
Note that pipe redirection happens early, so you can do things like this:
% fargle 2>&1 | tee fargle.logIt is the equivalent of the csh redirection operator "|&".
A:
This is a tough one in general, and deserving of a feature article
(which I am not qualified to write :().
However, if I were suddenly faced with a huge need to do it, I'd start by
checking out
l0phtcrack
for the Windows side, and
NIS
for the unix-to-unix part of it.
Q.
Details:
I have a copy of
The Complete FreeBSD
with 4 CDs.
I want to install it on my Toshiba Satellite CS110 subnotebook.
It has a floppy and Compaq 288 PCMCIA modem, but no CD-ROM.
The parallel port has a 100 Meg Zip, plus I have the Toshiba networked to my
desktop via a Xircom CreditCard Ethernet adapter (with a Cat5 Crossover cable).
The laptop HD has 774 Megs, of which Win95 is using 175 Megs.
The rest is free.
Also, it has 16 Megs of RAM.
I have FreeBSD CDs and a laptop with no CD-ROM. Help.
A:
For your setup, I recommend trying the FTP install first:
I'm sorry I don't have a cookbook style answer for you, but there are lots of alternatives here, and I don't have a Xircom card or a parallel Zip 100 with which to test the cookbook directions.
A:
I answered the
NetBSD version of this question
last year, and OpenBSD's pcvt driver is probably very close to the
NetBSD one, so the instructions given there should also work for you.
If they do but you find small differences, let me know so I can add OpenBSD
footnotes to the page.
Q.
My home ISP gives me one address via DHCP.
How can I get all my other home systems onto the net?
A:
Browse through the
September 1999 AnswerMan
and you should find some leads, specifically the ipnat bits.
A:
The simplest use of /etc/exports is to list directory names there with
no options; each directory so listed will be exported read-write to all
clients and users on those clients, except for root.
For security reasons, the default is to give remote root users
access as if they were the user nobody.
Clearly this is bad for diskless machines, so when exporting directories
to diskless machines, you need to at least use -maproot=root when
exporting the client's root directory on the server.
Some of the other options are a good idea (especially if you care anything
for network security), but aren't strictly required for a successful netboot.
For a more detailed tutorial, go see the Diskless NetBSD HOW-TO web page, and be enlightened.
Q.
Why do people compare "X$foo" in the shell instead of just "$foo"?
A:
Hmm, you must mean something like this:
[ "X$x" = XHELP -o "X$x" = XBOB ] && echo bobThe main reason for this is to bulletproof the script against bugs in older versions of the shell and test command; if you do not have the X in front, and $x expands to ! or -f or some other unary operator, it may be recognized first and will silently do something totally different than what the script's author intended.
Modern shells are much smarter about counting and analyzing the arguments, and are less likely to screw up, but it is still possible to write scripts that expose themselves to data-dependent errors, for example if you forget to use double quotes when you should:
[ $x = $y ] && echo x=yLooks reasonable, right? Try setting x="-n" and y="". Then the test command (or shell built-in) will see:
[ -n = ] && echo x=yDepending on the shell, you'll either get a false positive because the test has silently mutated, or an error ("test: argument expected") because somebody tried to fix the earlier bugs and did it incorrectly! (I actually got that just now, on Solaris 2.5.1 with sh. Amazing...)
Q.
Woe is me, I have a
250 meg parallel port Zip drive. Help!
What changes do I need in the basic parallel port ZIP setup to get this to work? The docs I've seen so far give a lot of details about EPP settings and other hardware stuff. Is it really that tricky? And what do the /etc/disktab entries for a 250 meg Zip look like?
A:
The main advantage of
EPP
is higher performance, so I would hope that it isn't required just to use
the Zip 250 model.
However, I must admit that I don't have any of these, nor do I know anyone
who uses them.
I should confess up front that I am a card-carrying
SCSI
bigot; I have quite a few
SCSI Zip 100's
and they all work great; of the two
ATAPI Zip 100's
I currently have, one initially turned up
DOA
due of the infamous
"Click of Death",
and had to be exchanged.
All were purchased at
Fry's Electronics,
the
legendary geek supermarket chain,
which inexplicably refuses to run an official web site.
Sadly, the only thing I can really help you with is your last question. My September 1998 AnswerMan column covers this extensively for the Zip 100, so I would hope that you can adapt those examples, either by upping the cylinder counts 2.5 times, or running disklabel on a DOS-formatted cartridge and noting the geometry numbers given it by the Windows driver.
A:
By upgrading to netatalk 1.4b2+asun 2.1.3
(I think 1.4b2 alone will do this, but the asun
extensions are nice to have)
I was able to define multiple servers.
/usr/local/afpd.conf grew from a blank file into the following:
### The -noadouble is to avoid littering all directories with a .AppleDouble ### file. Some xwindows file managers then clutter the desktop with ### this file, which is undesirable. ### Other then that, the - stands for default server, it takes default options - -noadouble ### The following three lines are actually one long line. ### Note that the only important parts are the first word, which defines ### the volume name, and the -port, which puts the server on a different port. ### The -address is highly desirable if you are internet connected and need to ### keep people outside your network from using your commercial applications. "Applications" -port 12001 -nouservol -address 192.168.0.8 -defaultvol /usr/local/etc/AppleVolumes.default.applications -systemvol /usr/local/etc/AppleVolumes.system.appliactions
I then created AppleVolumes.default.applications and AppleVolumes.system.applications, which define the volumes for this server.
Now, when the guest user logs in at startup time, it uses the second server, leaving the main server free for users to log in as themselves.
Q.
I can't run dhclient because it says there are no bpf devices.
A:
First thing to check is for /dev/bpf* and if those files don't exist,
you'll need to do something like
(cd /dev && sh MAKEDEV bpf)to create them.
If they do exist but it still claims you don't have them, then it probably means your kernel was built from a config file that did not have an uncommented line like:
pseudo-device bpfilter 4 #Berkeley packet filter
Q.
Details: Printer is a
Panasonic KX-1123
(using Epson ESC/P2 emulation).
Text files do print correctly.
Prior to the switch, printing worked very well,
both locally and remotely using Samba.
Help, I switched from NetBSD to FreeBSD and graphics printing stopped working.
A:
Probably something in /etc/printcap and the associated filter(s)
didn't get copied over when you switched BSDs.
If there is someone who might have set things up without you knowing,
go find out if they did, and have them repeat it with your current system.
If you still have backups of the previous installation, you can try checking
those.
Otherwise, I recommend the
relevant section of The FreeBSD Handbook.
Q.
How do I get MS-DOS parallel port code to run on NetBSD/i386?
A:
Check out
% man i386_iopl
and this example program. Enjoy!
Q.
First mailbag of the new millennium!
A:
booting hd0a: /bsd failed(2): will try /obsdand eventually fails to boot. Was there something I needed to do to the partitions. I set up one big partition and one swap partition. I tried the help and man pages for the partitioning and I couldn't seem to get what it was getting at. Help?
September, 1998
- I am running NetBSD 1.3.2 on my PC, and I want to use my ZIP drive. Did I miss something? The FAQ says it should "just work" but all I see are weird messages like "not configured" and "no disklabel".
- Actually, I don't get any messages at all. Where's my ZIP drive?
- I think I found my ZIP, sorta. What does this 'dmesg' output mean?
- Okay, 'dmesg' can see my ATAPI ZIP drive now, but:
- What does 'disklabel: /dev/rsd0d: Input/output error' mean?
- There's really a ZIP disk in there. How come I still get errors and no substantial output from 'disklabel sd0' ?
- Okay, now I get 'no disk label' and a 'fictitious' label with garbage in the partition numbers, and all partitions 'unused'. Now what?
- Hey, I just brought home a new ZIP disk and 'disklabel' reports that it has two partitions, 'd' and 'h', and the latter of those is MSDOS! Is this what the factory-preformatted disks are supposed to look like? And how come the mount command from the previous question fails with 'invalid argument' ?
- Why did 'mount /dev/sd0h /mnt' bomb out with 'incorrect super block' ?
- Great, everything works fine now as long as I use pre-formatted disks and specify 'msdos' as the filesystem type. Now how do I put a native BSD filesystem on these puppies? Is there a way to do it without dark rituals and ancient incantations?
- Hold on a minute -- what's with this "rsd0a" device?
- Cool. But that's somewhat less than 100 megs. How do I squeeze more usable space out of my ZIP disks?
- Hmm. I'd like to keep /mnt free for emergency use. What alternative do you recommend?
- The 'eject' utility seems to be ZIP illiterate.
- Good Lord, this actually makes some sort of sense. But my friend had a little too much Jolt and Dew together last night, and installed the OS onto one of these ZIP disks. The disk wouldn't boot! Why?
November, 1998
- I'm compiling some big programs, and the linker dies with an error that sounds like it's run out of memory. I checked and I have plenty of swap space, or at least much more than 'ps' says the linker is using. What gives?
- I wrote a program that fails with EMFILE ("Too many open files"). Help!
- Okay, but now I get ENFILE ("Too many open files in system"). ARGH!
- My big compile appears to have succeeded now, and I installed the program. But 'man' doesn't want to find the man pages for it.
- I deleted a very huge file that was using most (80%) of its disk. It is definitely gone from the directory, but df(1) still says that the disk is over 80% full. Why doesn't df see that I deleted it?
- I tried to run a package I just installed, and one of the scripts belched some garbage characters and then failed with /progs/bin/program: 3: Syntax error: "(" unexpected
- Hmm. It bothers me that it spewed all that gunk. Isn't something seriously wrong somewhere?
- I'm trying to mount a Linux disk, but it fails:
- How do I make /tmp be a ramdisk?
- How come I can't find 'adduser' or 'useradd' or whatever on NetBSD?
- So what happened with your search for SCSI formatting utilities?
January, 1999
- My X server starts up with really big windows that don't fit on my screen.
- What is the BSD equivalent to SysV's /etc/shadow file?
- Why does PINE complain "No host name or domain name set" ?
- I am trying to use YP (aka. NIS) on my system, but on some machines it doesn't see changes to my account information.
- I just installed NetBSD and it always boots into a read-only shell.
- My LinkSys ethernet card isn't recognized by NetBSD after all. Help.
- What do I do when NetBSD says my sound card is "not configured" ?
- I just installed a sound card into a NetBSD system, but the sound is really quiet.
- How do I get the NetBSD text console to display more than 25 lines?
- Where are all the nifty VGA console utility programs on NetBSD 1.3.2 for i386?
- Is anything being done to automate setup of the NetBSD pcvt driver?
- Why use "su -" instead of just "su" ?
- Why did you give an explicit swap device in your memory file system example?
March, 1999
May, 1999
July, 1999
- Where'd you disappear to four months ago?
- Didn't you make up a little bit of history (specifically, the death of the DEC 'Tulip' chips) in your January column?
- Why does my script work on commercial unixes but not on free unixes?
- Is there any automatic method for creating the device special files in the /dev directory?
- My /var partition is starting to overflow, help!
- Why do my signal-using programs "lose" signals?
- Those Alpha boxes looked cute, have you found any other weird hardware to run BSD on lately?
- Do you have any questions sitting around that some of us could take a crack at helping you answer?
September, 1999
- Hey, don't curly braces really mean that sh should execute the enclosed stuff in the same shell, not subshell?
- How do I set up a machine with two ethernet cards as a router? (Answer #1)
- How do I set up a machine with two ethernet cards as a router? (Answer #2)
- How do I set up a machine with one ethernet card and a serial modem to act as a PPP gateway? (Answer #1)
- How do I set up a machine with one ethernet card and a serial modem to act as a PPP gateway? (Answer #2)
- How do I configure my machine to use a proxy server?
- I installed FreeBSD from an MS-DOS partition but forgot to install the man pages, and now I can't get /stand/sysinstall to find the MS-DOS partition so I can't install my man pages! Now what do I do?
- I just installed NetBSD 1.4.1, and I want 50 line text screens again.
- How's that Sparc laptop doing?
- What's in this month's mailbag?
November, 1999
- Why do I have to set a netmask of 255.255.255.255 when I use an IP alias?
- I want to use the wheel on my wheel mouse.
- Do you have any newbie-level resources for setting up the IP Filter 'ipf' ?
- How do I get NetBSD to remember my ifconfig settings?
- Why does make reject '$(shell blah)' in this makefile I'm porting to BSD?
- What's in this month's mailbag?
Todd Whitesel has been grokking computers for fun since his first grade school Apple II in 1980, and doing it for a living since 1992, when he escaped from Caltech with a B.S. degree. He helps promote Japanese Animation in America by running Registration for Anime Expo, and helps promote NetBSD by way of his NetBSD Architecture Farm.