Tuesday, April 27, 2004

Logging

A couple of ways to see the messages from your system:




  1. The dmesg command. This will dump the messages you see at start up. You'll probably need to pipe it through less to see all of it:

    $ dmesg | less

  2. Check out the /var/log folder. Lots of interesting log files in there, including various dmesg.* ones.

  3. Edit /etc/syslog.conf and uncomment the line to create /var/log/console.log. This way you'll even get any automagically run fsck and such.




"dependency chaining"

Someone asked on freebsd-questions how to force
phpMyAdmin to use his installed MySQL 5 & Apache 2, rather than keep asking for MySQL 4 and Apache 1. A good question, I think.



The maintainer of the phpMyAdmin port, Matthew Seaman, spoke up with a very interesting solution:


Actually, the versions of apache and mysql are controlled through the
dependency chain by the PHP port you install. The phpmyadmin port
just wants to see that PHP is installed.



Setting the following in /etc/make.conf will make your system default
to apache2 and mysql-5:



APACHE_PORT= www/apache2
WITH_APACHE2= yes
WANT_MYSQL_VER= 50

Cheers,


Matthew


I took a quick look at the Makefile in the /usr/ports/databases/phpMyAdmin directory and I don't see anything that would help you out in this. I'm going to ask around and see if there is a more general solution to the problem of a port desiring an earlier version of an already installed application - somewhere to look for a list or something.






Tuesday, April 20, 2004

NVIDIA & FreeBSD

Cool site for getting FreeBSD, X, and Nvidia cards to play together nicely:



NVIDIA/FreeBSD FAQ



OpenOffice HOW-TO

While my server doesn't run X, I'll be creating another machine as a FreeBSD "user" machine, and that one will be running X. And I'll probably want to install OpenOffice.org, the Sun-supported freeware MSOffice compatible suite. It's a beast to install from ports (ie., via source), so here's a suggestion from Jerry McAllister on the -questions mailing list:


They have already built packages for FreeBSD that install just nicely.



Go to http://projects.imp.ch/openoffice/



Pick the latest package that suits your situation
Download it to /usr/local and run pkg_add on the compressed file.



Then, to set it up, run /usr/local/OpenOffice1.1.0/program/soffice.
Note the OpenOffice1.1.0 will vary according to what version you
download and where you tell it to put the Openoffice files.



Put that directory in your path.


After that, soffice, swriter, etc will start what you want. It works
fine as helper utilities in your browser too.


////jerry




Thursday, April 15, 2004

Notes on the SCO "lawsuit"

Greg "groggy" Lemis' page on the SCO vs. the world lawsuits. It's a little outdated, but still a good overview of the scuffle:



SCO's lawsuit against IBM



Tuesday, April 13, 2004

How to copy files

A deceptively simple question was asked on freebsd-questions:


How do I copy all the files, including subdirectories, from a cdrom to an arbitrary direcory?


My first inclination is to merely use cp:


$ cp -Rp /cdrom .


This will copy all the files from a (mounted) CDROM to a folder in your currently directory called 'cdrom'. The -R says to do it recursively, thus picking up all the subfolders (creating them in the destination folder as well), while the -p says to preserve the various attributes, like mod time and user id.



Actually, to be truly honest, I normally would have suggested cp -r /cdrom . as a command. But the -r (note lowercase) is an archaic, obsolete and "strongly discouraged" option, as it has even more trouble with non-standard files like links and other special files.



There are, however, a couple of problems with this. One is that I can never remember at what depth is the destination folder created - ie., does it create the cdrom folder, or will it copy all the files in cdrom in the current directory? There is a subtle but important difference between cp -R /cdrom . and cp -R /cdrom/* .. The latter starts in the /cdrom directory for the files, while the former will create the cdrom directory in the current directly and then start copying.



Another, perhaps more important problem has to do with links. Symbolic links are copied like files, which may mean they no longer make sense. Ie, if you had a symbolic link that pointed to ../../test/test.cpp, and didn't copy the test folder, then it wouldn't point to anything useful. And hard links are not copied as links at all, but rather are copied as separate files, which may or may not be what you want.



To get away from those problems, the man pages suggests tar(1), cpio(1) or pax(1). Here's how it was suggested by Matthew Seaman on how to do it via tar:


% cd /cdrom

% mkdir /home/jerry/cdimage

% tar -cvf - . | ( cd /home/jerry/cdimage ; tar -xvpf - )



This tells tar to dump the current directory to stdout, and then cd to the destination directory and read the input from stdin. A cool example of using Unix building blocks, bringing them together via the wonders of stdin and stdout and pipes.






Sunday, April 11, 2004

FreeBSD fund raising

In an interesting idea, Poul-Henning Kamp has offered his services to the FreeBSD community, but "at a price, Ugarte" (a line from my favorite movie, Casablanca). . He's a software contractor in Germany who is offering his time for US$5500 per month and is looking for donations to pay for it. He has a particular set of goals and is a long-time contributor to the FreeBSD developer community (see the web page for complete details). I like the sound of it and am going to contribute my little bit.



Fundraising for FreeBSD development



Comprehensive Guide to FreeBSD

A book online for setting up FreeBSD. It is a little dated (I think it only goes up to 3.x!), but chapters 3, 4 and 5 look like good outlines for setting up a network and server with FreeBSD. The actual steps may differ but what you want to accomplish probably hasn't.



Comprehensive Guide to FreeBSD



Defcon1

Nice help FreeBSD page, with plenty of information to digest:


D E F C O N 1 . O R G - FreeBSD the Power to Serve.



Process information

A few interesting things I've learned about getting information on currently running processes:


  • If you have the PROCFS mounted (which I think is normally the case), you can look in /proc. This contains a bunch of subdirectories corresponding to the PID of the currently running processes. Inside each of the directories is a bunch of files with pertinent information. I haven't yet begun to look closely at these, but I shall! Here's the Procfs manpage:

    FreeBSD Hypertext Man Pages: procfs


  • The command to get kernel information, esp. about its currently running condition is vmstat:

    FreeBSD Hypertext Man Pages: vmstat



  • The following port looks to be a nice utility for getting process info as well. Perhaps it even parses the above files?

    Port description for sysutils/pmap




Friday, April 9, 2004

Cleaning the ports db

Cool article on how to answer the mysterious question from pkgdb -F, when it asks about replace a "stale dependency". I usually just let it go and do its work but this can sometimes really break things. This article explains a little about what is going on when it asks.



ONLamp.com: Cleaning Up Ports [Nov. 29, 2001]

Archiving solution

I just got a new machine from my employer (and the payer for my nice fast SDSL connection - inSORS; we do high-end video conferencing software), so I'm changing the roles of the various machines I have. One is a overclocked (clear to 800mhz - woo hoo!) Pentium, that I bought a big, cheap hard drive for, thinking to turn it into a backup server. I was looking at some Windows solutions, but realized that FreeBSD would be a better idea. The Light Dawns over Marblehead, eh?



Anyway, I looked at Bacula, and it looks exactly like what I need. Most of the machines on my network (I have 6 machines here now!) are Windows machines, except for this server (FreeBSD natch) and a dual-booting machine that I use for gaming (WinXP) and Linux development (RedHat 7.4 - part of our video conferencing solution is a server that runs on Linux). So I needed flexible clients, and Bacula does that very well.



It looks like a very complete solution - which of course means some complexity as well. So I'm going to take it slow and give it a whirl. Another thing I'm going to do on the new FreeBSD machine is to install X Windows - like I need another admin headache!



Port description for sysutils/bacula



Here's a nice page from FreeBSDDiary.org on how to set up and run Bacula:

http://www.freebsddiary.org/bacula.php



Wednesday, April 7, 2004

/stand not updated?

Someone asked on FreeBSD-Questions about his /stand folder not getting updated. Ceri Davis replied:


Correct. The scripts don't automatically do it. You can do it by hand
on RELENG_4 by making install in src/release/sysinstall and then linking
everything else in /stand to /stand/sysinstall.


Ceri also mentions /usr/sbin/sysinstall. I'm going to have to look into this, as I've never seen mention of it before. Looking at my 4.9 /stand, I too see that the file dates go back over 2 years ago. Not that I often use stuff from in there, but I'm going to do a little digging to see what is going on here.



Also, on an unrelated note, sorry if you've been seeing SPAM via comments on my blog. I was out of town over the weekend and someone (or should I say something, as they are among the lowest life forms) posted a bunch of spam comments. I block the IP when I see it, but I didn't catch this one until there were 4 posts.




Thursday, April 1, 2004

Allowing users to mount CDs

Excellent, if undocumented (as are many of them) sysctl.conf variable:

# sysctl vfs.usermount=1


As Malcolm Kay mentions in his email to freebsd-questions:

allows users to mount and then unmount drives provided other things
are in order. You can make this happen during the normal boot by adding

vfs.usermount=1

to /etc/ sysctl.conf



It can be tough to find docs on sysctl variables. I have a short entry in my blog (here) that points to a text page that documents some of them, but not all, and not vfs.usermount. Looks like there is an attempt to document more of these variables :

RFC: Automated process for documenting tunables/variables.


Let's hope it gets going! It is for exactly this sort of mysterious command/variable/setting that I started this blog. I'd never remember these things, so I just jot them down in my blog, and I can search later for them.




DaemonNews.org

Cool site that gives you lots of coverage of all the news that is fit to print in the *BSD world. Wish it had an RSS feed, though - I'm addicted to RSS! It is second only to newsreaders as far as ease of getting information. Don't forget, Daemon Dancing has an RSS feed, thanks to the wonderful Movable Type package.



Daemon News



Keeping up with freebsd-questions

As you may know, the freebsd-questions mailing list is a veritable flood of information. It has an amazingly good "signal to noise" ratio; by that I mean there isn't much off-topic chatter, and most questions are answered in an accurate and timely fashion. However, it is a flood - several hundred posts a day, usually.



I don't like getting mailing lists in digest format. It is too hard to follow individual threads and too hard to form replies, etc. I don't like any web-based bulletin board system yet. Some are barely usable, but most are just too painful to work with. My favorite way to get information remains good old fashioned newsgroups. There are excellent newsreaders out there, that let you do things like ignore threads and obnoxious posters, watch particular threads, etc. I use the newsreader that comes with Mozilla, because I find that the way I use newsreaders and emailers is so much the same, I don't want to use two separate programs to do it. Another good one is the gnus package in Emacs, my favorite editor. But I've never quite gotten comfortable with it, so I've stuck with Netscape/Mozilla.



Anyway, I was glad to come across Gmane.org. It provides a mail <-> newsreader gateway, so you can read mailing lists via your newsreader. It makes keeping up with the heavy volume of the freebsd-questions list much easier. Check it out for lots of other, mostly technical, mailing lists too.



Gmane -- Mail To News And Back Again



How to mount a floppy

If you want help on how to mount a removable disk, this is the spot to start - the entry in the FreeBSD FAQ :


Disks, Filesystems, and Boot Loaders : I have a new removable drive, how do I use it?