Setting Variables in expect Scripts From Shell Output
While running an expect script, is it possible to set an expect script variable to the string kept in a shell variable? I can generate the shell variable just fine but when I try to export it to the expect script for later use with something like: set LOGFILENAME [exec echo \$TMPFILE] something happens without error, but a later attempt to see the contents of it such as send_user $LOGFILENAME\n proves that it never got set. It just echoes the literal string LOGFILENAME. Thanks. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
FreeBSD6.2 What is the easiest Way to Capture RS-232 Serial Data?
I wrote a C program several years ago that works and logs output from a telephone switch to a file and runs in FreeBSD4.x. I just opened /dev/ttyd0 for reading and it has run for up to 1,000 days at a time, but it also has issues as one might expect. It can be killed if one of the incoming characters happens to be an EOF (4) which is quite possible if somebody umplugs or plugs in the cable and creates garbage on the line. The data from the switch is ASCII with carriage return/linefeed sequences so nothing really harsh goes on, but I need to make it as bullet-proof as possible. In addition, the actual data are 7-bit, odd parity with 1 stop. I basically ignored that fact last time and masked off the MSB of each character and that's how it has been for 5 years. Now, I am writing a similar program to log different data from that same telephone switch and I want to do better this time, but not reen vent any wheels I don't have to. What is the best way to use as much of the existing UNIX environment as possible to listen to /dev/ttyd[x] with no interpretation of incoming data? The data will be dumped at the end of each line, stored in a file, and other action may be taken but normally, the program will just be in a receive-blocked mode, waiting to hear something new. About the only thing I am doing differently this time is trying to set the tty such that it doesn't look for any EOF or other control codes in the data. The data will be treated as raw and what ever comes across is okay. The program will clean it up to make it good for the file. As I stated, the standard /dev/ttyd device has done amazingly well in FreeBSD4.7, but some of that has been dumb luck. We shouldn't have to warn people in the area that they could kill the logger by unplugging the cable since they wouldn't be aware that they stopped it until we found out later when there was nothing in the file. Searching archives dealing with serial communications produced good information about dialup lines and terminals, but this is actually less complex. Many thanks for any good advice about stty or anything else that will allow one to use standard devices for this project. 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: FreeBSD6.2 What is the easiest Way to Capture RS-232 Serial Data?
Warren Block writes: Depending on the switch, you may find that the /usr/ports/comms utilities atslog or cdr_read will do the work for you. Derek Ragona writes: You still need to handle when the cord is unplugged, or put the server in a secure location away from other people. If you want the program to be more capable of staying running you can have the program fork a child and if the child dies, fork a new child. This is the method used for many running services. Just be sure if the child dies the log file is closed and that same file is opened by the new child. Excellent ideas from both! 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]
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]
/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]
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]
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]
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: 6.2 Headless Installs Don't Seem to Work.
Jonathan McKeown writes: (tar now does this, I believe), add the line console=comconsole to boot/loader.conf in the directory which is the root of the CD, and then make a new ISO and burn a new serial install CD. When I do tar vxf 6.2-RELEASE-i386-disc1.iso It mostly works as expected except for the following strange error message observed while extracting: x INSTALL.HTM x INSTALL.TXT x README.HTM x README.TXT x RELNOTES.HTM x stand x sys tar: Ignoring out-of-order file x RELNOTES.TXT x .cshrc x root/.cshrc There is only that one error and I wonder, A. What did I miss? B. Is there a way to work around this? As always, 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: Dell Servers and FreeBSD
Tim Kellers writes: Does anyone have any recommendations or experience with any of the newer Dell servers (2900, 2950 for example) and FreeBSD 6.2 in a production environment? We recently installed Dell 2950's for DNS and DHCP server applications. They work great but some of their horsepower never gets used. one of the boot messages we see is that all memory above 4 gigs is ignored or something to that effect. Here is part of a dmesg capture. FreeBSD 6.2-RELEASE-p2 #0: Tue Mar 13 15:09:34 CDT 2007 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/- ACPI APIC Table: DELL PE_SC3 Timecounter i8254 frequency 1193182 Hz quality 0 CPU: Intel(R) Xeon(R) CPU5160 @ 3.00GHz (2992.51-MHz 686-class CPU) Origin = GenuineIntel Id = 0x6f6 Stepping = 6 Features=0xbfebfbffFPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE Features2=0x4e3bdSSE3,RSVD2,MON,DS_CPL,VMX,EST,TM2,b9,CX16,b14,b15,b18 AMD Features=0x2010NX,LM AMD Features2=0x1LAHF Cores per package: 2 real memory = 3489300480 (3327 MB) avail memory = 3414794240 (3256 MB) ioapic0: Changing APIC ID to 2 ioapic1: Changing APIC ID to 3 ioapic1: WARNING: intbase 64 != expected base 24 ioapic0 Version 2.0 irqs 0-23 on motherboard ioapic1 Version 2.0 irqs 64-87 on motherboard kbd1 at kbdmux0 ath_hal: 0.9.17.2 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, RF5413) acpi0: DELL PE_SC3 on motherboard acpi0: Power Button (fixed) Timecounter ACPI-fast frequency 3579545 Hz quality 1000 acpi_timer0: 24-bit timer at 3.579545MHz port 0x808-0x80b on acpi0 cpu0: ACPI CPU on acpi0 pcib0: ACPI Host-PCI bridge port 0xcf8-0xcff on acpi0 pci0: ACPI PCI bus on pcib0 pcib1: ACPI PCI-PCI bridge at device 2.0 on pci0 pci6: ACPI PCI bus on pcib1 pcib2: ACPI PCI-PCI bridge at device 0.0 on pci6 pci7: ACPI PCI bus on pcib2 pcib3: ACPI PCI-PCI bridge at device 0.0 on pci7 pci8: ACPI PCI bus on pcib3 pcib4: PCI-PCI bridge at device 0.0 on pci8 pci9: PCI bus on pcib4 bce0: Broadcom NetXtreme II BCM5708 1000Base-T (B1), v0.9.6 mem 0xf400-0xf5ff irq 16 at device 0.0 on pci9 bce0: ASIC ID 0x57081010; Revision (B1); PCI-X 64-bit 133MHz miibus0: MII bus on bce0 brgphy0: BCM5708C 10/100/1000baseTX PHY on miibus0 brgphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseTX, 1000baseTX-FDX, auto bce0: Ethernet address: 00:19:b9:af:94:b4 pcib5: ACPI PCI-PCI bridge at device 1.0 on pci7 pci10: ACPI PCI bus on pcib5 pcib6: PCI-PCI bridge at device 0.3 on pci6 pci11: PCI bus on pcib6 pcib7: ACPI PCI-PCI bridge at device 3.0 on pci0 pci1: ACPI PCI bus on pcib7 pcib8: ACPI PCI-PCI bridge at device 0.0 on pci1 pci2: ACPI PCI bus on pcib8 mfi0: Dell PERC 5/i mem 0xd80f-0xd80f,0xfc4e-0xfc4f irq 78 at device 14.0 on pci2 mfi0: 1513 (242761804s/0x0020/0) - Shutdown command received from host mfi0: 1514 (4278190080s/0x0020/0) - PCI 0x041028 0x0415 0x041028 0x041f03: Firmware initialization started (PCI ID 0015/1028/1f03/1028) mfi0: 1515 (4278190080s/0x0020/0) - Type 18: Firmware version 1.00.02-0157 mfi0: 1516 (4278190097s/0x0008/0) - Battery Present mfi0: 1517 (4278190115s/0x0004/0) - PD 08(e1/s255) event: Enclosure (SES) discovered on PD 08(e1/s255) mfi0: 1518 (4278190115s/0x0002/0) - PD 08(e1/s255) event: Inserted: PD 08(e1/s255) mfi0: 1519 (4278190115s/0x0002/0) - Type 29: Inserted: PD 08(e1/s255) Info: enclPd=08, scsiType=d, portMap=00, sasAddr=500180b052f14500, mfi0: 1520 (4278190115s/0x0002/0) - PD 00(e1/s0) event: Inserted: PD 00(e1/s0) mfi0: 1521 (4278190115s/0x0002/0) - Type 29: Inserted: PD 00(e1/s0) Info: enclPd=08, scsiType=0, portMap=01, sasAddr=1221, mfi0: 1522 (4278190115s/0x0002/0) - PD 01(e1/s1) event: Inserted: PD 01(e1/s1) mfi0: 1523 (4278190115s/0x0002/0) - Type 29: Inserted: PD 01(e1/s1) Info: enclPd=08, scsiType=0, portMap=02, sasAddr=12210100, mfi0: 1524 (242772342s/0x0020/0) - Adapter ticks 242772342 elapsed 36s: Time established as 09/10/07 20:45:42; (36 seconds since power on) pcib9: PCI-PCI bridge at device 0.2 on pci1 pci3: PCI bus on pcib9 pcib10: ACPI PCI-PCI bridge at device 4.0 on pci0 pci12: ACPI PCI bus on pcib10 pcib11: PCI-PCI bridge at device 5.0 on pci0 pci13: PCI bus on pcib11 pcib12: ACPI PCI-PCI bridge at device 6.0 on pci0 pci14: ACPI PCI bus on pcib12 pcib13: PCI-PCI bridge at device 7.0 on pci0 pci15: PCI bus on pcib13 pcib14: ACPI PCI-PCI bridge at device 28.0 on pci0 pci4: ACPI PCI bus on pcib14 pcib15: PCI-PCI bridge at device 0.0 on pci4 pci5: PCI bus on pcib15 bce1: Broadcom NetXtreme II BCM5708 1000Base-T (B1), v0.9.6 mem 0xf800-0xf9ff irq 16 at device 0.0 on pci5 bce1: ASIC ID 0x57081010; Revision (B1); PCI-X 64-bit 133MHz miibus1: MII bus on bce1 brgphy1: BCM5708C 10/100/1000baseTX PHY on miibus1 brgphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseTX, 1000baseTX-FDX, auto bce1: Ethernet address:
Re: 6.2 Headless Installs Don't Seem to Work.
Watanabe Kazuhiro writes: Try: console=comconsole,vidconsole boot instead of boot -h. First, thanks for an excellent suggestion. I tried it and have not been successful so far. During the pause, I hit 6 and got control of the boot process. I typed console=comconsole,vidconsole, hit Enter and then the word boot at which time the booting process resumed. It came up in video console mode, completely ignoring the directive. The FreeBSD Handbook has a chapter on Setting up the Serial Console (24.6), which explains the -h and -D flags, the -D flag allowing for a Duel video and serial console. It also has a very interesting passage, quoted here: -D Toggles single and dual console configurations. In the single configuration the console will be either the internal console (video display) or the serial port, depending on the state of the -h option above. In the dual console configuration, both the video display and the serial port will become the console at the same time, regardless of the state of the -h option. However, note that the dual console configuration takes effect only during the boot block is running. Once the boot loader gets control, the console specified by the -h option becomes the only console. End of quote. That hard lockup I described in an earlier message is not what I thought it was. It isn't a lockup for the whole booting process, but a lockout of the serial console. It is as if the -h flag gets turned off after the boot block runs. Either the -h or the -D flags produce exactly the same results. You do get the serial console during the kernel boot as expected and then it reverts back to the local video console just after the message I quoted in an earlier message that says, Trying to mount /root on /dev/md0. This makes a certain amount of sense even if it is the wrong behavior. The documentation says that only the duel mode should behave this way and then the kernel goes to whatever mode -h told it to use. That is apparently what is not happening. If I do just the console=comconsole,vidconsole I get nothing serial at all. When I install a 6.2 kernel and put that command in /boot/loader.conf, it works on the serial port perfectly. All versions of FreeBSD up to 6 did continue to work via the serial port so that one could do the whole installation via that method so whatever broke was introduced in FreeBSD6 if that helps narrow things down any. Thanks for any further suggestions. I did go ahead and enlist the aid of a coworker on this system so the immediate problem is solved, but I have been experimenting with the CD this afternoon to see if the suggestion solved the problem. It should have so this is a bit strange. 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]
6.2 Headless Installs Don't Seem to Work.
As a computer user who happens to be blind, I have always wanted to use the headless installation method to build FreeBSD systems. After FreeBSD version 5, things seemed to go a bit wrong and I am trying to figure out whether it is me not doing something right or if there is a bug. The sequence as I understand it from previous documentation is to boot the CD, wait for the lull in activity and then hit the number 6. After that, you type boot -h and the serial port usually comes up. On some systems, it comes up at the wrong speed which turns out to be 115,200 baud, but it does come up. What then happens after that is what I am writing this message about. The kernel on the CD boots but then it can't seem to find the hard drives and the whole process is dead on arrival with a spew of errors about not finding any media followed by a lockup. If I have a cowworker help me and run the install off the new system's video display, all is well and we get a good FreeBSD installation. Can anybody think of a way to get the headless install to work in FreeBSD 6.2? Many 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: 6.2 Headless Installs Don't Seem to Work.
I posted the original message about the 6.2 headless installs. I tried again on an IBM Netfinity server with SCSI drives today and here is the last screen of boot messages from the CDROM burned from the 6.2 ISO image: sio1: configured irq 3 not in bitmap of probed irqs 0 sio1: port may not be enabled vga0: Generic ISA VGA at port 0x3c0-0x3df iomem 0xa-0xb on isa0 Timecounter TSC frequency 996849208 Hz quality 800 Timecounters tick every 1.000 msec md0: Preloaded image /boot/mfsroot 4423680 bytes at 0xc0af6544 acd0: CDROM CRN-8241B/1.25 b at ata0-master PIO4 Waiting 5 seconds for SCSI devices to settle ses0 at ahc0 bus 0 target 8 lun 0 ses0: IBM FTlV1 S2 0 Fixed Processor SCSI-2 device ses0: 3.300MB/s transfers ses0: SAF-TE Compliant Device da0 at ahc0 bus 0 target 0 lun 0 da0: IBM-PSG DDYS-T09170M M S9HA Fixed Direct Access SCSI-3 device da0: 160.000MB/s transfers (80.000MHz, offset 63, 16bit), Tagged Queueing Enable d da0: 8678MB (17774160 512 byte sectors: 255H 63S/T 1106C) da1 at ahc0 bus 0 target 1 lun 0 da1: IBM-ESXS DTN036C1UCDY10F S23J Fixed Direct Access SCSI-3 device da1: 160.000MB/s transfers (80.000MHz, offset 127, 16bit), Tagged Queueing Enabl ed da1: 34715MB (71096640 512 byte sectors: 255H 63S/T 4425C) Trying to mount root from ufs:/dev/md0 This is always the last message before a hard lockup at which time the party is over. If we reboot and do not do the headless install, the installation works properly. 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: Remote Execution of sudo Command Hangs.
Christian Walther writes: Try using pseudo tty allocation with your ssh command, it's the -t option. So, use ssh -t remote.system.domain sudo dhcpreset as the command. That worked perfectly. If this doesn't work directly, you can even try several ts. I had best results with -ttt. This is great to know. The only difference besides the fact it now works is that one sees a closed-connection message like what you see when you ssh to another system and spawn a shell because that seizes tty's also. It just hadn't occurred to me before that you don't seize a tty on the remote system when you remotely run an ssh command. 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]
Please Help with Confusion about ipfw rules. Solved.
fbsd2 writes: I use the sample ipfw rules with keep state as shown in the handbook they do work fine. They just aren't meant for the kind of load they were under. I needed to know how to get the same functionality by other means. If you use the keep-state directive, high traffic can basically kill ipfw by running it out of dynamic rule space. People on this list don't have ESP so they can't read your mind about what rules you have coded. But they can read down to where it says: ${fwcmd} add pass all from any to ${ip} 53 and ${fwcmd} add pass all from ${ip} to any 53 It turns out that I didn't catch on to the need for supporting the reply traffic that each of those two rules generate. This stateless set of rules solved the problem and does not use up dynamic rule space. ${fwcmd} add allow ip from any to ${ip} dst-port 53 ${fwcmd} add allow ip from ${ip} 53 to any // allow reply traffic ${fwcmd} add allow ip from ${ip} to any dst-port 53 ${fwcmd} add allow ip from any 53 to ${ip} // allow reply traffic ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: awk question
n j writes: Or awk only i.e. no sed: awk '!(/^$/) { print $(NF-1) }' user.csv That's right. I originally suggested the sed and then was thinking about it as I walked home yesterday and knew that awk could test for the blank line condition before committing suicide.:-) Martin ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Remote Execution of sudo Command Hangs.
We have 3 FreeBSD systems. One is trying to use ssh and sudo to run commands on two other systems. The remote command being executed is: ssh remote.system.domain sudo dhcpreset dhcpreset is an expect script most of which is shown here: spawn $env(SHELL) expect -exact \# send -- date\r expect -exact \# #body start send -- cd /usr/local/etc\r expect -exact \# send -- /usr/local/etc/zap dhcpd\r expect -exact \# send_user Stopped [exec hostname] dhcpd at [exec date +%y%m%d%H%M%S ].\n\r send -- /usr/local/sbin/dhcpd -q \r expect -exact \# send_user Partially restarted [exec hostname] dhcpd at [exec date +%y%m%d%H%M%S ].\n\r send -- tail -1f /var/log/syslog\r expect -exact peer moves from communications-interrupted to normal send -- $CONTROL_C #body end expect -exact \# send_user Fully restarted dhcpd at [exec date +%y%m%d%H%M%S ].\n\r send -- date;exit\r expect eof The script works perfectly if you run it from a login shell on the system where it actually lives as in: sudo dhcpreset. If you run it via ssh from a remote system, however, it runs, produces the proper status messages and does its job and then . . . . . . You have to hit a Control-C to kill off the ssh connection which doesn't drop on its own. I think my script must somehow make sudo not see the exit. Even though you see the dhcpd -q process started as a background process, dhcpd daemonizes almost immediately and you even see the completion message in a log of the activity so it isn't that. Besides, it exits properly when called locally. Other remote commands using sudo properly exit. Any idea how I might figure out what is hanging things up? If you do a ps on the remote system, the expect script has ended. On the calling system, you still see ssh to the remote system. Reading the expect manual shows an exit command but also says that it is implied when the end of the script is reached. I have tried it with and without that command at the end with no effect. Thanks for any other suggestions for making this command terminate when done. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Please Help with Confusion about ipfw rules.
This is a situation where I thought I knew more than I actually do. I set up a new domain name server with a client-type firewall after having tested it first, but there is nothing like hundreds of thousands of packets per hour to show the weak spots. I made the mistake of setting up keep-state rules both coming and going and I now see ipfw complaining frequently about too many dynamic rules. All I am really trying to do is give crackers a lot of nothing to look at when scanning the ports on the system. It isn't doing any NAT or routing, etc. I am not sure if I really need any keep-state rules. The DNS needs to be accessible to the world and be able to talk to the world on port 53 and that is all as far as bind is concerned. What I am confused about is when I actually need keep-state rules and when a simple rule like: ${fwcmd} add pass all from any to ${ip} 53 and ${fwcmd} add pass all from ${ip} to any 53 That theoretically should leave port 53 wide open to all types of in-bound and out-bound traffic. Fortunately, the new system is still working, but I am afraid we might be dropping some packets so I need to modify the port 53 access. Thanks for your help. 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: awk question
Don Hinton writes: On Thursday 26 July 2007 15:26:02 Peter Boosten wrote: P.U.Kruppa wrote: awk '{print $(NF-1)}' user.csv Yup, those blank lines will kill it for sure. A sed filter to remove blank lines ahead of the awk statement should allow it to work properly. 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: The worst error message in history belongs to... BIND9!
Paul Chvostek writes: This is actually just the difference between sh and bash. You'll see the latter error if you type `a = 5` in bash in any OS. It just so happens that most Linux distributions don't have a real sh: I kind of thought that was the real issue. While something like this is maybe slightly annoying at times, the differences in, say, arithmetic handling and loops can sometimes mean rewriting parts of shell scripts depending on whether it is going to run in BSD or Linux. Martin ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: The worst error message in history belongs to... BIND9!
Jeffrey Goldberg writes: I still remember as a newcomer to Unix a long long time ago getting Bad magic number In retrospect, I suspect that I'd typed ld where I'd meant to type ls. I have been doing things on Unix systems since about 1990 and the thing I run across that makes me ready to split a brick with my bare hands to this very day is the not found message one can get in a badly written shell script such as the following: #! /bin/sh a = 5 that's enough to make it happen. Run that, and you get: a: not found Interestingly enough, if you run that same script in a Debian Linux environment, you get: ./testfile: line 2: a: command not found Most of you will probably instantly see what I did wrong in that there shouldn't be any spaces between the variable name, the = sign and the 5 which could be anything else. I just picked a 5 for the heck of it. If you are in a big messy shell script, just seeing a: not found Doesn't tell me much except I know it's not working. The problem could be either that there is a typo or it could be that $a is null. I usually find that I snuck a space in and didn't even think about it at the time. I don't know if error messages from other OS's are off limits, but some of the ones from the most widely-used OS on Earth are treasures. How about running a gigantic piece of commercial software that does God knows what on your computer, and getting an error like: The software has performed an illegal operation. I bet there is a second line that they had to print in text using the same forground and background color so as to keep from getting fired that reads: Now, try and find it. Ha ha ha ha! Then, there is the ultimate, the Check engine. light on the modern car. It would be so nice if it said some indication as to the seriousness of the problem so that one knows whether to get it fixed now and maybe save $5,000 worth of repair costs or let it slide a few days until a better time. I like the quotation I read once that said that Unix is a user-friendly operating system. It is just particular about who it makes friends with. 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]
Can a Cisco Device use RSA authentication for SSH
A person in our group is trying to scp files from a Cisco IOS device to a FreeBSD work station. The Cisco box uses an RSA key and sshd on the FreeBSD system won't recognize the algorithm. The error message on the Cisco side of things looks like: 39: Jun 5 14:13:59.623 CDT: SSH2 0: hostkey algo not supported: client ssh-rsa, server ssh-dss Is there a safe way to make this work? 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]
Can't Figure out What I Did to Our Environment FreeBSD6.2.
I discovered that the file utility works for some accounts on a new FreeBSD system but not others. When it doesn't work, the response is: file: could not find any magic files! If I am su'd to root, me, or any of several other accounts on the system, I get that same error. Still other user ID's in the same class can use file just fine. The /etc/profile file is used to develop the users' paths so most of them are the same plus added local paths if someone has $HOME/bin or $HOME/etc. Any other suggestions at what I should look at? This is one of those dumb things that is driving me crazy today.:-) All I know is I probably caused this but I am at a loss as to how. The man page for file says that MAGIC can be set to the location of one of the .mgc files. None of the accounts that do correctly use file have this variable set. At least you don't see it in the output of env. Thanks for any suggestions. 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: Can't Figure out What I Did to Our Environment FreeBSD6.2. fixed
Roland Smith writes: Maybe the ownership and/or permissions of /usr/share/misc are wrong? I checked against another system that isn't having any trouble and found the permissions to be exactly the same. I then ran strace -e trace=file to see what all it opens when being run. Bingo! It opens a file in one's home directory called .magic. I had created a file called .magic in all our home directories for a totally unrelated purpose, never dreaming that somebody else was looking for that name. It doesn't even need to exist because file only uses it if it is there. Since our .magic has nothing that the file utility recognizes, it breaks. I named our .magic file to something else and everything began to work perfectly. The reason why some accounts worked before and others didn't is that not every single account had this rogue .magic file I had made for another purpose. Thanks for your help and my apologies for wasting your time. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
FreeBSD with Duel Processors
Is there anything special I need to do to make FreeBSD6.2 make use of both CPU's on a Dell 2650 mother board? The boot messages indicate that the OS knows about the 2 CPU's. Is this correct? I heard some rumors that one has to give some sort of kernel directive but I haven't found anything yet. This system will be a secondary DHCP server. Many thanks ACPI APIC Table: DELL PE2650 Timecounter i8254 frequency 1193182 Hz quality 0 CPU: Intel(R) XEON(TM) CPU 1.80GHz (1794.19-MHz 686-class CPU) Origin = GenuineIntel Id = 0xf24 Stepping = 4 Features=0x3febfbffFPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM Logical CPUs per core: 2 real memory = 1073676288 (1023 MB) avail memory = 1041784832 (993 MB) 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]
Any Way to Plug This Hole in Local Sendmail Delivery?
First of all, I think sendmail is great, so this is a minor issue. The problem is that the spammers can cause local delivery of their junk by using the name of an account on the system. As an example, I just received some junk that a human being can instantly tell is bogus. It's from line is the usual sort of bogus hotmail, or AOL or MSN, forgery but then there is this line which is, I am sure, how it got in. From: Weekly News [EMAIL PROTECTED] Milter-sender used to catch these constantly, but that filter is no longer available. Is there anything else that is useful, but not too disruptive that can either refuse delivery or send it to spam to die? I already run bogofilter which I trained with about 12,000 or more spam messages and which does a good to excellent job of catching most of this, but messages that claim to be local but aren't should be mechanically testable. 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]
php5 and SQL Scripts
About 4 years ago, we installed php from the FreeBSD ports collection on a system in order to query a MS-SQL data base on another server. It worked fine until we upgraded to FreeBSD6.2 and php5. I had moved the old binary across and also pulled several libraries in to /usr/local/lib and the old binary seemed to be happy until we actually tried to use it at which time it hung until manually killed. After installing /usr/ports/lang/php5 and even trying /usr/ports/lang/php4, our new php gives the following error: Fatal error: Call to undefined function mssql_connect() Has anybody in the FreeBSD world seen this before and better yet, how do you fix it? We do a little piece of a back-end operation which gathers information from a web application and uses it to create or remove rules in a firewall. The folks who own the rest of the pieces of the operation are asking frequently if it is fixed yet. I am out of things to try. Obviously, something changed between our older system and the present because the object is either here but in a wrong directory or I didn't pick the right configuration options in setting up the port. The sql script has worked fine until now for all these years. Any ideas are much appreciated. 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: php5 and SQL Scripts
Bill Moran writes: Don't know what you're doing with all that moving binaries around, but make sure you didn't overwrite something. If you did, you may need to completely reinstall PHP. First of all, thanks to all who replied. I missed the php5-mssql port, thinking that php5 was all I needed. The moving binaries phase was after we moved to a new platform and I rebuilt all our directories. I had carefully used tar xfk to recover /usr/local/bin from our previous system. For the 2 or 3 libraries I brought over to make the php binary work, I checked before copying to make sure there was nothing of the same name. When I discovered it didn't work, I looked at /usr/ports and discovered the php4 and php5 ports and did, in fact, properly build php. Now, php is hanging again which makes me think there is a problem between this system and the SQL server we communicate with. Our campus had Spring Break week before last and lots of systems were upgraded and or modified. It's like trying to find that one dead Christmas tree lamp in a series string of 100 which is killing the whole string. Martin McCormick ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Can cvs-sup Safely Upgrade a 5.3 System to 6.2?
The system is on, but not in production so I would like to upgrade it before we use it. Many 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]
Can cvs-sup Upgrade a 5.3 system to 6.2?
The system is up and running, but presently not in production. 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: Sendmail on a new Freebsd6.2 Won't Send or Receive. Solved!
Ted Mittelstaedt writes: sendmail_enable=YES in /etc/rc.conf? Many thanks. That's exactly what I had, but after looking at it again, I also had something much worse in the startup line. This new system is a replacement for the one I am on now and the name is similar. The rc.conf.local file was copied from the old system and this part looks like: sendmail_enable=YES # Run the sendmail inbound daemon (YES/NO/NONE). # # If NONE, don't start any sendmail processes. sendmail_flags=-L sm-mta -bd -q15m -C/etc/mail/dc.cis.okstate.edu.cf # Flags to sendmail (as a server) That was the problem. The file name referenced there doesn't exist on the new system. When I used the right configuration file name, all is well. Again, thanks for your help because it made me look everything over once again and find the problem. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Trying to Upgrade Version of Tar on a 5.3 System.
I am transfering all our working group files from a FreeBSD5.3 platform to a bigger, faster and FreeBSD6.2 system. I discovered that bsdtar on the 5.3 system doesn't appear to have the --newer-than feature in which you only archive files newer than either a given date or a reference file such as the last monster tar ball from, say, /usr/home. The plan was to copy the monster tar ball over which has happened without problems, and then do a second pass just before we shut the older system down and pick up everybody's files which have changed in a hopefully much smaller tar ball which can then be overlayed to bring everything up to date as to what it was on the old system. The ports collection has gtar and freetar and the older system is using the bsdtar that unpacked from the iso image so it would not be productive to try to install what I already have as there is nothing wrong. Will either freetar or gtar give me the capability to use a reference file to only get the new files that have either appeared or changed since yesterday? Is there another way to use the existing tar that I might have missed that does the same thing? 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]
Sendmail on a new Freebsd6.2 Won't Send or Receive.
I have just set up a new freeBSD6.2 system which should be fully capable of sending and receiving mail via sendmail. The processes are all running. It acts like inetd.conf has the ports closed, but there aren't any specifically for smtp. /etc/services has smtp ports listed and all open like they should be. If you telnet to port 25 either from another system or from the localhost, the connection refused message is immediate and no log entries in maillog are generated. The only entries being generated at all are routine messages when the queue starts and messages that say that a given message is deferred due to not being able to be delivered so it appears to be stuck both directions. Any suggestions on what else to look at? 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]
DHCP Server V3.0.5 No BPF under chroot. Works normally otherwise.
I found some cook-book instructions for running dhcpd in a chroot environment. The article is 4 years old and appears to be set up for FreeBSD5x, but it isn't far off for FreeBSD6.2 which is what I need dhcpd to run on. Dhcpd runs fine when started normally as in /usr/local/sbin/dhcpd. I haven't yet gotten it to launch as the chroot'ed version. When one starts it, here is what happens: chroot /usr/local/chroot/dhcpd /usr/local/sbin/dhcpd Internet Systems Consortium DHCP Server V3.0.5 Copyright 2004-2006 Internet Systems Consortium. All rights reserved. For info, please visit http://www.isc.org/sw/dhcp/ WARNING: Host declarations are global. They are not limited to the scope you declared them in. Wrote 0 deleted host decls to leases file. Wrote 0 new dynamic host decls to leases file. Wrote 0 leases to leases file. No bpf devices. Please read the README section for your operating system. If I do a ls, everything looks identical: cd /usr/local/chroot/dhcpd/dev ls -l bpf* crw--- 1 root wheel0, 96 Mar 6 11:44 bpf0 crw--- 1 root wheel1, 97 Mar 6 11:44 bpf1 cd /dev ls -l bpf* crw--- 1 root wheel0, 96 Mar 5 21:00 bpf0 crw--- 1 root wheel0, 97 Mar 5 21:00 bpf1 The part of the script that makes those devices is as follows: BPF=`ls -l /dev/bpf0 | awk '{ print $6; }' | sed -e 's/,//g'` export BPF BPF1=`ls -l /dev/bpf1 | awk '{ print $6; }' | sed -e 's/,//g'` export BPF1 cd /usr/local/chroot/dhcpd/dev mknod bpf0 c 0 $BPF mknod bpf1 c 1 $BPF1 chmod 0600 bpf* I will post the script when it works since it appears to be about 90% good. It needs a little touch-up to make it work for FreeBSD6. My guess is that there is something else I need in the chroot environment since the bpf appears to work normally when dhcpd is run from root in the traditional way. My thanks and a lot of credit to the person who originally wrote this script which can be found at Linkname: Screaming Electron Forums - How to chroot your existing isc-dhcpd server on freebsd Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Network Operations Group URL: http://screamingelectron.org/forum/archive/index.php/t-837.html ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
What cvs-supfile Directive did I Leave Out?
I originally wanted to bring the ISO image of FreeBSD6.2 up to date using cvsup. Everything worked perfectly including the make buildworld, make installworld, make buildkernel and make installkernel. Then was when I realized that I was now running FreeBSD7.0 after having unwittingly upgraded. This particular system will be a very busy dhcpd server, however, so I probably don't want the bleeding edge. It is a Dell 2650 and FreeBSD6.2 was the only ISO image of FreeBSD that found all the right drivers. I probably need to go back to what I initially meant to do for safety sake. Since this was my first successful attempt at using cvsup, my questions now are: Can I safely downgrade back to the most stable version of 6.2 using cvsup? What did I do wrong in the cvs-supfile I used? upgrades are great if you want them, but this is going to be a production system so I would rather try the latest and greatest on a less-important box. All I wanted was sources, no ports or X; basically what you would have after using an ISO image. Thanks. The cvs-sup file follows: *default tag=. *default host=cvsup15.us.freebsd.org *default prefix=/usr *default base=/var/db *default release=cvs delete use-rel-suffix src-all 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: What cvs-supfile Directive did I Leave Out?
Erik Trulsson writes: Maybe, but I wouldn't count on it. I would recommend reinstalling 6.2 from scratch and starting over again. Thank you and thanks to Fred Condo who also responded. I guess the only thing I can salvage from the last day's work is knowing that cvsup is a good resource when used carefully. I was kind of afraid that I would need to start from scratch because there may be hidden gotchas due to libraries that shouldn't be there, etc. I guess since the system did come up working, I could experiment with the shell script I am building to update 6.2 and then save it to another system before starting over on Monday. Also, thanks for the correction on the cvs-supfile. We have 3 boxes scheduled to go in service that are all the same type of server which means that they will all be getting the CDROM initial install and then hopefully the security patches and bug fixes via cvsup. 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 anoncvs Site to Update 6.2 Sources
After installing FreeBSD6.2 from the ISO image, I figured that cvsup would be the best way to update the new system and apply the patches which have come out since the image was created. I think I have cvsup ready to go, but I can't tell for sure since the mirror site I picked was the first one in the list for the United states. It is anoncvs.FreeBSD.org and is obviously quite popular. cvsup tried all night long to connect and never got in . The next mirror site for the US is anoncvs1.FreeBSD.org and it appears to be down. Since all I need is to update all the sources for FreeBSD6.2, is there a better choice of sites? I got these 2 site names from the FreeBSD handbook. We have been using FreeBSD here since 2001, but I have never seriously tried cvsup until now since we are installing several new servers, all using FreeBSD6.2. 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: Best anoncvs Site to Update 6.2 Sources
Kevin Kinsey writes: The mirrors are in the form cvsupN.freebsd.org. I use cvsup12, cvsup13, cvsup6 from SW Missouri (and my upstream links go through NE Oklahoma, dunno if they are close to you or not). Probably close enough. It will probably work when I connect to the right site. It might be worth the time to install /usr/ports/sysutils/fastest_cvsup to help find the fastest/nearest servers for your installation area. Great idea! Thanks. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: vmware Questions
John Nielsen, referring to running multiple DHCPD's, writes: For what you're talking about, jails make a lot more sense than virtualization or emulation. Thank you! That is exactly the kind of input I was looking for. As soon as I read yours and Frank Staals' mention of jails, it clicked. A true jail will have a little version of as much of the FreeBSD world as dhcpd needs to run. This should be much easier on resources and more predictable as to results. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
vmware Questions
If one has a FreeBSD system that has 1 gigabyte of RAM and a 1-GHZ processor, would it be possible to run a couple of vmware instances of FreeBSD? I want to set up a DHCP server on each virtual machine and configure one to be optimized for DHCP failover and dynamic leases while the other is dedicated to static bootp service. It would be much easier for the 2 instances of dhcpd to run in separate machines, so to speak, since they normally use the same named files for logging and configuration. What sort of a performance hit does one usually see on a virtual machine? When we run dhcpd on a normal FreeBSD system of the type described above, the system is normally loaded around 0.05 or so so it isn't having to work too hard. Thanks for any help as to what vmware port is best. The platform is FreeBSD and the 2 virtual machines will also be FreeBSD if that makes any difference. There will be no X windows involved, just hopefully 2 DHCP servers running as if they were on two separate boxes. Any information to point me in the right direction or reasons why this is not a good idea are appreciated. 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]
mysql5.1-server Refuses to Start.
If one does a Google search on the following error message from the mysql server, there is a long and painful discussion ona mysql mailing list in which lots of people have had the same exact problem. The solutions, however, were for Sun Work Stations and a similar solution I tried here, had no effect at all. I am trying to start mysqld in safe mode on a FreeBSD5.4 system in such a way that only local users can access it. The suggested command for this is /usr/local/bin/mysqld_safe --skip-networking --user=mysql The mysql server is defaulted to use /var/db/mysql and that is where it appears to initially be happy. The mysql directory is chowned to be owned by the user mysql and it does start creating new table files: 070201 10:30:55 mysqld started /usr/local/libexec/mysqld: Table 'mysql.general_log' doesn't exist InnoDB: The first specified data file ./ibdata1 did not exist: InnoDB: a new database to be created! 070201 10:30:55 InnoDB: Setting file ./ibdata1 size to 10 MB InnoDB: Database physically writes the file full: wait... mysql creates a couple more files and then disaster strikes! 070201 10:30:59 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist 070201 10:30:59 mysqld ended I do have a my.cnf file in /usr/local but it only contains one line which doesn't change anything. basedir=/var/db/mysql It seemed to already default to this directory. The datadir variable which some of the posters mentioned is no longer needed. Has anybody gotten sqld_safe to work in FreeBSD? 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]
What Happens When /proc is not Mounted in FreeBSD5.4?
I made a startling discovery when using strace to trouble-shoot a different problem on a freeBSD5.4 system that has been running since last October. Both it and another new 5.4 system had a /proc mount point but no process files. The mount point had the May 5 date from 2005 as do most files from that distribution. I mounted /proc the way it is done in fstab for 4.x systems proc/proc procfs rw 0 0 and there were all the process directories. The only reason I had done this was because strace won't work without /proc. Nothing else had seemed wrong and there hadn't been any compelling reason to look at /proc until now. Would an unmounted /proc make the system run slower since proc files allow for examination of the operation of the running processes? So basically, I have fixed the problem if it really was one in the first place. 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: What Happens When /proc is not Mounted in FreeBSD5.4?
Kris Kennaway writes: As you have found, proc is almost entirely unused in FreeBSD apart from one or two debugging facilities, and in fact not recommended on multi-user systems because the long history of security vulnerabilities. Thanks to you and Fabian Keil for your succinct answers. I took it back off and commented out the line I added to /etc/fstab so it can be brought back temporarily when needed but isn't just sitting there waiting for lightning to strike. 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: Spam and Viruses, Vandalism-l, the Mailing List from Hell.
Paul Schmehl writes: Uvscan is McAfee's antivirus product. Did you install it? There's a conf file in the files directory of that port. It defines AVSCANNER as /usr/ local/bin/uvscan. That would require that you have McAfee Antivirus for FreeBSD installed. If this machine handles lots of mail, I wouldn't suggest you use that. Uvscan launches a shell for each time it's called, and it will suck a lot of cpu and memory (based on our extensive comparison testing.) Thank you very much. I was a little fuzzy about how the mcAfee product with its data base got there or what it looked like, etc. It is probably not worth the extra load to have antivirus-milter on there although I see now that had mcAfee been there, it would have probably done its job. I am the only major inbound Email account on that system, but it is a rather busy workhorse for our group and is already busy enough that one notices slowdowns at times and, when we check, it is all legitimate. In this business, paranoia is a virtue. Again, thanks for your help. 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]
Spam and Viruses, Vandalism-l, the Mailing List from Hell.
Has anyone gotten the port /usr/ports/mail/antivirus-milter to work? The system in question runs FreeBSD5.4 with sendmail and bogofilter. Bogofilter is excellent at helping sort messages in to spam or other folders if you generate a large wordlist. One category of junkmail, however, is not true spam. It is more a form of hacking in that it tries to implant viruses like Johny Appleseed only this guy is Johny weedseed. I got antivirus-milter to make and install but it immediately failed when started: antivirus[53446]: externalcommand() failed to execve() /system/av/decullotage/uvscan I basically said, huh? After that, it hung and began telling all remote hosts to try again later. The url http://www.nmt.edu/~wcolburn/antivirus/ is no good any more and there was very little documentation in the package so I reset everything back to before the installation. This would have been a good counterpart to bogofilter since the virus bombs usually get past bogofilter. The ripmime utility extracts the payload and antivirus-milter is supposed to reject the message before delivery. The other milter I found is milter-bogom. It is probably fine, but it duplicates bogofilter's function on a system-wide basis. Any ideas are much appreciated. 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]
Trouble-shooting Cron Problems FreeBSD5.4
After building a new FreeBSD5.4 system, I have done something bad to it. When cron runs jobs in /etc/crontab as operator, it seems as if that 6TH field in /etc/crontab is being interpreted as a command rather than the user ID it is supposed to run under. I keep getting messages like: From:[EMAIL PROTECTED] (Cron Daemon) Subject: Cron [EMAIL PROTECTED] root newsyslog root: not found Comparing this system with another properly-functioning 5.4 system has, as of yet, shown nothing unusual. If I become root and manually run the job in question, it runs without a complaint. The crontab file on the problem system is an exact copy of the crontab file on the working system. Both crons appear to be running with the same flags as in 465 ?? Ss 3:24.39 /usr/sbin/cron -s Any suggestions as to what I should look at next? Both systems' crons are showing the same environments if I make them run the env command. Many 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: Trouble-shooting Cron Problems FreeBSD5.4
Dan Nelson writes: The operator user has no access to /etc/crontab. You have probably copied entries from the system crontab (i.e. /etc/crontab) into a user's crontab. The system crontab has the extra user column, where user crontabs don't (since they always run as the user). Thank you. That is exactly what happened. I checked the working system by doing crontab -e -u operator and there was no crontab there at all. I then went to the ailing system and, voila, there was the copy of /etc/crontab complete with all its comment lines. I remember being confused at one stage about /etc/crontab because of the line \# /etc/crontab - root's crontab for FreeBSD After all, the root user also has a crontab file with the normal user fields (minus the special 6TH field). Somewhere along the way, I probably typed either crontab -u operator crontab from /etc or did a crontab -e -u operator and joined /etc/crontab in to the new table. Remember the saying that goes, Nothing can be made foolproof because fools are so ingenious? That pretty well says it all. I am not sure how I figured it might need to go in the operator account, but that's where it wound up. I am sure that solves the problem. I'll know in 15 minutes when the next newsyslog command fires and I don't get the squawk.:-) 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]
Leapseconds and zoneinfo
Several months ago, I rebuild the zoneinfo data bases on the freeBSD systems we have to be ready for the new Daylight Saving Time or Summer time rules. I got the leapseconds file and the North American data base and used zic to build a new version. The first time I did this, I included the leapseconds data base in to the command as in zic -L leapseconds northamerica What I got was a file slightly larger than the current version of localtime which, in the Central Time Zone is a copy of /usr/share/zoneinfo/America/Chicago. I didn't think much of the difference since it is a replacement for what was there and installed it. The local time was 23 seconds behind what it should be. There have been 23 leapseconds added since 1972, I think, so I figured we didn't need to have them in there. After recompiling the data base without the leapseconds, each system's UTC seconds perfectly matched the local time's seconds which is what is supposed to happen. Then, we come to today. I was experimenting with a FreeBSD system and noticed that the date;date -u commands yielded time stamps that were off by 23 seconds, but in the other direction. This time, I ran the command in the form you see above, with the leapseconds, and now that system's seconds perfectly match between UTC and Central time (CDT in Summer and CST) in Winter. Why would this one system which is an old 266 MHZ Pentium running FreeBSD 4.10 be different? Another old Pentium running FreeBSD4.7 needed the leapseconds removed before it gave the correct seconds for both UTC and Central time. I did verify that Chicago was the same file on the odd system as it was on all the normal ones, normal being that the seconds are correct for both UtC and local. So, for some reason, about 5 FreeBSD systems work properly without the leapseconds data base and one needed it. Why? It would stand to reason that all the systems need the leapseconds since that agrees with the rules for calculating correct time. 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]
Why csh on Root?
Is there any particular reason why FreeBSD has csh as the default root shell? Nothing really wrong with it except that I quit using csh about twelve years ago and so am a little rusty about the finer details when I come across a csh shell. On a number of FreeBSD4.x systems, I used chsh to change root's shell after installing bash and the only thing I noticed was that one should be careful of the $PATH variable and make sure it at least hits all the same directories in the same order. Other than that, it worked. On a recent upgrade to 5.4, I noticed the C shell is still default so I figured I would ask before changing it so as not to introduce hidden problems later. Basically, I like bash better and also add a couple more paths such as /usr/local/etc for home-grown applications. Thanks for your thoughts. 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: Why csh on Root?
RW writes: There is an alternative uid 0 user called toor which you can use if you want to use bash as root. OTOH hand there is a school of thought that you shouldn't be too comfortable as root. My thanks to all. On all the systems in question, bash ends up on the same partition as root, but the points are well-taken. One thing I was trying to accomplish is to have a bell in the root prompt. In the .cshrc file is a string set prompt=\007\!# I have also tried replacing the \007 with the actual Control-G and even a \a. All produce an attempt to render a bell but what is sent to the remote terminal is ^G1# as in the actual ASCII characters ^ and G. I am not sure what to do to correct this problem as I do not get it in bash. A \a or \007 is sent literally. The env output for root on this system shows no environmental variables that should inhibit the beep so I am kind of stumped. 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: Why csh on Root?
Alex Zbyslaw writes: set prompt=hello%{^G%}there where ^G is a single control char, not two chars. Thanks. It works perfectly. I am reading the man for tcsh again to attempt to figure out what I missed the first time. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
A Question of How to Handle Numerical Notation
I am writing a program on a UNIX system to munch the text output of a Cisco VOIP call manager and turn those data in to something that looks like the output of our hard-wired PBX. Fortunately, the data we need are a subset of all the data available so the main problem is simply that of reformatting most of the information. There is, however, one nasty little problem I have discovered. Both the UNIX and Cisco platforms handle time and date functions using unsigned 32-bit integers. No problem there. The times are based upon the number of seconds since the epoch of January 1, 1970 in GMT or UTC. That's great. I discovered soon, however, that there is an extra wrinkle that really messes things up quite a bit. The Cisco call manager outputs the hexadecimal form of 3 values in something that initially looks like good old hex but is good old hex being used to convey some form of notation, probably like scientific notation, that one must decode in order to get the actual hex values needed to recover the data. All we know for sure is that this has something to do with SQL and Microsoft. After all, everybody uses Microsoft and UNIX doesn't even exist, right? Does anybody know what this notation is called? Does an explanation of the algorithm exist in public so one can convert the strings that are part of the call manager output in to the unsigned ints that actually carry the right values? An example of the string in question looks like: 370A65FA-6965-4E40-A0DA-EC88DE6B I appreciate any constructive suggestions, anything from what this notation is called to a description of how to process the 5 values. That would make writing C code possible to convert them in to the actual binary string that contains the data we need. Are there any FreeBSD libraries we can use to help the process along? I am sure this notation has a name, but not knowing it, makes searching for information about it rather difficult. Many 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: A Question of How to Handle Numerical Notation
Chuck Swiger writes: On Oct 6, 2006, at 4:26 AM, Martin McCormick wrote: Does anybody know what this notation is called? Does an explanation of the algorithm exist in public so one can convert the strings that are part of the call manager output in to the unsigned ints that actually carry the right values? That sure looks like a UUID, which may or may not encode valid time information. My thanks to you and to one other individual who have written responses to my questions. Both have suggested the same possibility that this is a UUID and not the data I am actually looking for. I will talk to the people who extracted the file and see if there is a possibility we got the wrong data in that field. One would hope that the time stamp data are normal 32-bit values that can be sucked in by a %lx in sscanf. 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: A Question of How to Handle Numerical Notation Solved
Those of you who recognised the example string I sent as a UUID really helped solve this problem. What happened was that the algorithm I wrote to parse the CSV values in each record is broken when it encounters a blank field as in ,, so it fails to increase the index counter and place a null string at that point. This meant that what I was reading as field W was actually more like field Z. I was actually looking at a field labeled pkid or Packet ID which is the UUID you saw. The algorithm I wrote to parse worked perfectly on the first line of the file because every field was populated but it silently failed on lines of real data because of blank fields. 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]
Cron [EMAIL PROTECTED] /usr/libexec/save-entropy
I must have dome something wrong setting up a FreeBSD5.4 system, but I haven't a clue as to what. The script is called save-entropy, a great idea, but it acts as if lots of the configuration it needs is missing. I do have ipfw running and it got all the rules I put in to it via a rule-setting script called in rc.conf.local but the message that cron generates every eleven minutes shows that something is very unhappy. For now, I simply commented out the save-entropy run for a bit of peace and quiet, but the entropy is now not being updated which is not a good thing. What do I need to look at to fix this properly? Thank you. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Network Operations Group --- Forwarded Message Date:Fri, 22 Sep 2006 08:55:00 CDT From:[EMAIL PROTECTED] (Cron Daemon) Subject: Cron [EMAIL PROTECTED] /usr/libexec/save-entropy ipfw: not found That repeats 15 more times. --- End of Forwarded Message ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Cron [EMAIL PROTECTED] /usr/libexec/save-entropy
Martin McCormick writes: I must have dome something wrong setting up a FreeBSD5.4 system, but I haven't a clue as to what. This is still Martin McCormick. I haven't found exactly what I did yet, but I remembered that I do have a second 5.4 box and it appears to be fine so I can probably solve this after some digging. Sorry to waste anybody's time. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Has Anyone Else Tried mha-mhedit?
I use nmh and recently wanted to not have to manually clean up all the garbage that gets in to the quoted text if you quote a HTML message or one that has a lot of 8-bit junk like Microsoft OUtlook messages do. It looked like I needed mhonarc so I installed the port with no problem. Each time I try to use mha-mhedit to reply to a message full of mime and 8-bit characters, I get the following error: open2: exec of w3m -dump -cols 76 -T text/html failed at /usr/local/etc/mha-mhedit line 104 mha-mhedit is a perl script. The results form a blankrepl form that looks like: To: Recipient.com Subject: Re: FW: Budget Cuts ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ /home/martin/Mail/draft: unmodified: line 1 I am not sure if I am doing something wrong or there is some sort of bug at work here. I launch it using the example from the mha-mhedit man page: repl -editor mha-mhedit Any constructive suggestions are much appreciated. 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: Has Anyone Else Tried mha-mhedit?
Giorgos Keramidas writes: It looks like mha-mhedit tries to run the www/w3m browser to dump a text-only version of the HTML document, and then quote this as the original. Do you have the w3m port installed? If not, there is probably an option to tell mha-mhedit to use another browser with similar capabilities. Thank you very much. That was the problem but the text of the error message threw me off. I did not have w3m installed but it all worked as soon as I did that. I have lynx installed and maybe some experimentation is in order to see if lynx would work, but it appears to work properly with w3m. Again, many thanks. That will certainly save some typing energy in the future. Martin McCormick ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
How to Change the Time Zone Rules?
The rules for determining the yearly start and end of daylight saving time in the United States have changed beginning in March of 2007. All the FreeBSD systems I am in charge of need new rules and I read an article that mentions FreeBSD and Linux and the /usr/share/zoneinfo data base which I found. In that directory are subdirectories for the continents and many binaries describing the rules for major cities or islands. /etc/localtime is a copy of whichever locality file in /usr/share/zoneinfo correctly mirrors one's local time. The problem, as I see it, is that we need a new America file. I ran across an article that referenced ftp://elsie.nci.nih.gov/pub/tzdata2006h.tar.gz Which turns out to be the source file for making all the location files. My question is, How do I get there from here? That file is obviously #included or otherwise used in something you make to generate the objects. Has this already been done somewhere for FreeBSD and will it work on systems ranging from FreeBSD4.7 up to 5.4? I use FreeBSD on our domain name and dhcp servers and want to get them ready well before this mini Y2K-like situation hits. Many thanks. For those who may be wondering, DST ends as it has for many years, on the last Sunday in October so the new rules don't take effect until March 11 of 2007. 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: How to Change the Time Zone Rules?
Carlos A. Carnero Delgado writes: See zic(8). It's very easy. DAve writes: This was sent to me earlier on this list when I had to adjust for Indiana changing to DST. Worked like a champ. https://engineering.purdue.edu/ECN/Resources/KnowledgeBase/Docs/20060128100824 Thank you both. This is what I needed. 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]
Trimming Whitespace From Beginning and end of Text Lines
This looks like something sed should be able to do, but I haven't had any luck at all. I wanted to remove any whitespace that has accidentally gotten added to the beginning or end of some lines of text. I made a test file that looks like: left justified. lots of spaces. and the best I have done so far is to get rid of about 3 spaces. Attempt 1. #! /usr/bin/sed -f s/ \+//g s/^ //g s/ $//g This looks like it should do the job, but the leading and trailing spaces are still mostly there. I wrote another script. Attempt 2. #! /bin/sh sed 's/^[[:space:]]//g' \ |sed 's/[[:space:]]$//g' If I cat the test file through this script, it also removes one or two spaces, but not all the leading and trailing whitespace I put there. I can write a program in C to do this, but is there a sed script or other native application in FreeBSD that can do this? 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: Trimming Whitespace From Beginning and end of Text Lines
Chuck Swiger quotes and writes: Giorgos Keramidas wrote: This fails to remove multiple occurences of the [[:space:]] class. There are at least the following ways: sed -i -e 's/^[[:space:]]*' -e 's/[[:space:]]*$//' file ... That did it! As soon as I saw the *, I knew what I was not doing. perl -pi -e 's/^\s*(\S.*\S)[ \t]*$/$1/' file ... The first one seems more straightforward to me most of the time, but there are times I find Perl's `-pi -e ...' idiom very convenient. It is, and I wish to acknowledge the above are entirely valid solutions to the problem, but... python -c 'import sys; print sys.stdin.read().strip()' file... ...has the advantage of being human readable. My old 300-baud accoustic modem used to generate output which in hindsight looks astonishingly close to regex character classes. :-) Wow! I'd almost forgotten some of that by-gone era. I had a 1200-baud modem that, in conjunction with the clock slips between our local telephone company and our PBX, used to march [] and various other garbage characters that did look just like regex. You just had to keep re-dialing until you finally got a connection that worked. Thanks to everyone for the help. 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]
Bourn Shell -n Flag Questions
I read about the noexecute flag or -n flag which is supposed to check the syntax of a Bourn Shell script to see what it would do if run, but not actually do anything. This sounds like a wonderful thing, especially when one is going to run a dangerous script and you only get one chance to get it right. I tried sh -n scriptname and it always silently succeeds even if I type sh -x -n somescript. I even deliberately created a script with a syntax error in it and tried sh -x -n again. It still did nothing but exit. Does this just not work or am I misunderstanding the purpose of the flag? Thanks for your help. 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]
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]
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]
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]
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]
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]
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]
Re: Expect-5.32.1 and Hangups when Spawning a Shell
Rob writes: Ports has now a more recent expect (5.43.0), which I use That definitely is the better route. This particular system is in use 24/7 by our group and once was a version or two ahead of the FreeBSD that our DNS's and dhcp servers were using. Time and a complete failure of a hard drive on our master DNS last Summer means that it has version 4.11 and the rest need to catch up or go to version 5.x or 6.x. 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]
Expect-5.32.1 and Hangups when Spawning a Shell
Has anyone seen a condition in FreeBSD4.7 in which expect-5.32.1 randomly hangs when spawning a shell? I got this idea from running autoexpect: spawn $env(SHELL) Then, I would look for the prompt and begin executing commands. About every 20 or 30 times, no shell spawns and the script just hangs there with 1 virtual terminal seized until someone kills the process. Since the particular expect script is run automaticly, one can run out of tty's in a few weeks if this happens often enough or one doesn't clean house regularly. What I recently tried is to set conservative mode to 1 so it will output data more slowly although I can't imagine how this really helps. Strangely enough, it has been several days since I made the change and I haven't had to zap one single expect script. Is that just coincidence or could the timing of the spawn command actually matter? Remember, this is before the shell ever starts. Here is what the beginning of the script now looks like: #!/usr/local/bin/expect -f if {$force_conservative} { set send_slow {1 .1} proc send {ignore arg} { sleep .1 exp_send -s -- $arg } } spawn $env(SHELL) match_max 10 expect -exact bash-2.05b# When it fails, the prompt never appears. Any ideas as to why this occasionally happens or whether my slow-down of the typed output should help is much appreciated. 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: Regular Expression Trouble
Parv writes: For even finer results, use word boundaries ... egrep '\bIN[^[:alnum:]]+A\b' file egrep '\IN[[:space:]]+A\' file I sincerely thank all for your examples which I have saved for future reference. The word boundary test appears to work perfectly, but after looking at all the other examples, they should work also giving living proof that in UNIX, there are many perfectly valid ways to solve the same problem. Again, 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]
Regular Expression Trouble
After reading a bit about extended regular expressions and having a few actually work correctly in sed scripts, I tried one in egrep and it isn't working although there are no errors. I was hoping to get only the A records from a dns zone file so the expression I used is: egrep [[:space:]IN[:space:]A[:space:]] zone_file h0 Had it worked, all that would have appeared in the h0 file was all the A or Address records. Instead, I get those plus almost everything else in the file. It is obviously not filtering correctly. Plain grep produces a 0-length output file so that is not too useful either. Putting double quotes around the RE didn't help either. It seems to match almost everything. Thanks for any good ideas. 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]
UNIX System Certification Programs
As part of the formalization process for our carreer paths, our organization is wanting us to be certified in our areas of expertise as part of any on-going carreer path. Since I do all my work in Linux and FreeBSD, what sorts of programs are there that would be similar to the Microsoft certifications which are extremely common in the Windows world? I would want to try to keep it as close to what I really do, both for honesty's sake and since the knowledge gained would be valuable, to say the least and the closer it fit me, the better. The best way to describe what I do would be to say that I use UNIX systems to solve technical problems. While DNS is my primary responsibility, I notice that I have spent a good portion of my carreer, here, coming up with UNIX-based automation solutions to problems that individuals in my group or groups we are close to are trying to solve. Such situations as mining system logs for patterns that mean trouble and either alerting others of the pending trouble or actually rectifying it, are a daily part of my job. Using UNIX tools such as awk, grep and C to shave time off of mine and other people's work also describe what I do. Please tell me any thoughts you might have. Stating that I've been messing around with UNIX systems for about 14 years probably won't get me very far.:-) Thank you. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer 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]
I've Created a Permission Problem which Baffles Me.
On this particular system, the /var and /var/tmp directories certainly look like they do on other FreeBSD systems that don't have this problem. Script started on Tue Sep 13 15:36:59 2005 bash-2.05b$ cd / bash-2.05b$ ls -ld var drwxr-xr-x 20 root wheel 512 Aug 31 14:44 var bash-2.05b$ ls -ld /var/tmp drwxrwxrwT 3 root wheel 512 Nov 11 2004 /var/tmp bash-2.05b$ cd /var bash-2.05b$ cd /var/tmp bash: cd: /var/tmp: Permission denied bash-2.05b$ exit exit Script done on Tue Sep 13 15:37:38 2005 For the life of me, everything looks like it should and like it does on other similar systems. I can even log in as me and cd to /var/tmp with no problem. If I su to the user ID whose shell the script was created in, however, /var/tmp is off limits which breaks vi. The userid in question is a normal UID and should have access to all the resources that any non-root user gets. Thank you for any help. 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: I've Created a Permission Problem which Baffles Me.
Alex Zbyslaw writes: Looks to me like you've taken away x bit for other (otherwise the t would be lower case). x permission on directories allows you to search that directory. Try chmod o+x /var/tmp (as root). Thank you! I did and the T changed to t, fixing the permission problems. If I was teaching a UNIX class, that would be a good brain buster. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
5.4 Headless Installation from FreeBSD Disk 1?
I am attempting to install FreeBSD5.4 on a Dell Poweredge 1850 via the serial console. I went through the documentation again and found the following on the FreeBSD 5.4 documentation in installation-i386.txt FreeBSD/i386 5.4-RELEASE Installation Instructions -- snip -- 1.5.6 Tips for Serial Console Users If you'd like to install FreeBSD on a machine using just a serial port (e.g. you don't have or wish to use a VGA card), please follow these steps: 1. Connect some sort of ANSI (vt100) compatible terminal or terminal emulation program to the COM1 port of the PC you are installing FreeBSD onto. 2. Unplug the keyboard (yes, that's correct!) and then try to boot from floppy or the installation CDROM, depending on the type of installation media you have, with the keyboard unplugged. 3. If you don't get any output on your serial console, plug the keyboard in again. If you are booting from the CDROM, proceed to step 5 as soon as you hear the beep. 4. If booting from floppies, when access to the disk stops, insert the first of the kernX.flp disks and press Enter. When access to this disk finishes, insert the next kernX.flp disk and press Enter, and repeat until all kernX.flp disks have been inserted. When disk activity finishes, reinsert the boot.flp floppy disk and press Enter. 5. Once a beep is heard, hit the number 6, then enter boot -h and you should now definitely be seeing everything on the serial port. If that still doesn't work, check your serial cabling as -- snip --- According to that, the CDROM still has the headless option. On this particular server as well as all the other FreeBSD boxes we presently run, removing the keyboard causes the BIOS to indicate a non-functional keyboard but the FreeBSD boot engine doesn't get the message so we always had to have a keyboard in the past in order to type boot -h and that did get the serial console going, often-times at 115,200 baud, but nonetheless going. On 5.4, I made several attempts both with and without the keyboard and never got a beep. I got a monitor and a coworker who can see said monitor to watch the video output and we tried again both with and without a keyboard. Both times, it goes right to a GUI without any opportunity to do anything except watch it boot. I see that the 5.4-RELEASE-i386-bootonly.iso and the 5.4-RELEASE-i386-disc1.iso images are both bootable. I figure I need disk1 to install with. I am sorry for the length of this message but I wanted to demonstrate that we have made every effort to make sure this wasn't just operator error on my part. Any ideas as to how to get this headless installation going with the CDROM are much appreciated. I am replacing one of our DNS's that fried a few weeks ago and we are running on the backup, only until I can get something working again. Many thanks. 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: installing kernel fails, make is ok
You might first try making a generic kernel with no customization and see if that works. If it does, you might be accidentally leaving out support for something vital like disk drives or something else equally vital causing the kernel to not get along far enough to produce error messages. If the generic configuration produces a working kernel, then start pulling things off and re-making it until you kill it. You will then know what actually caused the problem. If it doesn't tell you anything at all, it must be rather early in the boot process because a kernel can usually spit out an error or to to the screen before it dies. If you get a working kernel that is not quite what you wanted, you can at least save the dmesg output and study it to see what devices are in your computer and make sure that your custom configuration includes all of them. BBB writes: Im having trouble installing my coustom kernel, config and make doesnt say any ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Dell PowerEdge1850 Won't Take a Freebsd4.11 Installation.
A Dell PowerEdge1850 will, in fact take a FreeBSD4.11 installation. This problem has been solved. It turns out that Dell Computers only supports a particular version of Redhat at this time. They put a special partition on the drives shipped with PowerEdge 1850's that is about 50 MB which is some sort of diagnostic tool they use. It has the side effect of absolutely trashing many other Linux distributions and FreeBSD4.11, possibly FreeBSD5.4, also although we didn't try it. For some reason, the fdisk utility on a Windows98 boot disk is Draconian enough to blow away the special partition and then everything works like normal. Thanks to those who had helpful suggestions. It turned out not to be FreeBSD's fault at all. 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: Dell PowerEdge1850 Won't Take a Freebsd4.11 Installation.
Lowell Gilbert writes: Well, I'd certainly expect 5.4 or later, with the ATA and RAID improvements, to work better, but you're right that it kind of sounds more like the CD is giving you the problems. Check the emergency shell (alt-F4, I think?) for any messages... Thank you very much. I have downloaded the iso images for 5.4 that I need to get started: 5.4-RELEASE-i386-bootonly.iso 5.4-RELEASE-i386-disc1.iso 5.4-RELEASE-i386-disc2.iso and discovered another surprise. There appears to be no headless option as in boot -h although I may have missed it. A google search turned up a pretty good article on how to make a headless boot.flp floppy for 5.4. Is there any way to make the standard boot CD come up on a serial port? The instructions for making the boot.flp image assume you already have FreeBSD5.4 installed somewhere which I don't yet have. I did see a bootsio file on the bootonly CD so that looks like a possibility. As a computer user who happens to be blind, the ability to do a cold start from a serial port, preferably from the boot/installation cd saves lots of time and tinkering. Most of us are in this business because we love to tinker, but sometimes there is a job to be done and the faster it gets done, the better. Thanks again. 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]
Dell PowerEdge1850 Won't Take a Freebsd4.11 Installation.
I just powered up a shiny new Dell Poweredge 1850 with the idea of installing FreeBSD4.11 on it. Everything started out okay until I got to the part in the Standard Installation where it was going to extract the distributions just after formatting the disk, actually the hardware raid disks. At that point, every single distribution prompted the message that roughly goes: User Information. Unable to extract blablabla from acd0. So far, game over. A 750 server which also has a RAID controller is, so far, taking the installation perfectly. The CDROM drive works well enough to boot and the boot process looks right until I try to extract the distributions such as /bin, etc. Are there any other things to investigate before saying that 4.11 and Dell 1850's don't get along? Thanks for any ideas. 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]
Virtual Interfaces and Subnet Masks
We needed to bring up a second interface on a FreeBSD system in order to cause it to substitute for another FreeBSD box that bravely stayed up for 471 days and then appears to have had a hardware failure of some kind. The substitute system already had fxp0 on the network in question and when I brought up fxp1 on that same network, the nightmare started. You can't seem to have two interfaces with the same subnet mask on the same VLAN. After much frustration, I simply changed the primary interface to be that of the dead host and we are doing without the original address for now. The network mask is 255.255.252.0. Is there any way to have more than one interface on the same subnet with that same subnet mask? 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: 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]
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]
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]
/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]
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]
How to Send a Bell Character as Part of the Prompt in CSH
I set a prompt string in the root .cshrc file of a system and wanted it to ring the terminal bell on each new shell prompt. Instead, I get the representation of the \a expression as a control character as in ^g appearing on the screen instead of the VT100 emulation receiving the ASCII 7 character to beep the terminal. If I type a Control-G, I do hear a bell, but if I include it in the prompt string, it always gets translated in to ^g. What do I need to look at to change this behavior? The prompt string in question is: set prompt=\a\!# I did try set prompt=`echo `\!# with exactly the same results. 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]
Defining Make Variables from the Command Line
What is the correct command line syntax for defining a variable to the Makefile? The expect port will make either with or without X11 support. I want it without X11 and there is an ifdefine WITHOUT_X11 test in the Makefile. My only problem is I remember that it can be done, but I don't remember the exact syntax. Sometimes, if you get those wrong, make still works but you get the build you didn't want. 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]