tar Ignoring out-of-order file What Does that Mean?
I need to modify the first installation image for a headless installation of Freebsd6.2. The file in question is: 6.2-RELEASE-i386-disc1.iso Thanks to a helpful member of the list, I found out that tar works on unpacking these images and it mostly does on this one, but there is a complaint I get from tar that I haven't found on other images. If I do a tar tvf 6.2-RELEASE-i386-disc1.iso Here is what happens while looking at the contents list: 0 44232 Jan 12 2007 RELNOTES.HTM lr-xr-xr-x 1 0 0 0 Jan 12 2007 stand -> /rescue lr-xr-xr-x 1 0 0 0 Jan 12 2007 sys -> usr/src/systar: Ignoring out-of-order file -r--r--r-- 1 0 0 22916 Jan 12 2007 RELNOTES.TXT It appears that the entire image unpacks except for the ignored file. If one tries the extraction with tar xf 6.2-RELEASE-i386-disc1.iso The complaint about the out-of-order file is the only indication that anything is wrong. In looking at the man page for tar, nothing jumps out at me as to how to end up with the proper file structure that mkisofs can put back in to an image to put on a CDROM. My thanks for any suggestions as I may be needing to do one of these installs in a day or so and it would be nice to know that all the image is there. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Network Operations Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: tar Ignoring out-of-order file What Does that Mean?
Jonathan McKeown writes: > [that was me - I'm glad I was of some help] Most definitely. You've been a tremendous help but I am still stuck and I believe all issues are known except this one. I should know when the unpacking/packing part is working by unpacking the FreeBSD iso image and then repacking it without doing anything at all. This should give me an iso image that is the same size as the good one and probably a byte-for-byte copy of the original. I did as you suggested and here is what happened. First, I created a directory called image and cd'd there. $ ls It's empty as it should be. $ ln -s usr/src/sys sys $ ls -l total 0 lrwxr-xr-x 1 martin martin 11 Nov 5 07:44 sys -> usr/src/sys Now, it is time to unpack the iso image. $ tar xf ~/6.2-RELEASE-i386-disc1.iso tar: Ignoring out-of-order file Darn! Well, Let's see how big an ISO image file it makes anyway. $ mkisofs -l -R -q . >~/tmp/testfile.iso $ ls -l ~/6.2-RELEASE-i386-disc1.iso ../tmp/testfile.iso -rw-r--r-- 1 martin martin 598476800 Nov 5 07:48 ../tmp/testfile.iso -rw-r--r-- 1 martin martin 601229312 Sep 21 08:57 /home/martin/6.2-RELEASE-i386-disc1.iso The original iso image is 2,752512 bytes larger. I bet it's the files that tar doesn't seem to be happy about. Once this hurdle is finally jumped, the rest should be quite normal. If you mount the image on a Linux system and use tar or mkisofs, you get a file that is almost twice the proper size so I think there may be some links that end up as multiple versions of the same files when they should have been symlinks or something else. The image made with FreeBSD's mkisofs and tar utilities is the archive that is 2.5 megs short. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Modifying the FreeBSD6.2 ISO Image
"Brian A Seklecki (Mobile)" writes: >The exact mksiofs(8)/mkhyrbid(8)/cdrtools flags are in a shell script >burried in src/release/* somewhere. Its probably a matter of >not-following-symlinks or crossing filesystem mount-points, etc. Most definitely. It obviously can be done as the image is living proof. This is proving to be quite a learning experience. Sincere thanks to all. A shell script is like the proverbial picture that is worth a thousand words. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Modifying the FreeBSD6.2 ISO Image
I think I have boiled this problem down to one point of failure. I need to modify a file in the 6.2-RELEASE-i386-disc1.iso CD. The image is 601229312 bytes in size. Following instructions from a list member, I did the following: mdconfig -a -f /usr/local/src/6.2-RELEASE-i386-disc1.iso mount -t cd9660 /dev/md0 /mnt This all worked perfectly as one now sees the entire file system under /mnt. At this point, one should be able to reverse the process by using mkisofs at the top of the tree which should produce another iso image. It does but the image is 1072242688 bytes large. this is pretty close to twice the correct size. Also, tar produces an identically-bloated file. Any ideas on how to put tar and mkisofs on a diet? In order to make the modification, I must tar cf somefile.tar . I bet when things are right, that tar file will be about the size of the image. Originally, I had posted several messages about tar complaining about an out-of-order file. I think this is probably related to whatever mechanism is used to fit the FreeBSD image on the disk. This last time, I created the memory disk and mounted it with no error so the problem appears to be something I am not setting in both tar and mkisofs. I am thoroughly stuck. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Network Operations Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
/bin/sh Can one Easily Strip Path Name from $0?
I am ashamed to admit that I have been writing shell scripts for about 15 years but this problem has me stumped. $0 is the shell variable which contains the script name or at least what name is linked to the script. The string in $0 may or may not contain a path, depending upon how the script was called. It is easy to strip off the path if it is always there #! /bin/sh PROGNAME=`echo $0 |awk 'BEGIN{FS="/"}{print $NF}'` echo $PROGNAME That beautifully isolates the script name but if you happen to call the script without prepending a path name such as when the script is in the execution path, you get an error because there are no slashes in the string so awk gets confused. Is there a better way to always end up with only the script name and nothing else no matter whether the path was prepended or not? Thank you. Martin McCormick ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: /bin/sh Can one Easily Strip Path Name from $0?
The basename utility does the trick. Thanks to all of you who answered. Martin ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Bind 9.3.4P1 Wouldn't run in Sandbox in FreeBSD6.2p9.
I don't know if this is a bind question or a FreeBSD question since it could be either. We've run bind in a sandbox for some years. After the latest security upgrades to FreeBSD6.2.9, bind refused to start. If I change ownership of /var/named to root:wheel and run named as root, it works fine again. This was kind of a shock and I needed to get bind going in a hurry so I am asking if there is a way to make bind run with the less important user ID when it is not in a jail. I am so glad I tried this on a caching DNS first. Thanks for answers or pointers as to where to read about this change. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Network Operations Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Best Way to Fix a links Browser Compilation Problem
I am attempting to install a newer version of the "links" text browser. The Makefile tells you to define WITHOUT_X11 if you are not using X so I modified the Makefile to define that parameter as follows: CONFIGURE_ARGS+=--enable-javascript --with-ssl --without-svgalib --WITHOUT_X11 Actually, that line may wrap when you read this message, but all those defines are on one line and the WITHOUT_X11 is simply tacked on to the end. Anyway, if I do a make build, the make abends with: mv -f .libs/fcdir.lo fcdir.lo /bin/sh ../libtool --mode=compile cc -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/local/c rm -f .libs/fcfreetype.lo cc -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/local/include/freetype2 -I/usr/local/inco fcfreetype.c: In function `FcFreeTypeQuery': fcfreetype.c:279: syntax error before `psfontinfo' fcfreetype.c:738: `psfontinfo' undeclared (first use in this function) fcfreetype.c:738: (Each undeclared identifier is reported only once fcfreetype.c:738: for each function it appears in.) gmake[2]: *** [fcfreetype.lo] Error 1 gmake[2]: Leaving directory `/usr/ports/x11-fonts/fontconfig/work/fontconfig-2.' gmake[1]: *** [all-recursive] Error 1 gmake[1]: Leaving directory `/usr/ports/x11-fonts/fontconfig/work/fontconfig-2.' gmake: *** [all-recursive-am] Error 2 *** Error code 2 Stop in /usr/ports/x11-fonts/fontconfig. *** Error code 1 Stop in /usr/ports/x11/XFree86-4-libraries. *** Error code 1 Stop in /usr/ports/www/links. The problem seems to be buried in all those X libraries links uses. Either that or I defined that WITHOUT_X11 variable in the wrong way. What is the safest way to correct a problem like this? In my experience, the port installation process is very good at figuring out what it needs to do to get a package to build but obviously, I have the wrong version of something or there is something wrong with the WITHOUT_X11 directive. This system does not have X windows on it, but it has several XFree86 libraries due to software such as expect that needs several X libraries. Many thanks for any help. Martin McCormick WB5AGZ Stillwater, OK OSU Information Technology Division Network Operations Group ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Best Way to Fix a links Browser Compilation Problem
Mark Woodson writes: >You do not actually need to edit the CONFIGURE_ARGS in Makefile, >rather you include that statement in your call to make > >make WITHOUT_X11=yes install My thanks to you and one other person who pointed this out to me. It looks like that is going to work. Martin McCormick ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Extracting individual Files via tar
The command tar ztf /usr/local/src/ports.tar.gz produces a table of contents just like the man page says it should. The man page also says that individual files can be recovered or listed but I haven't gotten that to work at all. if I try: $ tar zt ports/print/pstotext/ /usr/local/src/ports.tar.gz tar (child): /dev/sa0: Cannot open: Permission denied tar (child): Error is not recoverable: exiting now gzip: stdin: unexpected end of file tar: Child returned status 2 tar: ports/print/pstotext: Not found in archive tar: /usr/local/src/ports.tar.gz: Not found in archive tar: Error exit delayed from previous errors In the successful test, tar obviously knew which specification was the archive and was able to uncompress it with the z flag. The file specification I am attempting to recover from the archive throws tar completely off. I looked in the handbook and all the examples I found were the more usual procedure of unpacking whole file systems as in tar zxf somedir/archive.tar.gz I'm not having trouble with that use of tar. Thank you. Martin McCormick WB5AGZ Stillwater, OK OSU Information Technology Division Network Operations Group ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Extracting individual Files via tar
My thanks to 3 people who pointed out the error of my ways. I actually had the positions of the archive and the file I was extracting reversed as far as what I was thinking should be the correct order. Then, I thought maybe I didn't need to have the f flag. Anyway, it all works fine now. Many thanks. Martin McCormick "Rob" writes: >You should always use the f option to specify the archive - for example > >tar -tzf archive.tgz > >to list or > >tar -xzf archive.tgz > >to extract. In your example below, you didn't specify an archive so it >defaulted to the device /dev/sa0, which it couldn't open. > >Any extra arguments are treated as archive members - eg > >tar -xzf archive.tgz files/to/extract > >In your example below, it was trying to find 2 files in a non-existent >archive. > >- Original Message - >From: "Martin McCormick" <[EMAIL PROTECTED]> >Subject: Extracting individual Files via tar > > >> The command >> >> tar ztf /usr/local/src/ports.tar.gz >> >> produces a table of contents just like the man page says it should. >> The man page also says that individual files can be recovered or >> listed but I haven't gotten that to work at all. if I try: >> >> $ tar zt ports/print/pstotext/ /usr/local/src/ports.tar.gz >> >> tar (child): /dev/sa0: Cannot open: Permission denied >> tar (child): Error is not recoverable: exiting now >> >> gzip: stdin: unexpected end of file >> tar: Child returned status 2 >> tar: ports/print/pstotext: Not found in archive >> tar: /usr/local/src/ports.tar.gz: Not found in archive >> tar: Error exit delayed from previous errors >> >> In the successful test, tar obviously knew which specification >> was the archive and was able to uncompress it with the z flag. The >> file specification I am attempting to recover from the archive throws >> tar completely off. I looked in the handbook and all the examples I >> found were the more usual procedure of unpacking whole file systems >> as in >> >> tar zxf somedir/archive.tar.gz >> >> I'm not having trouble with that use of tar. >> >> Thank you. >> >> Martin McCormick WB5AGZ Stillwater, OK >> OSU Information Technology Division Network Operations Group >> ___ >> [EMAIL PROTECTED] mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-questions >> To unsubscribe, send any mail to >"[EMAIL PROTECTED]" >> > ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
FreeBSD Port of mrtg Not Happy when Trying to Start
We are moving a mrtg system to FreeBSD so I installed the port from /usr/ports/net-mgmt/mrtg and the installation went flawlessly along with perl5.88 which it needs. When I tried to start it, I got the following taken from a screen capture so you can see the version number, etc: ===> Registering installation for mrtg-2.16.2,1 mrtgfbsd# /usr/local/bin/mrtg /usr/local/etc/mrtg.cfg Can't locate SNMP_util.pm in @INC (@INC contains: /usr/local/bin/../lib/mrtg2 /u sr/local/bin /usr/local/lib/perl5/5.8.8/BSDPAN /usr/local/lib/perl5/site_perl/5. 8.8/mach /usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/perl5/site_perl /us r/local/lib/perl5/5.8.8/mach /usr/local/lib/perl5/5.8.8 .) at /usr/local/bin/mrt g line 292. I did a standard make install on the mrtg port after doing the same for perl5.8 in /usr/ports/lang. One would expect that it should find everything it needs so I may have failed to give it the right options. I am hoping somebody has gotten mrtg to work under FreeBSD6.3 as I am not terribly familiar with it and am setting it up for the benefit of other members of our group who are waiting for it to be running. Many thanks for any ideas or information as to whether or not the port of mrtg should still run under FreeBSD6.3. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Telecommunications Services Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: FreeBSD Port of mrtg Not Happy when Trying to Start
Martin McCormick writes: > We are moving a mrtg system to FreeBSD so I installed > the port from /usr/ports/net-mgmt/mrtg and the installation went > flawlessly along with perl5.88 which it needs. > > When I tried to start it, I just now found out that I should also install the snmp utilities. I thought that mrtg took care of this, but it does not so please disregard the earlier message. I will install net-snmp and see if things work better. Thanks. Martin McCormick ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: FreeBSD Port of mrtg Not Happy when Trying to Start
Jerry writes: > On Mon, 22 Sep 2008 09:54:04 -0500 > Martin McCormick <[EMAIL PROTECTED]> wrote: > > We are moving a mrtg system to FreeBSD so I installed > > the port from /usr/ports/net-mgmt/mrtg and the installation went > > flawlessly along with perl5.88 which it needs. Then, I posted that I had failed to install the snmp utilities so had not done everything necessary. At about that time, I received the message I am partly quoting here. > You might want to check and see if the 'p5-SNMP-Util-1.8.1' port is > installed {/usr/ports/net-mgmt/p5-SNMP-Util}. If not, try installing it > yourself and see if the problem goes away. Thanks greatly. I did in fact not have it, installed it, and the problem is still unchanged. > If you have 'portmanager' installed, you could try: > > portmanager net-mgmt/p5-SNMP-Util -l -p -y I installed portmamager and it reported everything present. > > Check the '/var/log/portmanager.log' to see what transpired. No complaints at all. When installing mrtg, I left the ipv6 box unchecked as we have none, and turned on the snmpV3 support which made no difference. Still the same error: Can't locate SNMP_util.pm in @INC (@INC contains: /usr/local/bin/../lib/mrtg2 /u sr/local/bin /usr/local/lib/perl5/5.8.8/BSDPAN /usr/local/lib/perl5/site_perl/5. 8.8/mach /usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/perl5/site_perl /us r/local/lib/perl5/5.8.8/mach /usr/local/lib/perl5/5.8.8 .) at /usr/local/bin/mrt g line 292. Since this is more or less a "dead in the water" error, I suspect I am doing something in the wrong sequence or am not totally starting from scratch on the mrtg make. I have been doing make clean, then make configure and then make install. There is no problem at all with the make process so I am at a loss as to what to try next. Martin McCormick ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: FreeBSD Port of mrtg Not Happy when Trying to Start
Boris Samorodov writes: > If you install ports at default paths then net-mgmt/p5-SNMP-Util > should install SNMP_util.pm to > /usr/local/lib/perl5/site_perl/5.8.8/SNMP . > Do you have this file? I appear to. $ pwd /usr/local/lib/perl5/site_perl/5.8.8/SNMP $ ls -l total 68 -r-xr-xr-x 1 root wheel 65627 Jun 27 2000 Util.pm -r-xr-xr-x 1 root wheel223 Jun 27 2000 Util_env.pm Martin McCormick ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: FreeBSD Port of mrtg Not Happy when Trying to Start
It appears that the problem of getting mrtg to start may have something to do with perl and libraries. I installed mrtg on another FreeBSD6.3 system today. That system would have worked so I began poking around on both systems and then it hit me. It's terribly obvious after one realizes what is wrong. The problem system complains: Can't locate SNMP_util.pm in @INC (@INC contains: --- and then a ls showing everything else that is there. The working test system does have: /usr/local/lib/perl5/site_perl/5.8.8/SNMP_util.pm The problem system actually has an extremely similar file name: /usr/local/lib/perl5/site_perl/5.8.8/Net_SNMP_util.pm Easy to overlook but still a totally different file name. Gee, what if I just link the missing name to the good file as in ln -s Net_SNMP_util.pm SNMP_util.pm That produced: Subroutine version redefined at /usr/local/lib/perl5/site_perl/5.8.8/SNMP_util.pm line 394. and so on for 22 lines of similar squawks. I did briefly have net-snmp installed on that system but it has been deinstalled unless it left a library or two lying around. There is no need for net-snmp so if I could figure out what it put on and make sure it is gone, that might fix the problem. Martin McCormick ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Wrong Build Environment
After several days of attempting to build mrtg on a FreeBSD6.3 system, I know what is wrong but am not sure what I did to break things nor how to roll back the change. On the broken system, I can deinstall both perl5.8 and mrtg and then do a make install for mrtg which also builds perl5.8 and installs it. When done, I have /usr/local/lib/perl5/site_perl/5.8 but the libraries mrtg needs are not there. Instead, there are very similar files which mrtg is not looking for. On another 6.3 system, I installed mrtg via the same port and it also creates the exact same directory but it contains the correct files. I have not set any environment variables to anything other than the normal settings on either system. Is there a proper way to determine where the make process is going wrong? It is almost certainly some file in /usr/lib that got built wrong that keeps steering the make attempt to populate /usr/lib/perl5/site_perl/5.8.8 with the wrong files. Other than that, there are no complaints during the build process. You just can't run the executable because it can't find any of the files it needs. I can't think what bone-head thing I did to cause this, but I've ruled out problems with the mrtg port or perl5.8. I actually built perl5.8 from a slightly older port, once, and got the same results. The port of mrtg is fairly old and was installed successfully on the system that works and also installed successfully on the broken system except it can't find its libraries. Any ideas? Thank you. A very tired Martin McCormick ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Wrong Build Environment
One of many greatly appreciated suggestions Boris Samorodov wrote: > % grep /var/db/pkg/p5-*/+CONTENTS While looking in that directory, I noticed the good system had net-snmp-5.2.2_1 The broken system had had the wrong version of net-snmp earlier in the week but I remember doing a deinstall which left no net-snmp distribution at all, possibly the problem. The broken system is newer and the net-snmp5x port there is net-snmp5.3x so I installed that. It did lots of things to perl5.8 but when done, I still had the same problem of wrong files in /usr/local/lib/perl5/site_perl/5.8.8. The make all-depends-list output from both systems was identical. Finally, more out of frustration than logical procedure, I got an un-updated port of mrtg whose Makefile was dated in 2007. Next, I went to the broken system and for the ten-thousandth time, did make deinstall. A ls -l of /usr/local/lib/perl5/site_perl/5.8.8 verified that mrtg-related files were gone. I then did rm -r on the mrtg port I had been building with and un-tar'd the older mrtg port. make install ran and low and behold, the 5.8 directory in /usr/local/lib/perl5/site_perl now had the proper list of files. I then put back the newer port of mrtg whose Makefile is dated in June, did a make deinstall and make install cycle and expected to see the problem again. Instead, the perl library changes, most likely based upon the installation of the proper net-snmp package survived and all now appears to be well. Thanks to everybody who helped. This was one of the most puzzling UNIX trouble-shooting adventures I have been on in years. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Telecommunications Services Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Strange Core Dump Error Message on a FreeBSD6.3 System
I am running some C code I wrote on a couple of FreeBSD6.3 systems, one of which has never exhibited this message and the other has now done it twice in about 6 months. The error is as follows: mem.c:877: INSIST(ctx->stats[i].gets == 0U) failed. Abort trap (core dumped) Something obviously is wrong regarding memory allocation but why this one system? Is there anything I can look for in netstat -m that might help me solve the puzzle? Thanks. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Telecommunications Services Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Can an Account be Locked out for ssh but allow su?
Is there a way to configure an account such that one can su - this-account from another login on the system, but not ssh directly in to it from the outside, similar to the way root works if you set the terminal type in /etc/ttys to insecure? The idea is to make a common place for group projects but know who logged in and su'd in to this common space. We don't care if they logged in as themselves via ssh but we do care if they log in as this common user because we then don't know who accidentally deleted all the files or whatever accident one can imagine. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Telecommunications Services Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Can an Account be Locked out for ssh but allow su?
Henrik Hudson writes: > Check the sshd_config man page for AllowUsers and DenyUsers directives. Many thanks. DenyUsers did the trick. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
php5 Only IE Users can View Pages.
I inherited a mrtg application thatnow is running on a FreeBSD6.3 system. Clients report that one can see the php pages when using Internet Explorer but not other browsers that should display the pages. Those customers see raw code. Any suggestion as to what I should be looking for? One of the browsers for sure that isn't working is firefox. Many thanks. Martin McCormick ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Merging Related Information from 2 Tables
This is probably going to be a hashing exercise but I am checking to see if any of the building blocks needed are already out there. The problem is simple to describe in that there are 2 tables. One is a DNS zone transfer table of all the A or Address records in a given zone or from several zones for that matter. the other table is from the same zones and consists of text or TXT records. The only thing the 2 tables have in common is that some of the TXT records share the exact same name field as the A records so we should be able to display the important contents of the A and TXT records on the same line if their names match. The challenge is to do this quickly so some sort of hash function is needed to locate A and TXT records having the same name. Grep does this beautifully for single entries across multiple files, but I need to merge the text part of the TXT record with the IP address and host name from the A record with the same name. The only hard part is finding the quickest way to match the roughly 25,000 host names in the A records with around half as many TXT records. This is basically a bucket list problem in which we can either have an A record name in a bucket by itself or an A record in a given bucket and a TXT record in another bucket with the same name as the A record. In the interest of standing on the shoulders of giants, I am checking to see how much tried and tested tools already exist and how much needs to be home-grown. It is also possible to use egrep to search for A and TXT records in 1 pass through a file in which case one would search from the same file for both record types but the problem is the same. In case anybody wonders: egrep '([[:space:]]IN([[:space:]]TXT[[:space:]]|[[:space:]]A[[:space:]]))' okstate.zone >ATXT.txt The line break here is for Email consideration. The above command should all be on one line. Thanks for any suggestions. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Telecommunications Services Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: Merging Related Information from 2 Tables
Giorgos Keramidas writes: > You should use a Perl or Python script, and a hash... > > If you show us a few sample lines from the input file and how you want the > output to look, it shouldn't be too hard to quickly hack one of those > together. Perl and python-- I wasn't even thinking of that! Thank you. I have installed python now on the FreeBSD system and will start learning it. A records look like: hydrogen.cis.osu. 43200 IN A 192.168.2.123 Text or TXT records look similar except that the data they convey are ASCII text strings of various information that are either read by people or maybe tell servers how to behave toward that particular client. hydrogen.cis.osu. 5 IN TXT "cordell-north,009,192.168.2.123" Our hope is to have an output line looking like: 192.168.2.123 hydrogen.cis.osu "cordell-north,009,192.168.2.123" We will actually run that output through sed to convert the "'s to blanks and also the ,'s to blanks but that is trivial. Thanks for the examples. Martin McCormick ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
sed -f Script Syntax
If you have a sed script that is executable as in the first line starts with #! /usr/bin/sed -f and the following lines are like: /this repetitive line/d /and another repetitive line to go/d This all works great. You just make the file executable and use it as a filter if you want to remove any instance of those lines in text. How does one embed a command in this filter to make sed understand an extended or modern regular expression like: /part 1[[:space:]]text\/html[[:space:]]/d This is normally the -e flag but I haven't figured out how to put it in the script. I would like to either use it to make that one line show up as an extended regular expression or make sed run the entire script in the -e mode. In this particular case, I have made a 14-line script called nuisancefilter that vaporizes annoying blocks of text from Email messages. I have read the man page and it says that this is possible, but I never quite understood how to apply the commands to an executable sed script file. Many thanks. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Telecommunications Services Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: sed -f Script Syntax
Warren Block writes: > sed(1) says it should be -E. Looks like it will only work on the whole > script. Many thanks. I have had -e work many times if you call sed from either the command line or a shell script as in sed -f somefile with somefile being 1 or more lines of sed commands. When the file itself is the script, the first line actually calls sed from within the file. I was just wondering if the sed used in freeBSD had a way to let one put the -e flag in there also. -ef or -fe doesn't cut it: sed: 1: "f ": invalid command code f That was with sed -ef. If you try sed -fe, it bombs with the same complaint only now it doesn't understand the e so there can apparently be only one flag after the -. #! /usr/bin/sed -f -e doesn't work either. Someone wrote me off list chiding me that this is not a freebsd question. Well, I am running this under freebsd and there are sometimes slight differences between bsd-style commands and other flavors of Unix such as Linux. They are not numerous, but try date -r1234567890 under freebsd. You get: Fri Feb 13 17:31:30 CST 2009 Try that same command under Linux: date: 1234567890: No such file or directory That date command wants the string in a file to produce similar results. ping -o under freebsd is incredibly useful when you want to know when an interface comes up. Under Linux and earlier versions of FreeBSD, it does nothing but tell you it didn't understand -o. Again, thank you for answering. Martin McCormick ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: sed -f Script Syntax
My main problem turned out to be that I had -E and -e confused. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Telecommunications Services Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Upgrading Standing Systems from 6.3 to 8.0
Can one upgrade a standing system from 6.3 to 8.0? We do have a few sacrificial systems to try the big upgrade on, but the actual systems are scattered through 3 towns over 200 miles. Not a one is just down the hall so it is all going to have to be done remotely. I am familiar with the process of pointing the cvs-supfile to the target branch and then rebuilding the world. This got us from 5.x to 6.3 with no real issues so how far can one take this and not end up with a brick later? The main thing that can happen which gives nightmares is a situation in which the upgraded system comes up but has insidious problems that don't bite until 03:00 on Sunday morning. Imagine the OS isn't freeing inodes or some other creeping menace that might not be obvious when your newly-built system comes up awith a login prompt and seems ready for business. Thanks. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Telecommunications Services Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
vt100 Strangeness
I have observed the following behavior for several years. When in command mode in vi, the h and l keys move the cursor left and right. If you are computer user that happens to be blind and using a talking console, the l lets you hear each character as you go over it. In freebsd, you do hear the letters and several punctuation marks, but one does not hear the digits for some reason. If you were running the cursor over 139.78.100.1, for example, you hear. . . . The numbers are there and you hear them if you output the screen, but the OS doesn't repaint them digits. Why? I used the screen utility for many years and this masked the problem but I have recently changed to a version of Debian Linux that has speech generation built in to the console. Since there 6 virtual consoles so screen is not as necessary but it is still useful at times. When not using screen, the silent digits are kind of weird when stepping across them and it can even make it harder to know when to stop if correcting them. I have not seen this behavior in other Unix forms. It is not a show stopper, but I would like to have some idea what to change to hear all printable characters. This may also explain why the bell character goes silent in vi. You should hear it when hitting Escape in Command mode and when the cursor hits the end of the line, but it is silent in vi. You do hear it if the shell emits the Bell. You also hear digits as you type them in. It's just if you move the cursor over them that you don't hear the digits. Thanks for any ideas. This is a strange one, I admit. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Telecommunications Services Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: Upgrading Standing Systems from 6.3 to 8.0
Bryant Eadon writes: > Have you tried a test system with this configuration, then upgraded it to > 7.x followed by the jump to 8.0? Run this for a week in advance and see That sounds like an excellent idea. I was afraid I might have to increment through all the 6.x branches which would take a while and then another to go through all the 7.x's. Thanks. Martin ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: Upgrading Standing Systems from 6.3 to 8.0
Robert Huff writes: > Is it possible to have someone swap the hard disks of those > machines? > Because not only are you going to have to upgrade the OS twice, > you're going to have to re-install all the ports. (OK, you may not > _have_ to reinstall - compatibility libraries exist - but it is > clearly the path of greatest reliability.) > It's just as easy to start with a clean installation, which has > other benefits as well. Absolutely true. I pushed for hot-swappable drives back when we ordered these systems which are Dell 2950's, but I didn't get anywhere at all with that campaign. The 2950's have been no trouble to speak of but it makes times like this so much more risky. Martin McCormick ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: Upgrading Standing Systems from 6.3 to 8.0
Robert Huff writes: > Hot swap would be great, but I was referring to regular swap: > human being with a screwdriver and a clue. Reliable outside > contractor, if you absolutely can't send someone in-house. You actually gave me a really good idea. We've got people who I do trust to put in a CDROM or hook up a serial cable. I think I will make up a headless installation CD and send it and a serial communications server to our two remote campuses and have them connect the CS and pop in the CDROM on the system in question. Each FreeBSD box is half of a redundant pair so we can get along without one for a few hours which is probably less time than the upgrade to 7.0 and then to 8.0 would take, assuming nothing went wrong during either of those upgrades. I have seen cvs upgrades take anywhere from 2 to 8 hours, depending on the speed of the system, etc. We can ask them to hook up the CS, make sure it is working, and then have them install the CDROM. I actually did that once before and it worked. When done, we call them back and have them remove the CDROM. That way, it stays in the rack, in one piece with all cables connected and the remote staff is not asked to do as much. Thanks for helping me think through a solution. Martin McCormick ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
64-bit or 32-bit bind and DHCP
We are upgrading our FreeBSD servers to FreeBSD8.0 and most of the servers are 64-bit platforms. At one time, there was an issue in which either bind or dhcpd actually ran a bit slower in the 64-bit version of FreeBSD. Are there any similar issues these days or should I use 64-bit where possible? Many thanks. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Telecommunications Services Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Trying to build 8.0 Headless Installation Disk
I started to use the same strategy that worked in 6.x but it is not working right now. I obtained8.0-RELEASE-i386-disc1.iso and did: mkdir 8.0serial tar xf 8.0-RELEASE-i386-disc1.iso This produced a read-write file system that appears sane in that it seems to be large enough, but not larger than a standard CDROM. The boot directory has loader.conf in it but there is no reference to any console. I added the following: mfsroot_load="YES" mfsroot_type="mfs_root" mfsroot_name="/boot/mfsroot" #add by martin console="comconsole,vidconsole" The CDROM burner is on a Linux system so I used tar to copy the 8.0serial file system over to the Linux system and then: mkisofs -l -R -q . |cdrecord -dev=/dev/hdc - This produces a CD that looks fine in that you can mount it, see all the files, etc. The CD does not boot and the system continues to boot as if there was no CD in the drive. I did burn an unmodified image to a CDROM and the system did hang, waiting for keyboard input so that ISO image does work but I need the serial console to come up on boot as we will be running it remotely. This has worked in the past when necessary, but it appears something changed between FreeBSD6.3 and 8.0 and I must be doing something wrong now. Has anybody gotten an 8.0 CD to come up on the serial console? One thing that has changed between 6.3 and 8.0 is that the tar application does not get confused. In 6.3, there were a couple of files that caused an "out of order" error but the 8.0 CD produced no errors at all. Thank you for your help. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Telecommunications Services Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
/var/named Changes Ownership to Root on Boot
About half of the 7 FreeBSD systems I run exhibit a very annoying behavior that I have not pinned down yet as to why and how to correct it. I reboot. Soon, I find that bind isn't running. It runs as a low-priority process and is owned by bind so it needs to have write permission in /var/named. When I do ls -ld on /var/named, it's owned by root. As I said, several systems do this and several more don't and they are all running FreeBSD6.2 except for one which is FreeBSD5.x. I originally used the stock /etc/rc.d start script for named. After getting the chown surprise on a key system, I hard-coded a 4-line script that just starts bind no matter what. It seemed to work so I was happy even though that is not a proper fix. After our master DHCP server played the chown prank on me yesterday, I added a fifth line to the hard-wire script to chown -R bind:bind /var/named. I guess the switcheroo happens after rc calls that script for I still had a dead bind until I changed it back and started it manually. Some other systems never do the switch and my test box, of course, is one of those so I can't fix what isn't broken. It seems like the boxes that do this are inversely proportional to their importance. Our master DNS did this to me this evening after a reboot so I am asking for an explanation of what I have done wrong to cause this to happen. I even did a sh -x /etc/rc/named and got kind of lost in rc.subr procedures and never saw the attempted switch of ownership. Thank you for any pointers to documentation that explains this as many of the systems in question are up for a year or more at times and we don't get to diagnose their boot process that often. When something fails to start, it's one of those SURPRISE!'s we'd all rather not have when in a hurry to get key systems back running again. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Network Operations Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: /var/named Changes Ownership to Root on Boot
Chuck Swiger writes: >/var/named is owned by root on all of my newer (5.x and later) >systems; I found an old 4.11 box with it owned by bind, though. If >you're using named chroot'ed (as recommended), it will want /var/named/ >var/{dump/log/run/stats} writable by bind. That's pretty much what I have. the log files and all are in /var/named and everything works perfectly if I manually reset the ownership back to bind for the entire tree starting at /var/named. I started seeing the behavior after FreeBSD5 and I did in fact tell the configuration script of the bind port to chroot since that is recommended. I thought that should tell the process to assume the UID of bind and to chroot with /var/named being the root directory. Thanks to you and one other responder, I will have another look at the defaults and see if there is anything I can change. I seem to have unwittingly got some systems set up right and others set up to chown root:wheel /var/named. Martin McCormick ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: /var/named Changes Ownership to Root on Boot
I think I fixed it but I am not sure I would have figured it out quickly without the help from the list. It seems that FreeBSD defaults to a chroot of bind with the tree owned by root. You can run bind in a sandbox as the documentation says and have it chroot but if you do, and heres's the confusion, you had better disable FreeBSD's attempt to make sure the /var/named tree is always owned by root which would be fine if named ran as root. When you run it in a sandbox with a lower-priority UID, you must make sure that at least one more little line appears in rc.conf.local. named_chrootdir="" # Chroot directory (or "" not to auto-chroot it) That's the key right there. If you use lines from rc.conf.local from an older system such as pre-FreeBSD5, you don't need that line and things work fine. If you don't have it on a FreeBSD5 or newer system, /etc/defaults/rc.conf supplies the default version of that line which reads: named_chrootdir="/var/named"# Chroot directory (or "" not to auto-chroot it) and one is seriously messed up from there on during the booting process. I was confused and thought this would all help me keep ownership of /var/named belonging to bind when, in fact, it does just the opposite. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Network Operations Group Chuck Swiger writes: >/var/named is owned by root on all of my newer (5.x and later) >systems; I found an old 4.11 box with it owned by bind, though. If >you're using named chroot'ed (as recommended), it will want /var/named/ >var/{dump/log/run/stats} writable by bind. > >-- >-Chuck > ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Sudo Commands on New 6.2 System Cause Last Login Message.
I noticed that every sudo command I issue is accompanied by a "Last login" message. 25testokcns root $ls .hushlogin ls: .hushlogin: No such file or directory 26testokcns root $sudo touch .hushlogin Last login: Thu Apr 3 11:38:24 from testokcns.osuokc 27testokcns root $sudo date Last login: Thu Apr 3 11:41:10 from testokcns.osuokc Thu Apr 3 11:41:17 CDT 2008 I was trying to see if a .hushlogin file in /root might snuff out the messages, but it had no effect. The commands always work but I would rather not get that message each time. Am I missing something obvious? Thanks. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Network Operations Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Sudo Commands on New 6.2 System Cause Last Login Message.
Steven Friedrich writes: >> 26testokcns root $sudo touch .hushlogin >Well, it IS odd that you're using sudo when logged in as root 8o) I was cd'd to the /root directory, but was logged in as me. It kind of got me there for a second, but notice the $ in the prompt. Interestingly enough, sudo -v doesn't cause this message. >Did you edit /usr/local/etc/sudoers ? >I tried you're commands here and I don't get the Last login message. I am not getting it on most other FreeBSD systems except the newest 2 systems I just finished updating in the last couple of days. >In sudoers, do you have "rootALL=(ALL) ALL" ? Yes. That's where I added all of the users who can sudo. I even copied it out of another sudoers file so as not to miss anybody. The FreeBSD version I am using is FreeBSD 6.2-RELEASE-p11 Interestingly, the system I am on right this minute is the same version and does not exhibit this behavior. Martin McCormick ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Any Known Issues when using both RS-232 and Native Serial Ports?
We have a FreeBSD6.2 system capturing serial data on /dev/ttyd0. /dev/ttyd1 is currently set up for serial console use and we may want to add a third serial port to run yet another serial data capture engine. Since receiving serial data is far more problematic than transmitting it, can anybody think of any particular problem one might encounter if both the data acquisition ports happened to be trying to receive data simultaneously? The serial console port is not really an issue because it will be rarely ever used. Thank you. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Network Operations Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Any Known Issues when using both RS-232 and Native Serial Ports?
I just realized that I failed to mention that the third port would be a USB converter that converts RS-232 to USB. I sent the message before proofing thoroughly. I write: >We have a FreeBSD6.2 system capturing serial data on /dev/ttyd0. >/dev/ttyd1 is currently set up for serial console use and we may >want to add a third serial port to run yet another serial data >capture engine. > > Since receiving serial data is far more problematic than >transmitting it, can anybody think of any particular problem one >might encounter if both the data acquisition ports happened to >be trying to receive data simultaneously? > > The serial console port is not really an issue because >it will be rarely ever used. > > Thank you. > >Martin McCormick WB5AGZ Stillwater, OK >Systems Engineer >OSU Information Technology Department Network Operations Group >___ >freebsd-questions@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-questions >To unsubscribe, send any mail to "[EMAIL PROTECTED]" > ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Questions from a Total samba Novice.
I just found out that I will need to copy some files from a FreeBSD system to a Windows shared drive on our network so that Windows users can have access to the files. After reading a little documentation and talking to a cowworker, I was under the impression that this would allow windows clients to access files on the FreeBSD system, kind of the reverse of what I wanted. Then I read the man page for the samba suite and it says: smbclient(1) The smbclient program implements a simple ftp-like client. This is useful for accessing SMB shares on other compatible servers (such as Windows NT), and can also be used to allow a UNIX box to print to a printer attached to any SMB server (such as a PC running Windows NT). That sounds like I could push a file across when needed and be done with it rather than trying to coordinate the remote users to get the file at some time after I left it in a given directory. Is that just wishful thinking or will it work that way when properly configured? I need to be able to tell others in this group what is possible and that one little paragraph seems to say one can copy out from the UNIX box to the shared drive. Any particular gotchas regarding XP which soon will be Vista in this neck of the woods? I apologize for some of the dumb questions as I do not personally use Windows. I use FreeBSD, Mac and Linux. We have a huge Windows base on our campus, however, so for now, I need to export some log files to the Windows world. Thanks for any useful ideas and for your patience. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Network Operations Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Questions from a Total samba Novice.
Warren Block writes: >Some alternatives have been mentioned, but you might also consider >mount_smbfs(8). I hope I managed to thank each of you who responded as I feel like I know where I need to go next thanks to all the great suggestions. I would have had to enabled nfs client if using mount_smbfs, correct? When I built the system in question, I did not enable nfs capabilities and don't really want to if I can avoid doing so. It sounds like smbclient fits the bill for now, but thanks to all of you for making things more clear. It seems that /usr/ports/net/samba3 gives one a whole boatload of possibilities. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Network Operations Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Removal Attempt of Directory under ZFS causes Kernel Panic
We have a ZFS file system under FreeBSD9.0 running on a virtual machine which had been running flawlessly for a bit over a month when I discovered that I had copied our home directory into /usr/home such that we had /usr/home/home. As root, I cd'd to /usr/home and then typed rm -r home at which point the kernel panicked after removing most of this bogus home directory. It got to one particular user's subdirectory, worked normally for a bit and then that's when the kernel panicked. What we found were normal symlinks and files that, if you make any attempt to delete them or touch them, provoke the kernel panic and crash. If you mount the file system on a rescue disk, it crashes that. We've tried mounting on a debian rescue disk that supported zfs and it didn't crash, but hung. A coworker ran the debug version of our kernel and it complained about values being out of bounds for the several files in question. Basically, in the roughly 20 years of working with unix systems, I have never once seen anything like this. We don't think it has to do with the virtual machine because you can trigger the disaster only by trying to remove the specific files. everything else appears to be working normally including creating and deleting other files and directories. My gut feeling is that it is related to zfs. The bogus home directory was an attempt by me to rsync from the actual hardware system to the virtual system back in November and every file came out owned by root. I got the rsync working properly and forgot about this home/home directory until yesterday when I realized the mistake and tried to delete it. Does this sound familiar to anybody? This is the first zfs installation I have used and I am not real wild about trying it again if we can't solve this mystery. We can't seem to duplicate the problem. Any ideas are appreciated. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Telecommunications Services Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: Removal Attempt of Directory under ZFS causes Kernel Panic
You will see a message on this group from Ryan Frederick who is a coworker of mine and who also posted a question about this same issue. There was a little confusion about which FreeBSD support group had been asked so my question and his are about the same machine. He submitted the stack trace so hopefully somebody can give us an idea as to how this happened. Thank you again. Martin McCormick ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Reading an unknown DAT Tape
This is a case of idle curiosity and not an urgent need to recover a valuable backup. I found an old DAT tape and attempted to read it on the very drive that probably once wrote it and it appears to read the tape properly in that I can use dd to copy it to a file and mt fsf 5, for example, takes the tape to the fifth file marker so there is sanity. Tar, however, does not recognize the format of the archive so it is either something proprietary or I am not using the correct utility on it. I opened it with dd files=2 if=/dev/sa0 of=testfile and then did the strings utility on testfile and got: TAPE SSET VOLB DIRB NACL Setting security iles SPAD DIRB NACL Setting security on system files... SPAD DIRB NACL SPAD DIRB NACL SPAD FILE NACL STAN Jun 23 2003 12:00AM Jan 1 1900 8:45AM Jan 1 1900 9:00AM Note that we are obviously able to read data from the tape as the top few lines are readible as words. The time stamps at the bottom are possibly not time stamps as some of them are not plausible. The dd command never faltered with errors although I did finally stop it manually. Is there any FreeBSD utility that can tell more about what created the original archive? Thank you. Martin McCormick ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Freebsd9.0 and the fgets directive in gcc
I've got some code which I wrote about 6 or 8 years ago that apparently doesn't get along right now with FreeBSD9.0. In the problem code, there is a loop that uses fgets to read a line from a file. It runs properly until the 2708TH iteration and then it dumps core with a segmentation fault. char string0[256]; more lines of code . . . while ( fgets(string0,sizeof(string0),fp_config)) { code to be run for each line } It runs fine until the 2,709TH iteration. Instead of reading the next line, it jumps to the line that closes fp_config even though it is far from read and exits with the segmentation fault. The man page on fgets says that if errors occur while running fgets, one must use perr to see whether the error terminated activity or it was the end of the file. In this case, it is definitely the error. Some observations: The crash occurs on the 2,709TH input no matter how long I declared string0 to be. string0 is over-written each new iteration so nothing should be accumulating that uses up resources. Maybe I am declaring string0 in the wrong data type. Originally, it had been 1024 characters long but 2709 seems to be the C equivalent to the apocalypse and I thought it was supposed to be next December:-) This same code, by the way, also fails at about the same number of iterations if one uses fgetc and builds the line one char at a time. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: Freebsd9.0 and the fgets directive in gcc
Never mind. I may be back with another question, but I figured out that it is not the input loop. I simply removed all the code in the loop except for a variable that counts the number of iterations and just ran thatand it read the entire file so the problem is introduced when assigning values to variables based on the contents of the lines. It is something that worked okay up to FreeBSD8.X but now causes a segmentation fault. Martin McCormick writes: > I've got some code which I wrote about 6 or 8 years ago that > apparently doesn't get along right now with FreeBSD9.0. In the > problem code, there is a loop that uses fgets to read a line > from a file. It runs properly until the 2708TH iteration and > then it dumps core with a segmentation fault. > > char string0[256]; > more lines of code . . . > > while ( fgets(string0,sizeof(string0),fp_config)) { > code to be run for each line > } > > It runs fine until the 2,709TH iteration. Instead of > reading the next line, it jumps to the line that closes > fp_config even though it is far from read and exits with the > segmentation fault. > > The man page on fgets says that if errors occur while > running fgets, one must use perr to see whether the error > terminated activity or it was the end of the file. In this case, > it is definitely the error. > > Some observations: > > The crash occurs on the 2,709TH input no matter how long I > declared string0 to be. string0 is over-written each new > iteration so nothing should be accumulating that uses up > resources. > > Maybe I am declaring string0 in the wrong data type. > Originally, it had been 1024 characters long but 2709 seems to > be the C equivalent to the apocalypse and I thought it was > supposed to be next December:-) > > This same code, by the way, also fails at about the same > number of iterations if one uses fgetc and builds the line one > char at a time. > ___ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to > "freebsd-questions-unsubscr...@freebsd.org" > > ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Remote System Builds
Is there yet any way to remotely rebuild a FreeBSD system? I have two FreeBSD systems on two remote campuses that presently run FreeBSD6.3. They need to be running FreeBSD9.0 and I don't really care how I get there as long as it can be done over the network. If we were physically there, I would put a CDROM in and blow them away since it is such a large jump. I can have staff members there install CDROM's that were remastered to use the serial console, but I am hoping that maybe we are moving past this sort of logistics. I just tried to unpack the 9.0 image using tar which has worked in the past to let one modify loader.conf but I got a bunch of errors this time about files that couldn't be created so maybe this is not the recommended headless installation technique any longer. Any ideas? Thank you very much Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Telecommunications Services Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: Off-Topic: Computing for the Blind
There may be several people on this list who are blind, meaning no usable vision to see a screen. I definitely fit that description so I will gladly try to answer questions which breaks my usual practice here of asking beginner-level questions even though I have been using FreeBSD for almost ten years. The easiest and most economical interface for computer users who are blind is spoken speach. I am not talking about speech recognition where you speak to the computer and it does things, but speech synthesis where the computer runs an application to read what is on the screen back to the person using the system. One can learn to type and touch-typing was tought in schools for the blind for scores of years before computers ever even came on the scene. We pounded on typewriters and our poor suffering typing teachers were the feedback mechanisms that told us how we were doing. So, a person who is blind needs to know how to type. Almost every operating system has a screen reading program or several that one can install that reads the screen back to you. There is a good screen reader for the Macintosh which is included on every single Mac that runs OSX10.X. I like it and the Mac's do run a customized version of BSD unix. The screen reader for the Mac is called voiceover and you can activate it by Command-F5 and then Command-F5 again to turn it off. The only drawback to voiceover is that for those of us who do a lot of tinkering and compiling of source code on unix systems, the screen reader makes listening to the stream of consciousness almost useless because it resets itself each time new output is detected. There is also a lot of really neat things going on in Linux. We have Orca which is the GUI environment and some very good software speech synthesizers for both the GUI and the command line worlds. They tend to handle bursty output from compilers and log tailings better than voiceover but you find that both Mac and Linux screen readers shine in some things and don't do so well in others so there is no clear winner. Finally, there is the Windows world. Microsoft may be actually trying to improve their narrator application to where it is a serious screen reader, but up to now, there is one free screen reader that some people like to use plus several commercial applications that cost an arm and a leg and are always one upgrade away from being snuffed out and causing their owners much grief. None of these screen readers are perfect, but most computer users who are blind end up being reasonably happy with one of them. I personally like Linux and the Mac because there is no additional charge to install the screen readers and they generally won't let you down. There are also Braille displays which some people use but they are extremely costly. I mentioned the speech recognition systems. Many of those actually present problems for those who are blind because you need to train them on your speech and the feedback is graphical so a good old keyboard is still the best input device. So as not to get totally off topic, I haven't heard of any of the Linux screen readers being ported to FreeBSD. That could be a problem for some people and not an issue at all for others. Right now, I am typing on a Linux computer running a software speech engine and I am editing this message on a FreeBSD9.0 system via ssh and using vi on the actual message file. It works great. If that Raspberry Pie Linux system turns out to be able to support one of the Linux screen readers, we're talking about a talking terminal for less than 100 US Dollars. We'll just have to see what happens. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Telecommunications Services Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: Off-Topic: Computing for the Blind
Polytropon writes: > That's correct. However, unlike a Braille readout which > gives tactile information (through the reader's hands), > synthetic voice cannot easily accomodate to the reader's > habits and reading speed. "Scanning text" is not possible > as the generated voiced text is played in "linear time", > which means you cannot easily skip forward and backward, > re-read a certain passage, and you basically do not come > down to the "letter level", you only have a "word level". You are absolutely right on all counts. I was speaking from the standpoint of the amount of work and or extra expense that one would need to go through to get the interface fully operational. Nobody has yet figured out how to build a Braille display that is affordable, let's say 100 US Dollars or less for even one line of Braille much less a whole page or better yet a graphical screen that could display shapes and possibly textures that are not Braille characters. Prices of 5000 Dollars are not uncommon and single-line displays sell for well over 1000 Dollars anywhere you go. What is needed is a way to accomplish a tactile matrix that doesn't require precision machining or hand assembly for each pixel. That's why today's displays are so incredibly expensive and delicate. There are lots of neat ideas such as stimulators you might ware on your fingers as you move your hand over a large area, but making a tightly-packed matrix at almost microscopic level is still a pains-taking task. By the way, math done by any method other than Braille is darn next to useless. Equations in Braille can be formatted very much like they are in print and there is a whole Braille system for reading and writing math. So, I am not disagreeing at all with what you wrote here, just clarifying why I made the statements I made. > While this has benefits in "unconcentrated reading" (e. g. > reading an article or literature", it can be problematic > with scientific or technical text where a (healthy) reader > would let his eyes "jump" within the text stream. The thing I hate the most these days is the lost art of the linear declarative sentence. If the output of a program is some full-screen form in which the information one wants is in check boxes, you have to listen to the whole !%#%00--- thing just to find out whether or not it worked. There are usually one or two things we really wanted to know and the rest is unchanged but must be endured to get the one or two grains of wheat in all that chaff. Since it's full-screen stuff, it is hard to pipe to a script so I guess the artists are happy and the rest of us are just tapping our feet impatiently waiting for the water torture to end. Fortunately, unix operations are still relatively free from the worst GUI parlor tricks, but I use safari on a Mac to access some Windows-centric web sites related to work and they make me want to straighten out a horse shoe without a forge I get so mad at listening to the minutes of audio with the results of what I did always at or near the last of the text and there seems to be no way to stanch the deluge without loosing the gold nuggets. In conclusion, FreeBSD has been another wonderful open-source platform as far as I can say. Many of the systems I run it on here do not have sound cards and are either on virtual boxes, in other buildings or towns and so a speech or Braille console directly on the system isn't possible so I have always used some other device to provide accessibility and never been disappointed. After all, it's unix which means one can expect certain behaviors regarding standard devices. Martin ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Stopping Less from creating Log Files
This is a minor problem but I use "more" to read Email messages from nmh. If one forgets what screen one is in, it is possible to start typing and create a log file of the message in which ever mailbox directory one is reading out of. The man page for more is actually linked to less even though FreeBSD has /usr/bin/more and less. I even tried in the .mh_profile to call more with -Oo/dev/null but if you hit a key, the "logfile" prompt appears and any subsequent key strokes are part of the new file name. This really is only a minor nuisance because it creates junk files that then have to be removed from the directory. So, if there is a way to make more or less not write anything, it would be more or less appreciated. Many thanks in advance. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: Stopping Less from creating Log Files
Lowell Gilbert writes: > The "secure" mode disables log files, but it also changes several other > behaviours, so you may not find it to be an improvement. The code > supports changing those "secure" features separately, but only by > editing the source; if you go that way, it will probably be much easier > to use the ports version of the program instead of the base system's. Very good.Thanks. I looked up what secure mode does and I see what you mean. I will just have to try it and see if I need the ports package or not. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
How to be an imap Client?
This FreeBSD system uses sendmail in normal smtp configuration. I use procmail and nmh to manage incoming messages and it all works great so I don't want to destroy all that. I do, however, need to use imap to send messages from this system through our Microsoft Exchange gateway because some systems use DNSBL and our entire network is on the blacklist so one must send from the gateway which, I guess, must be whitlisted. Is there any FreeBSD-compatible package that will act as a imap client so I can send messages, when needed, through the Exchange gateway and still preserve present smtp functionality? Many thanks. What a mess needing to send one message to one person is turning in to. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Telecommunications Services Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: How to be an imap Client? Solved, somewhat
Ruben de Groot writes: > There is the Mail::IMAPClient perl module (or Net::IMAP::Simple, > perl's about choice ;-) ) Many thanks as this may come up again. In actuality, I was able to end up using simple SMPT mail to use our Exchange gateway. I just set that gateway as a smarthost which I thought I was already doing. I then made nmh generate the from line that we need for such messages and it now is going through the gateway as a smart host. Again thanks. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Modifying Sendmail's Configuration the Correct way.
The /etc/mail/sendmail.cf file very clearly tells one not to edit it directly so I edited the /etc/mail/my.name.domain.mc file as stated in documentation to cause this system to send all out-bound mail through a "smart host." The .mc file part that adds the smart host looks like: dnl Dialup users should uncomment and define this appropriately dnl define(`SMART_HOST', `your.isp.mail.server') define(`SMART_HOST', `mailserver.okstate.edu') After that, I did a make in that directory and things seemed to go well. After restarting sendmail, it still wanted to resolve normally and not use the gateway. The only way we could get it to behave as desired was to do what one is not supposed to do and edit sendmail.cf and add the mailserver.okstate.edu name right against the line beginning with DS After another restart, everything worked. What am I failing to do as this is not the proper way to reconfigure sendmail? The DS line in the master file looks like DSmailserver.okstate.edu Many thanks and the handbook is very helpful but I haven't seemed to run across anything that directly addresses this situation. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: Modifying Sendmail's Configuration the Correct way.
Thanks to all. Somehow, I missed the make install. I will give it another try and it will probably work as it should. This is a great list and everybody is very nice even to those of us who have been running FreeBSD for many years but are trying new things. Greg Larkin writes: > Try these commands, and the sendmail.cf will be updated from the .mc file: ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: How to be an imap Client?
per...@pluto.rain.com writes: > Being a university, okstate.edu has students, most of whom are > not in the CIS department or in any way under control of the CIS > department's sysadmin. Need I say more? Spot on. About 25,000 students and some of them respond to phishing attempts and make other poor management decisions, many of which are done with the best of intentions. > ___ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to > "freebsd-questions-unsubscr...@freebsd.org" > > ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Second Network Almost but Not Quite Works.
The system in question has its primary NIC on one particular network and a default route to the gateway on that network and all of that works fine. I needed the system to communicate fully on two different networks so we enabled the second interface card and it works on that second subnet. You can connect to hosts there and hosts on that network see the new interface. The problem is that it doesn't know anything about the router on that second network. I don't want it to loose the default router but it needs to be fully connected from the second interface as it is a name server and it is about to move from one network to the other. I enabled the second interface as follows: ifconfig fxp1 inet 192.168.1.13 netmask 255.255.255.0 Is the route add command what I need to cause that interface to speak to the router and to hear packets addressed to it from that router? The routing issue seems to be the only connectivity problem that the second interface has. Thank you. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Second Network Almost but Not Quite Works.
The system in question has its primary NIC on one particular network and a default route to the gateway on that network and all of that works fine. I needed the system to communicate fully on two different networks so we enabled the second interface card and it works on that second subnet. You can connect to hosts there and hosts on that network see the new interface. The problem is that it doesn't know anything about the router on that second network. I don't want it to loose the default router but it needs to be fully connected from the second interface as it is a name server and it is about to move from one network to the other. I enabled the second interface as follows: ifconfig fxp1 inet 192.168.1.13 netmask 255.255.255.0 Is the route add command what I need to cause that interface to speak to the router and to hear packets addressed to it from that router? The routing issue seems to be the only connectivity problem that the second interface has. Thank you. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Two Networks on one System
Following up on a question I wrote Friday June 17, a person from this list kindly referred me to the FreeBSD Handbook and the sections on configuring Ethernet interfaces. It has an excellent example as to how to set the default gateway from the command line. I tried it and it worked. Can a second interface such as fxp1 also be informed about the router on its network while we still keep the default route for fxp0? I hope to remotely ping both fxp0 and fxp1's ip addresses from off site and get an answer from both. So far, fxp0 is visible off of its network and fxp1 is only present on its subnet. It appears that you can only have one default route per system and I need this system to appear on both networks for a day or so while we move from one subnet to another. I presently have FW rules for fxp1 that should totally open everything: 00090 allow ip from any to 192.168.1.250 via fxp1 00091 allow ip from 192.168.1.250 to any via fxp1 Obviously, I am still missing something. Thanks for any explanation as I think this sort of thing is fairly common. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: Two Networks on one System
Matthew Seaman writes: > Yes. It's common in the sense that a lot of people think its something > that should work, and get confused when it doesn't prove simple to set up. Thank you. I think I may have stumbled on to what I need to do discussed in the Handbook under the multi-homed host section. We won't be doing any routing between the two networks but I think I have been using the wrong form of the route command as there is an example of something very similar which I will try to see if the second NIC will finally find its router. I appreciate your answer as it clears up a few more questions I had. My thanks also to Gary Gatten >Probably only a single active "default" global ip route, but you can add >network/host routes to prefer a specific interface for said routes. Again thanks to all. I will keep digging. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: Two Networks on one System
I would like to say that I got it working, but after looking at the duel-homed host section of the Handbook, I am still stuck. A Google search turned up a thread from a couple of years ago that almost echoed my exact words. We've got a system with network interfaces on two disjointed networks. No routing is desired, but we very much want for both interfaces to be accessible from the world so each interface has to know about its nearest gateway just as the primary interface knows about the default route. What one seems to always be able to do is get the primary up and talking to the world with no real trouble. The secondary is on its network and you can log in from another host on the same subnet but you can never see it from the world, at large. Before the thread died out, the questioner was wondering if it was simply not possible to achieve this functionality. I am wondering the same. We are moving a primary name server from network A to network B on one of our branch campuses. If the secondary interface was reachable from the world, we can change the whois information and not worry about the exact second the change goes in to effect. The DNS should just answer whether the query came from network A or Network B. The routing is already handled so the system in question just has to be there and respond on both networks for a day or so. We don't have a spare box to run on the new network space or I would have done that days ago.;-( Again, thanks for any ideas. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: Two Networks on one System
Here is what the issue is right now. The remote campus in question has been on number space that was part of our Class B network. They got a block of subnets for their DNS's and campus enterprises and work stations. We secured them their own number space and they are migrating from their portion of our network to their new network and both nets are presented routable from the rest of the world. If you do a whois query for their domain, you get the address on our network of their primary DNS. When one updates the whois data, there is a lag of some hours until new queries start going to the new address of their primary DNS. In the mean time, we don't really care but we would like for the new interface for the primary to be reachable so that the minute the information changes, we're answering lookups. After that point, we will permanently take down the old interface address on our network and probably reboot with the normal configuration now being the new IP address. The problem I have, probably due to a misunderstanding of what I need to do, is easy to describe. The defaultrouter statement in rc.conf or route add default x.x.x.x from the command line sets an interface to know that packets whose destinations or sources that are outside the subnet go to that default gateway. When I set up the secondary interface, I have not been able to come up with a statement or statements that tell fxp1 that it's default router is y.y.y.y so you can't ever reach it from outside the new subnet. Once traffic ever gets in to the system, it will probably stay together based on the interface where it came from, but it won't have to do it for hopefully more than a few hours. I have tried both a second physical connection and an alias and have ended up with the same behavior each time. Since we have the second NIC active, I prefer to use it if I can ever get it to use its router just like the primary interface does. Right now, I can get on to our secondary DNS which is in the same subnet as the new address for the primary and log right in to the primary through the new interface. From anywhere else on the Earth, that new address is as dead as a doornail. I certainly appreciate every posting so far as routing is one of the thorniest issues one can encounter in networking so the more one is aware of, the less head-scratching and frustration there is. Martin McCormick ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: Two Networks on one System
Damien Fleuriot writes: > SOLUTION: > You need a way to reply using a specific route depending on which IP was > requested by the internet user at 50.50.50.50 > > If they queried 100.100.100.53, you need to route through 100.100.100.1. > If they queried 200.200.200.53, you need to route through 200.200.200.1. > > > TECHNICAL IMPLEMENTATION: > pf provides the tools for what you'd like to do, through the "reply-to" Thanks for that excellent explanation. Everybody has been very helpful so now, I at least know what I need to work on and many thanks for the example. I am not quoting the rest of the message, but will save it as I set up the rules. Again, thanks to all. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Rsync and Preservation of Ownership and Permissions
Rsync is a great utility, but is there a way to preserve ownership and permissions if rsync remotely logs in to a backup server as a normal user? The recovery process is run by root but copies all the files from the backup server as a normal user and uses its root capabilities to restore them. What happens now is that all the files end up owned by and in the group of the user ID that copied the information from the client to the server. That's obviously not too useful so I suspect there is a better way than trying to make a remote login to root from another system. Basically, cron starts a backup as root on system A. System A makes a remote ssh connection using the -e flag to backups@server. The system trying to recover the files starts a rsync process as root which remotely connects to backups@server to retrieve the files. In practice, the files come across but every last one of them is owned by and in the group of user backups. Any ideas are greatly appreciated. Thank you. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: Rsync and Preservation of Ownership and Permissions
Michael Sierchio writes: > Does the same user exist on the remote system, with the same uid, etc.? Yes. > If you're using rsync with ssh as the transport, and connecting to the > remote machine as the backups user, that's who will own the files on > its local filesystem... I thought rsync had some encoding it might slip in to the tree that another rsync run as root on the recovering system could use to figure out all those thousands of ownerships and get them all straight, but this makes perfect sense. > You've written a lot of narrative, but show us precisely what commands > you're running. Why would you run the command as root, and ssh as > backups, when you want them to be owned by "normal" ? Because root is the only user who can "see" files from all other users so root starts the process. Here is what I tried. Remember, folks, this will not work! This tries to backup a system named z. ##!/bin/sh #rsync --delete -alHvq --exclude "/proc" // back...@backup-server.okstate.edu:z > You can run the command as root, and use restricted ssh keys (use > authorized_keys to restrict it to executing a specific rsync > command) you can run rsync as a regular user to that user's > account on the remote system... per...@pluto.rain.com writes: > Perhaps you could have rsync log in to a jail on the backup server, > where it could safely be granted root permission. Hmm. It's all rather clear, now. A jailed environment that looks like root is about the only thing that could work. Thank you. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Sample getaddrinfo Code Compiles in Linux but not FreeBSD.
Here is a sample program kindly provided in the Beej's Guide to Network Programming Using Internet Sockets Brian "Beej Jorgensen" Hall The code is said to be in the public domain so it is posted here as it compiles and runs perfectly under Linux but fails in two places with the following errors: I named it nsl.c. nsl.c: In function 'main': nsl.c:38: error: dereferencing pointer to incomplete type nsl.c:42: error: dereferencing pointer to incomplete type You will see that in both places, the code was performing the same operation of assigning a value to a pointer so I am suspecting a prototyping issue but am not sure and hope someone can help me cut through the forest a little more quickly. He did provide suggestions for users of Sunos who have reported errors, but for FreeBSD, the errors did not change. Here is the sample code with the two error-generating lines marked. #include #include #include #include #include #include int main(int argc, char *argv[]) { struct addrinfo hints, *res, *p; int status; char ipstr[INET6_ADDRSTRLEN]; if (argc != 2) { fprintf(stderr,"usage: showip hostname\n"); return 1; } memset(&hints, 0, sizeof hints); hints.ai_family = AF_UNSPEC; // AF_INET or AF_INET6 to force version hints.ai_socktype = SOCK_STREAM; if ((status = getaddrinfo(argv[1], NULL, &hints, &res)) != 0) { fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(status)); return 2; } printf("IP addresses for %s:\n\n", argv[1]); for(p = res;p != NULL; p = p->ai_next) { void *addr; char *ipver; // get the pointer to the address itself, // different fields in IPv4 and IPv6: if (p->ai_family == AF_INET) { // IPv4 struct sockaddr_in *ipv4 = (struct sockaddr_in *)p->ai_addr; addr = &(ipv4->sin_addr);/*error*/ ipver = "IPv4"; } else { // IPv6 struct sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)p->ai_addr; addr = &(ipv6->sin6_addr);/*error*/ ipver = "IPv6"; } // convert the IP to a string and print it: inet_ntop(p->ai_family, addr, ipstr, sizeof ipstr); printf(" %s: %s\n", ipver, ipstr); } freeaddrinfo(res); // free the linked list return 0; } ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: Sample getaddrinfo Code Compiles in Linux but not FreeBSD.
Peter Andreev writes: > #include Many thanks. That made the FreeBSD version work just as well. As soon as I saw netinet.h, I realized it wasn't in the original code as the Linux libraries apparently accomplish the same thing without that header. Martin ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
freebsd-update; What did I do?
I started to run freebsd-update to upgrade a 8.x system to 9.0-RELEASE # freebsd-update -r 9.0-RELEASE upgrade Looking up update.FreeBSD.org mirrors... 4 mirrors found. Fetching metadata signature for 8.2-RELEASE from update5.FreeBSD.org... done. Fetching metadata index... done. Inspecting system... done. The following components of FreeBSD seem to be installed: kernel/generic src/base src/bin src/cddl src/contrib src/crypto src/etc src/games src/gnu src/include src/krb5 src/lib src/libexec src/release src/rescue src/sbin src/secure src/share src/sys src/tools src/ubin src/usbin world/base world/dict world/doc world/info world/manpages world/proflibs The following components of FreeBSD do not seem to be installed: world/catpages world/games world/lib32 Does this look reasonable (y/n)? yes Fetching metadata signature for 9.0-RELEASE from update5.FreeBSD.org... done. Fetching metadata index... done. The update metadata is correctly signed, but failed an integrity check. Cowardly refusing to proceed any further. # What is the next step, here? Thank you. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: freebsd-update; What did I do?
Matthew Seaman writes: > That's a known problem and fixable by first updating your 8.2-RELEASE > machine to the latest patch level before trying the update to 9.0 It appears to be working now. Thank you. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Revisiting Traceroute Through ipfw FreeBSD9.x
I immediately found several plausible examples of what to put in the firewall rules file and the following rules were set just after the local loopback address: ip="139.78.2.13" setup_loopback # Allow traceroute to function, but not to get in. ${fwcmd} add unreach port udp from any to ${ip} 33435-33524 # Allow some inbound icmps - echo reply, dest unreach, source quench, # echo, ttl exceeded. ${fwcmd} add allow icmp from any to any icmptypes 0,3,4,8,11 My thanks to previous posters for these rules. I still, however only get *traceroute: sendto: Permission denied traceroute: wrote 192.168.1.125 52 chars, ret=-1 I also did try: sysctl net.inet.udp.blackhole=0 then 1 and even 2 with no change. What else should I look at? The firewall rules are otherwise working as they should. Thank you. Martin McCormick ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Procmail Decoding Mime Messages
Is there a filter that one can run in procmail in which base64 encoded data go in and text comes out so one can allow procmailrc to do its work? I use bogofilter to filter spam and it does a very good job after one builds a core of spammishness, but legitimate messages are often-times filled with base64 sections that look like garbage to the regular expressions that one puts in .procmailrc for sorting mail. When searching for information, I found something called mimencode which both encodes and decodes these attachments, but there is no FreeBSD port called mimencode so it occurred to me that some other application might exist which is in the ports that does basically the same thing. Is there anything which will take a raw email message and spit out linear strings which can be processed like normal text? Thank you. Martin McCormick ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Strange Failure Mode in FreeBSD 4.11
I built a FreeBSD 4.11 system recently which is to be remotely installed in another town. The system worked on our network while I tested it and installed several ports, etc. We then moved it to the town where it is supposed to live and now, there's big trouble. The Ethernet interface, known as em0 on this system, comes up According to all the messages. If, however, you try to use it, it is as dead as a stone. If I try to ping the local host from root, I get this: ping: sendto: Permission denied ping: sendto: Permission denied ping: sendto: Permission denied I get the same response when trying to ping real hosts over the network. Pinging that system from a known good system is like pinging a disconnected Ethernet jack in that absolutely nothing happens. I am lucky in that I can get in to this system via a serial cable from the known good system so I can see the world from the bad box, but I have frankly never seen this mode of failure before and am at a loss as to what to look at. It had worked perfectly here and all our folks in the other town did was plug it in and hook up the Ethernet. I am glad I sort of have 60-mile-long arms right now, but this is not good. If I do an ifconfig em0, the settings return as they were set in rc.conf. The router address is correct and the fact that one can't ping 127.0.0.1 either tells me that something really nasty happened somewhere along the way. Any ideas as to what I can test next? Thank you. Martin McCormick WB5AGZ Stillwater, OK OSU Information Technology Department Network Operations Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Strange Failure Mode in FreeBSD 4.11
Greg Barniskis writes: >If I'm right, you'll see that something happens, in at least the >target IP address is ARPed for and you should see the target's MAC >in the arp table on the known good system, even if the pings never >return. That should at least give you confidence that the NIC in >question is functioning insofar as it responds to an ARP request. Thanks for your response. I just went in to single-user mode and got em0 to configure (same as before), but now, I can ping another host on the same subnet. I will try all your suggestions and also temporarily turn off ipfw. I did look at the rules and I did remember to change them to fit the new address when the system left here. If that's it, I should have a working system all be it a totally open system. I will let you know what happens. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Strange Failure Mode in FreeBSD 4.11
I found the problem though I haven't found the cause. It turns out that the tcp/ip stack was working all along but ipfw is having trouble. When I list all the rules, I get all the rules I put in, but none of the rules that rc.firewall is supposed to install which are needed for open operation. That does completely disable even local icmp plus just about everything else. My thanks to Greg Barniskis who mentioned ipfw which turned out to be the culprit. Now, I will try to figure out why rc.firewall which is certainly right where it should be is being ignored. Thanks to all. Martin McCormick WB5AGZ Stillwater, OK OSU Information Technology Department Network Operations Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Strange Failure Mode in FreeBSD 4.11
I now realize that what actually happened here is an incorrect setup on my part of ipfw. I actually had a similar problem on another system last Summer, thought I had figured it all out, and have a time bomb waiting if that system happens to reboot since it is set up the same way.:-) In the rc.conf.local, I have: firewall_enable="YES" # Set to YES to enable firewall functionality firewall_script="/etc/rc.firewall" firewall_type="OPEN"# Firewall type (see /etc/rc.firewall) firewall_quiet="NO" # Set to YES to suppress rule display firewall_logging="YES" # Set to YES to enable events logging firewall_flags="" # Flags passed to ipfw when type is a file That makes ipfw load the rules in rc.firewall just fine. In rc.firewall, there is a place where one can include a table of local rules and that's where I am doing something wrong. The place in rc.firewall reads: # filename - will load the rules in the given filename (full path required) So, I have tried various forms of filename /etc/firewall_rules.ns and even filename - /etc/firewall_rules.ns ipfw nicely loads the rules in rc.firewall and then complains about filename not found. I even just stuck the path and file name in a line under # filename - will load the rules in the given filename (full path required) I wasn't surprised when it didn't like that either. If I replace rc.firewall with firewall_rules.ns, then only those rules get added which is why the tcp/ip stack appeared dead. What do I need to put in /etc/rc.firewall so it just includes /etc/firewall_rules.ns like the #include directive usually does? Many thanks. Martin McCormick WB5AGZ Stillwater, OK OSU Information Technology Department Network Operations Group .-- -... . .- --. --.. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Strange Failure Mode in FreeBSD 4.11
Greg Barniskis writes: >This section of rc.firewall refers to valid values you can place in >rc.conf for firewall_type. In rc.conf you can name any of the types >defined in rc.firewall /or/ you can specify a file of your own >(instead of rc.firewall). I don't think you can invoke rc.firewall >/and/ another file you name. That clears things up greatly! Thank you. I'll just make a new file that combines rc.firewall and the extra rules I had and reference that from rc.conf.local. Again, many thanks. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Rescuing the Ethernet Interface after SCB Timeout
One of our FreeBSD systems has begun randomly shutting down its Ethernet interface. After doing so, the box continues to try to run but prints the following errors in syslog: Jan 16 03:01:23 xx /kernel: fxp0: SCB timeout: 0x70 0x0 0x50 0x400 Jan 16 03:01:24 xx /kernel: fxp0: SCB timeout: 0xf0 0x0 0x50 0x400 Jan 16 03:01:35 xx last message repeated 9 times Jan 16 03:01:40 xx /kernel: fxp0: device timeout Jan 16 03:01:40 xx /kernel: fxp0: DMA timeout Jan 16 03:01:40 xx /kernel: fxp0: DMA timeout If we reboot, the system may be okay for 4 months or 2 hours, who knows? I can write a shell script to look for any new messages like those shown above so determining that the failure has occurred is not difficult especially since the system is still running all be it without a network connection. Will bringing fxp0 down with ifconfig and then back up as in ifconfig fxp0 down sleep 5 ifconfig fxp0 up restore it to operation again? I am asking because the system is unreachable when fxp0 is down. If one was logged in to that system, is there anything we could do to rescue it besides a full reboot? I want to make it rescue itself if it can since these things always happen on holidays or weekends or at 03:00 in the morning. This system doesn't die that often, but it is often enough to take measures to prevent it from needing our laying on of hands at odd hours. Thank you. Martin McCormick WB5AGZ Stillwater, OK OSU Information Technology Department Network Operations Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Using dd to Make a Clone of a Drive
After installing FreeBSD5.4, the ISC dhcp server and ISC bind on a hard drive, I wanted to clone that drive to a second drive so as to generate a second server, using what I had already installed as a template. I used the following command: dd if=/dev/da0 of=/dev/da1 bs=512 It turns out that dd defaults to 512-byte blocks so I didn't really need the bs=512, but I am not sure I haven't made some other type of mistake. The dd command has been running for about 4 hours on a very fast system, with a 1-gig processor, 1 gig of RAM and two 31-GB drives. One would think it should have finished by now, but it is still running. Is this a valid method of copying the entire contents of one drive to another? Thank you. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Network Operations Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Using dd to Make a Clone of a Drive
I thought I was limited to only the block size of the disks. I am now trying a much larger block size as suggested and will see what happens. Many thanks. Martin McCormick ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Using dd to Make a Clone of a Drive
Paul Schmehl quotes and then writes: >> Copying with dd(1) is not as fast :) > >Have you tried dcfldd? sysutils/dcfldd Thank you. I hadn't thought of that. This is what I appreciate about groups like this. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Network Operations Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
1,000 Days Up Time Freebsd4.7
We recently had a FreeBSD4.7 system almost make it to 1,000 days uptime. It may have actually done it but it also appears to have rebooted itself just as it reached 1,000 days. Is anybody aware of any kind of counter overflow or anything along those lines that might have caused the reboot? Obviously a system that has been up for that long without a break isn't too sick, but I can't imagine what happened. There are no signs of anything being wrong. After it rebooted itself, it just kept on ticking like it has for the last 2-and-a-quarter years. I looked in /var/log/messages and found no tracks. The last message was a routine message about the dhcp lease it had and then a few minutes later, the next message was the copyright notice on the kernel as the reboot started. That FreeBSD is just wonderful, though. I know of some other popular OS's that can't even dream of that much uptime. Thanks for any useful information. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Network Operations Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
ISO Image for FreeBSD5.4 that is Current
The FreeBSD site has an installation ISO image for FreeBSD5.4 but it is dated last May. There have been several core security updates since then. should I be looking in a different place to find a stable 5.x ISO image that is current? Thank you very much. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Network Operations Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: ISO Image for FreeBSD5.4 that is Current
Lowell Gilbert writes: >http://www.freebsd.org/releases/snapshots.html Thank you. That's what I needed to know. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Sendmail for Large Sites
How well does the administration of Sendmail scale up to sites serving as many as 25,000 users? At this moment, everything is more or less on the table, but what I envision is 25,000 work stations or so, each using Microsoft Outlook and several Sendmail servers serving the multitudes. We might use dns-based round-robin load balancing for all I know. This is all simply a mental exercise at this point, but the hardware is already in place running a commercial package which may have to be replaced if it can't be made to perform properly and soon. I am mainly interested in Sendmail's capacity at this time in order to suggest it as a possibility if it is realistic to do so. There are other considerations such as the facts that all incoming and outgoing messages are checked for malicious attachments. ldap is used to drive the setting of customer mail delivery preferences and even their user ID choice. To use an American vernacular, it is a tall order. Many thanks. Martin McCormick WB5AGZ Stillwater, OK OSU Information Technology Division Network Operations Group ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Sendmail for Large Sites
My thanks to everybody who answered my questions. If we end up doing major revisions to our present mail system, I will have this information to contribute to the discussion. My experience with sendmail is very positive, but very limited. I am well aware that one person receiving a couple of hundred messages a day on one work station is no indicator of how the same MTA might work when hundreds of thousands of messages and bounces are roaring around the mail server every day. Again, thank you all. Martin McCormick WB5AGZ Stillwater, OK OSU Information Technology Division Network Operations Group ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
UNIX-Based VPN Applications
I have been asked as to whether there are any VPN applications that can run on UNIX clients using Linux, FreeBSD, and MacOS. I think the general idea is that they could tunnel in from outside of our campus and receive an IP number on our network. There would probably be a UNIX server on the campus end of the network to accept these connections. Those of us who work here or are students can set up a UNIX box on campus and use ssh in to it from anywhere. What I am asking about is whether there is a VPN application that UNIX-users in general can register with to have a presence on our network. Thank you very much. Martin McCormick WB5AGZ Stillwater, OK OSU Information Technology Division Network Operations Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Best Practice for Allowing non-root Users Access to Serial Port?
What is the safest way to let non-root users access /dev/ttyd0? I notice that in FreeBSD, /dev/ttydx is owned by root:wheel. In linux, the ttySx's are in a special group so the trick there is to add users to that group and make sure the ttyS's are group writable. Here, I want the users to be able to use C-kermit to talk to a remote device without them having to be root. Thank you. Martin McCormick WB5AGZ Stillwater, OK OSU Information Technology Division Network Operations Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Best Practice for Allowing non-root Users Access to Serial Port?
My thanks to all who have responded with this and similar recommendations: Roland Smith writes: >Making kermit users members of a group, and have that group own >/dev/cuaa* with read/write privileges seems like a good idea. > >For instance, create a group "kermit" with 'pw groupadd kermit'. Then >you can use devfs(8) to change the ownership and permissions of the >relevant device: "devfs rule add path 'cuaa*' mode 0660 group >kermit". This setting will not survive a reboot, so you'll have to add the >following to /etc/devfs.rules: "add path 'cuaa*' mode 0660 group kermit". > >Now add the relevant users to the group kermit: >'pw groupmod kermit -m foo,bar,baz' > >Roland ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Best Practice for Allowing non-root Users Access to Serial Port?
Roland Smith writes: >Since you want to dial out, I think you'll need to use /dev/cuaa*. This turns out to be a much better choice than /dev/ttyd0. I forgot about those serial devices completely because I was focused on the ttyd* devices. The cuaa devices at least in FreeBSD4.11 are owned by uucp but are in a group called dialer and have a mode of 660 already set meaning I don't have to do anything but put those who would use them in the dialer group. Problem solved! Again, thanks to everyone who responded. Martin McCormick WB5AGZ Stillwater, OK OSU Information Technology Division Network Operations Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Bourn Shell Scripts that Produce Multiple Files
I wrote a Bourn Shell script which has a while loop in it that reads a file line by line. The output of the script is supposed to go to a file with a different name for each iteration of the loop. This scheme is obviously a rotten idea because all the new files end up created, but quite empty. If I take out the > $newfilename.txt directive, I get the proper output at stdout so the only problem is with changing the file name in the middle of the game several times. I think that either the output gets lost in buffers or I am killing the association between the file descriptor that was first opened and all the new files that get created each time the loop runs. bash doesn't have anything like a fflush(); function, does it? I even tried piping the output through cat as in |cat >$newfilename.txt and even |tee $newfilename.txt which sends the output to stdout and to any files you give to tee as arguments. The results are always the same. When I used tee, I could read proper output being sent through stdout, but those files were still as blank as ever. The man page for bash doesn't even contain the word flush nor does it discuss output buffering regarding redirection or "closing" open files. I actually made the script work by splitting it in to two shell scripts which caused the part producing the output to exit each time. That certainly caused output to go to the proper files, but I think there should be a way to make it all happen from one script. Thank you for any suggestions. Martin McCormick WB5AGZ Stillwater, OK OSU Information Technology Division Network Operations Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Bourn Shell Scripts that Produce Multiple Files
Mario Hoerich writes: >This sounds a bit like a truncation issue. > >If you do something like > >command1 > bar ># some code >command2 > bar > >then the second redirect will truncate the file to 0 bytes >before redirecting the output from command2 into it. Yes. My code was very similar to what you describe only more like: command1 > bar #some code command2 > bar2 #should leave bar alone and open bar2 #Instead, bar and bar2 both end up empty of anything. >Try using >> instead of >, as it appends to the file. What's sad is, I think I tried that but forgot to remove some older versions of the same files created by a less elegant method so it looked like the new files had too many lines in them and I figured that appending didn't work either. I should have cleaned house first and things would have been fine. Appending did solve the problem. >If this doesn't help, please post the script (or a simplified >version thereof). We're not clairvoyant, you know... :) Here is the simplified origin of the problem: #! /bin/sh searchfor () { #line of awk that produces standard output return 0 } while read currentnumber; do #This line does work according to your suggestion. searchfor >>$currentnumber.txt #This line was what I had which opens new files but never fills them: #searchfor >$currentnumber.txt done <~/numbers The value held in $currentnumber.txt changes with each loop iteration so we should be writing to bar2, bar3, etc and leaving bar1 alone. It apparently does not work that way. It reminds me of what happens in C if a program ends without closing an open file for whatever reason. The buffer never gets emptied so the file is left either empty or partially filled depending upon luck and how much data got written to the disk before the abnormal end. My short-term problem is solved so thanks again, but it appears that even opening new files without appending them confuses the shell on previously-opened files such that you do not receive any data in any of the files. Martin McCormick WB5AGZ Stillwater, OK OSU Information Technology Division Network Operations Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
/dev/ttyd0 as an Input Device Works on some Systems but not others.
I wrote a C program that opens /dev/ttyd0 for reading data from an external device. I had beginner's luck because it worked in Linux (actually that device is called /dev/ttyS0) and on the first FreeBSD box I tried it as /dev/ttyd0. The /etc/ttys file had /dev/ttyd0 set to off so there was no login banner and that system has been reading telephone switch logging data 24/7 for over 600 days. I then tried two different FreeBSD servers, each one with 2 serial ports and that's where I ran in to trouble. Here is what I notice. On systems like the one that is working, a test command like echo "hello" >/dev/ttyd0 works fine even if nothing is connected to the serial port. The port can be opened with /dev/ttyd0 as a file descripter and read indefinitely as long as an EOF char isn't received. On the two-port systems I have had trouble with, echoing anything to /dev/ttyd0 causes a total hang of that command that one can't break with anything short of a reboot. I have actually tried two single-port FreeBSD systems and both could read from ttyd0 and echoing output to ttyd0 worked as described. One of the systems is the one that has been up for 600 odd days. The BIOS settings on the two-port systems that won't work this way indicate that the port is on. The other choices are Auto and Off. Any ideas as to the reason for the differences and how I can make /dev/ttyd0 work the same way every time? The dmesg output describing the serial ports from one of the 2-port systems reads as follows: sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0 sio0: type 16550A sio1 at port 0x2f8-0x2ff irq 3 on isa0 sio1: type 16550A Any suggestions are appreciated. Martin McCormick WB5AGZ Stillwater, OK OSU Information Technology Division Network Operations Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
/dev/ttyd0 as an Input Device Works on some Systems but not others.
I posted a question a few hours ago about the strange problems I had been having with some FreeBSD systems and the use of /dev/ttyd0 as an input device for logging data. After searching the FreeBSD handbook, I found the discussion of the "callout ports" cuaaN which do not use hardware RTS/CTS type hand shakes. I remember reading this one other time and thinking it was for modems exclusively but it appears to be what I should have been using all along. What seems to happen is that older systems with one serial port respond to both ttydN and cuaaN work properly. The newer platforms with at least two serial ports need cuaaN if there is to be no hardware flow-control. ttydN calls just hang forever and may or may not unblock if they see DSR from the other system. Martin McCormick ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Is this a Race Condition?
I have a cron job that looks for files in /tmp and other directories that are more than X days old so that they go away and don't keep piling up. Every few days, I get a message like: --- Forwarded Message Date:Fri, 23 Jan 2004 10:51:00 CST From:[EMAIL PROTECTED](Cron Daemon) Subject: Cron <[EMAIL PROTECTED]> find /var/tmp -name NOTESTS -mtime +1 -exec rm -f {} \; find: /var/tmp/okstate.zone.32220: No such file or directory My guess is that find expands the tree but the temporary file is gone by the time the find command actually executes the rm command. The messages are purely random as to the file name and directory. Thanks. Martin McCormick WB5AGZ Stillwater, OK OSU Information Technology Division Network Operations Group ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Is this a Race Condition?
Thank you. Daniela writes: >Yes, that's most likely the cause. ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Open Files
Is there any utility similar to ofiles in FreeBSD that can tell you who has what files open? Thank you. Martin McCormick ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Piping Syslogd Output to a Program
Is there a way to run syslogd such that its output can be sent to a program? It seems like it may be possible based on a passage in the man page in section 8 for syslogd. into a single line of the form ``last message repeated N times'' when the output is a pipe to another program. If specified twice, disable this compression in all cases. That is the only discussion I see in the manual and there appears to be nothing in the FreeBSD Handbook at least when I was looking up references to syslogd. The best outcome will be if one can run syslogd so that it still produces the files it does, but has this extra channel open to another program that I would write which works like a very alert operator that will do X if it sees Y happening. Thanks for any answers or references that can point us in this direction. Martin McCormick WB5AGZ Stillwater, OK OSU Information Technology Division Network Operations Group ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Piping Syslogd Output to a Program
Thank you. I forgot to check that man page. Jimmy Olgeni writes: >Just check the syslog.conf man page and look for the pipe :) ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"