From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 11 09:30:22 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 29CD616A4D0 for ; Sun, 11 Apr 2004 09:30:22 -0700 (PDT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7F70E43D4C for ; Sun, 11 Apr 2004 09:30:07 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.10/8.12.10) id i3BGTvdU008543; Sun, 11 Apr 2004 11:29:57 -0500 (CDT) (envelope-from dan) Date: Sun, 11 Apr 2004 11:29:57 -0500 From: Dan Nelson To: Ted Unangst Message-ID: <20040411162941.GA1319@dan.emsphone.com> References: <6.0.2.0.2.20040409230629.01cc1ec0@mx1.erhartgroup.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 5.2-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.6i cc: Brandon Erhart cc: freebsd-hackers@freebsd.org Subject: Re: FreeBSD and Debugging? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2004 16:30:22 -0000 In the last episode (Apr 10), Ted Unangst said: > On Fri, 9 Apr 2004, Brandon Erhart wrote: > > Are there any debuggers out there for BSD that will detect the > > heap/stack corruption!? > > valgrind and electric fence are very good suggestions. my own > personal pet project was adding guard pages to the system malloc. > then linking malloc.conf -> AFGJ or setenv MALLOC_OPTIONS and you can > find bugs in all the software you run. it's less complete than a > dedicated heap checker, but lightweight enough (well, 20% penalty may > not be light for some) that i run with it full time. we've had a > fairly significant amount of success with it finding bugs in software > that just happened to work. > > http://www.zeitbombe.org/patches/malloc_guard.diff should apply pretty > cleanly to freebsd's malloc.c I also have a malloc debugging patch that changes the Junk flag to fill with a counter value, so you can track down where in your program a particular block of memory was allocated/freed. http://dan.allantgroup.com/FreeBSD/malloc.diff , or PR 52907 -- Dan Nelson dnelson@allantgroup.com From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 11 09:38:42 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DF2FE16A4CE for ; Sun, 11 Apr 2004 09:38:42 -0700 (PDT) Received: from chaos.evolve.za.net (chaos.evolve.za.net [196.34.172.107]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9CA7643D1D for ; Sun, 11 Apr 2004 09:38:41 -0700 (PDT) (envelope-from cole@opteqint.net) Received: from root by chaos.evolve.za.net with scanned-ok (Exim 3.36 #1) id 1BChyg-000GSI-00 for freebsd-hackers@freebsd.org; Sun, 11 Apr 2004 18:38:38 +0200 Received: from [196.39.126.250] (helo=stalker) by chaos.evolve.za.net with asmtp (TLSv1:RC4-MD5:128) (Exim 3.36 #1) id 1BChyf-000GS7-00 for freebsd-hackers@freebsd.org; Sun, 11 Apr 2004 18:38:38 +0200 Message-ID: <000d01c41fe3$85ba68c0$4206000a@stalker> From: "Cole" To: Date: Sun, 11 Apr 2004 18:39:09 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Scanned: by Opteq - www.optec.co.za Subject: Library problems X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2004 16:38:43 -0000 Hi I have recently installed ntop 3.0 on freebsd 4.9 from the ports. I then copied the binary and all needed libraries to another box also almost a duplicate of the box that i installed ntop 3.0 on. When starting up ntop i get these errors, so i recompiled ntop on the new box from ports, and i still get these errors. I have checked /usr/local/lib/ntop/plugins, and everything is there, and they are also the same as the libraries on the original box that i installed ntop on. Even copying the files from the plugin directory to the second box didnt solve this. I have recompiled, reinstalled, tried everything, i have no idea why it is now doing this. Sun Apr 11 16:32:18 2004 **WARNING** Unable to locate plugin '/usr/local/lib/ntop/plugins/netflowPlugin.so' entry function [Invalid shared object handle 0x28070a00] Sun Apr 11 16:32:18 2004 **WARNING** Unable to locate plugin '/usr/local/lib/ntop/plugins/nfsPlugin.so' entry function [Invalid shared object handle 0x28070d00] Sun Apr 11 16:32:18 2004 **WARNING** Unable to locate plugin '/usr/local/lib/ntop/plugins/pdaPlugin.so' entry function [Invalid shared object handle 0x29b3d000] Sun Apr 11 16:32:18 2004 **WARNING** Unable to locate plugin '/usr/local/lib/ntop/plugins/rrdPlugin.so' entry function [Invalid shared object handle 0x29b3d300] Sun Apr 11 16:32:18 2004 **WARNING** Unable to locate plugin '/usr/local/lib/ntop/plugins/sflowPlugin.so' entry function [Invalid shared object handle 0x29b3d600] Sun Apr 11 16:32:18 2004 **WARNING** Unable to locate plugin '/usr/local/lib/ntop/plugins/xmldumpPlugin.so' entry function [Invalid shared object handle 0x29b3d900] If anyone can help it would be greatly appreciated. Thanks /Cole From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 11 09:58:41 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DA73916A4CE for ; Sun, 11 Apr 2004 09:58:41 -0700 (PDT) Received: from hanoi.cronyx.ru (hanoi.cronyx.ru [144.206.181.53]) by mx1.FreeBSD.org (Postfix) with ESMTP id D0B9143D46 for ; Sun, 11 Apr 2004 09:58:40 -0700 (PDT) (envelope-from rik@cronyx.ru) Received: (from root@localhost) by hanoi.cronyx.ru id i3BGu2Np043334 for freebsd-hackers@freebsd.org.checked; (8.12.8/vak/2.1) Sun, 11 Apr 2004 20:56:02 +0400 (MSD) (envelope-from rik@cronyx.ru) Received: from cronyx.ru (rik.cronyx.ru [172.22.4.1]) by hanoi.cronyx.ru with ESMTP id i3BGsbKs043280; (8.12.8/vak/2.1) Sun, 11 Apr 2004 20:54:38 +0400 (MSD) (envelope-from rik@cronyx.ru) Message-ID: <40797A64.2090100@cronyx.ru> Date: Sun, 11 Apr 2004 21:03:32 +0400 From: Roman Kurakin User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020610 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Colin Percival References: <6.0.2.0.2.20040409230629.01cc1ec0@mx1.erhartgroup.com> <6.0.1.1.1.20040410061321.04334e28@imap.sfu.ca> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: Brandon Erhart cc: freebsd-hackers@freebsd.org Subject: Re: FreeBSD and Debugging? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2004 16:58:42 -0000 Colin Percival wrote: >At 06:11 10/04/2004, Brandon Erhart wrote: > > >>Are there any debuggers out there for BSD that will detect the heap/stack corruption!? >> >> > > Real Men use printf(3). :-) > You are talking as Linus ;-) rik From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 11 11:55:30 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8723216A4CE for ; Sun, 11 Apr 2004 11:55:30 -0700 (PDT) Received: from hanoi.cronyx.ru (hanoi.cronyx.ru [144.206.181.53]) by mx1.FreeBSD.org (Postfix) with ESMTP id D74CA43D5A for ; Sun, 11 Apr 2004 11:55:29 -0700 (PDT) (envelope-from rik@cronyx.ru) Received: (from root@localhost) by hanoi.cronyx.ru id i3BIr4q5047678 for freebsd-hackers@freebsd.org.checked; (8.12.8/vak/2.1) Sun, 11 Apr 2004 22:53:04 +0400 (MSD) (envelope-from rik@cronyx.ru) Received: from cronyx.ru (rik.cronyx.ru [172.22.4.1]) by hanoi.cronyx.ru with ESMTP id i3BIpKB7047585; (8.12.8/vak/2.1) Sun, 11 Apr 2004 22:51:20 +0400 (MSD) (envelope-from rik@cronyx.ru) Message-ID: <407995BF.7060504@cronyx.ru> Date: Sun, 11 Apr 2004 23:00:15 +0400 From: Roman Kurakin User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020610 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-current@freebsd.org, freebsd-hackers@freebsd.org References: <4061E207.8070406@cronyx.ru> Content-Type: multipart/mixed; boundary="------------040803000505040604040808" cc: Roman Kurakin Subject: ATA/CHS problem (path + new information) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2004 18:55:30 -0000 This is a multi-part message in MIME format. --------------040803000505040604040808 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi, You can find history of my previous postings below. I didn't moved far since that time, because lack of time. But any way I have some new information and one patch I want to share. This patch didn't solve any of my problems. Soren, please review it. This time it is comlete. I hope this patch would allow to track down similar problems I have. I remind you that now I have two problems. First one that FreeBSD uses wrong assumption about which device should be CHS and which LBA: if (!ad_version(atadev->param->version_major) || !(atadev->param->atavalid & ATA_FLAG_54_58) || !lbasize) atadev->flags |= ATA_D_USE_CHS; True ATA device may not have ATA_FLAG_54_58 valid bit, and also due to last ATA standard this bit is obsoleted. I also want to know why ata driver doesn't check LBA support from word 49? May be this one check could solve my problems and didn't breake code for non-ATA devices. Second one, that only 20G part of my hard disk works with CHS. This is other side of the same problem. Device should work in CHS mode. And it works witch ICH5 controller. But with ICH2 it doesn't with out hack. I've checked standard again and I sew command 91h (Initialize drive parameters). YES, this command solved my problem witch CHS. But. But the life is no so easy :-) This command fails itself with abort code. But as I said I can access sectors that was previously NOT FOUND after it. (ata_controlcmd (atadev,0x91, 0, 0xfUL << 24, 63); I've put it just after Identify driver command in ata_getparam function) Any comments and suggestions very very appreciated. And please do not suggest how to fix this problem only for me. I already know a few variant that can't be commited. I realy want to crush this bug. rik Roman Kurakin wrote: > Hi, > > (Was "HDD question" on hackers@, posted also here cause this is also > CURRENT problem) > > History: > >> I have some problems with my HDD (ST380021A). The problem was > >> checked on 5.2, 5.2.1, and some > >> 5.Current (cvsuped about week or two). >> >> At first I got this problem while system installation. I get trap > >> and message from ata after I start a commit: > >> FAILURE READ_DMA status=51 error=10 > >> LBA=245529601 > >> >> I started to hack sysinstall and finally came to simple program > >> that could lead > >> to the same message from ata: >> >> fd = open ("/dev/ata0", O_RDWR); >> read_block (fd, (daddr_t)41929650, 512); // this one could be changed > >> // to pair calls lseek and read, > >> // so this is not libdisk problem > >> >> I checked the same code with /dev/ata1 which is twice as little, but > >> I didn't get any messages. >> I don't have any ideas where my read call goes, which drivers to look > >> to catch this bug. > >> >> So I need a help from some gurus in this area. > > > What I've found since that time: > > This is not an LBA request. ATA driver thinks that I have 80G CHS > device, cause it's ATA_FLAG_54_58 > is zero. (This decision is incorrect, we shouldn't relay on this > flag). I've checked another seagate 80G drive in > CHS mode(by driver hacking), and problematic one with LBA mode. I get > the same behavior on both with CHS. > And both work fine in LBA mode. It also should be mentioned that I get > this problem on machine with > ICH2 controller, and it seems that I don't have such problem on other > machine with ICH5. > > PS. If you have any ideas, or if you have any materials (standards for > example) about ATA/ATAPI and you > can share them with me, please let me know. I am not ata developer, so > this is a bit difficalt for me to > dig this problem. > > rik --------------040803000505040604040808 Content-Type: text/plain; name="ata3.pch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ata3.pch" diff -ubr ata-orig/ata-disk.c ata/ata-disk.c --- ata-orig/ata-disk.c Wed Mar 10 20:05:56 2004 +++ ata/ata-disk.c Sun Apr 11 12:26:02 2004 @@ -388,13 +388,14 @@ (adp->heads * adp->sectors)), adp->heads, adp->sectors, DEV_BSIZE); - ata_prtdev(adp->device, "%d secs/int, %d depth queue, %s%s\n", + ata_prtdev(adp->device, "%d secs/int, %d depth queue, %s%s%s\n", adp->max_iosize / DEV_BSIZE, adp->num_tags + 1, (adp->flags & AD_F_TAG_ENABLED) ? "tagged " : "", - ata_mode2str(adp->device->mode)); + ata_mode2str(adp->device->mode), + (adp->device->flags & ATA_D_USE_CHS) ? "(CHS mode)": ""); } else - ata_prtdev(adp->device,"%lluMB <%.40s> [%lld/%d/%d] at ata%d-%s %s%s\n", + ata_prtdev(adp->device,"%lluMB <%.40s> [%lld/%d/%d] at ata%d-%s %s%s%s\n", (unsigned long long)(adp->total_secs / ((1024L * 1024L) / DEV_BSIZE)), adp->device->param->model, @@ -404,7 +405,8 @@ device_get_unit(adp->device->channel->dev), (adp->device->unit == ATA_MASTER) ? "master" : "slave", (adp->flags & AD_F_TAG_ENABLED) ? "tagged " : "", - ata_mode2str(adp->device->mode)); + ata_mode2str(adp->device->mode), + (adp->device->flags & ATA_D_USE_CHS) ? " (CHS mode)": ""); } static int diff -ubr ata-orig/ata-queue.c ata/ata-queue.c --- ata-orig/ata-queue.c Tue Mar 23 20:39:22 2004 +++ ata/ata-queue.c Sun Apr 11 19:00:05 2004 @@ -47,6 +47,7 @@ /* prototypes */ static void ata_completed(void *, int); static void ata_timeout(struct ata_request *); +static void ata_print_lba (u_int64_t lba, int non_lba_mode); static char *ata_skey2str(u_int8_t); void @@ -278,7 +279,8 @@ "WARNING - %s soft error (ECC corrected)", ata_cmd2str(request)); if (!(request->flags & (ATA_R_ATAPI | ATA_R_CONTROL))) - printf(" LBA=%llu", (unsigned long long)request->u.ata.lba); + ata_print_lba (request->u.ata.lba, + request->device->flags & ATA_D_USE_CHS); printf("\n"); } @@ -289,7 +291,8 @@ "WARNING - %s UDMA ICRC error (retrying request)", ata_cmd2str(request)); if (!(request->flags & (ATA_R_ATAPI | ATA_R_CONTROL))) - printf(" LBA=%llu", (unsigned long long)request->u.ata.lba); + ata_print_lba (request->u.ata.lba, + request->device->flags & ATA_D_USE_CHS); printf("\n"); request->flags |= (ATA_R_IMMEDIATE | ATA_R_REQUEUE); ata_queue_request(request); @@ -316,7 +319,8 @@ (request->dmastat & ATA_BMSTAT_ERROR)) printf(" dma=0x%02x", request->dmastat); if (!(request->flags & (ATA_R_ATAPI | ATA_R_CONTROL))) - printf(" LBA=%llu", (unsigned long long)request->u.ata.lba); + ata_print_lba (request->u.ata.lba, + request->device->flags & ATA_D_USE_CHS); printf("\n"); } @@ -420,7 +424,8 @@ "WARNING - %s interrupt was seen but timeout fired", ata_cmd2str(request)); if (!(request->flags & (ATA_R_ATAPI | ATA_R_CONTROL))) - printf(" LBA=%llu", (unsigned long long)request->u.ata.lba); + ata_print_lba (request->u.ata.lba, + request->device->flags & ATA_D_USE_CHS); printf("\n"); /* re-arm timeout */ @@ -435,7 +440,8 @@ "WARNING - %s interrupt was seen but taskqueue stalled", ata_cmd2str(request)); if (!(request->flags & (ATA_R_ATAPI | ATA_R_CONTROL))) - printf(" LBA=%llu", (unsigned long long)request->u.ata.lba); + ata_print_lba (request->u.ata.lba, + request->device->flags & ATA_D_USE_CHS); printf("\n"); ata_completed(request, 0); } @@ -449,7 +455,8 @@ ata_cmd2str(request), request->retries, request->retries == 1 ? "y" : "ies"); if (!(request->flags & (ATA_R_ATAPI | ATA_R_CONTROL))) - printf(" LBA=%llu", (unsigned long long)request->u.ata.lba); + ata_print_lba (request->u.ata.lba, + request->device->flags & ATA_D_USE_CHS); printf("\n"); } @@ -618,5 +625,18 @@ case 0x0e: return ("MISCOMPARE"); case 0x0f: return ("RESERVED"); default: return("UNKNOWN"); + } +} + +static void +ata_print_lba (u_int64_t lba, int non_lba_mode) +{ + if (!non_lba_mode) { + printf(" LBA=%llu", (unsigned long long)lba); + } else { + printf(" CHS=%u/%u/%u", + (unsigned int)((lba >> 8) & 0xffff), + (unsigned int)((lba >> 24) & 0xf), + (unsigned int)(lba & 0xff)); } } --------------040803000505040604040808-- From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 11 15:31:31 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3E07A16A4CE for ; Sun, 11 Apr 2004 15:31:31 -0700 (PDT) Received: from diaspar.rdsnet.ro (diaspar.rdsnet.ro [213.157.165.224]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5CE1A43D5A for ; Sun, 11 Apr 2004 15:31:30 -0700 (PDT) (envelope-from dudu@diaspar.rdsnet.ro) Received: (qmail 35868 invoked by uid 89); 11 Apr 2004 22:31:16 -0000 Received: from unknown (HELO diaspar.rdsnet.ro) (213.157.165.224) by 0 with AES256-SHA encrypted SMTP; 11 Apr 2004 22:31:16 -0000 Date: Mon, 12 Apr 2004 01:31:14 +0300 (EEST) From: Vlad GALU To: freebsd-hackers@freebsd.org Message-ID: <20040412011216.P7661@qvnfcne.eqfarg.eb> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: SYSV message queues X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: dudu@diaspar.rdsnet.ro List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2004 22:31:31 -0000 Hello. I have the following scenario: one process that creates a message queue and goes through it in a loop, together with another process that inserts various messages into the queue. What I wish is for the 'listening' process to be able to fully process the queue at a fixed amount of time. In short, I'd like msgrcv() to iterate throught the queue and visit every element in a single run. That set of operations being done periodically. Do you find this possible ? I'm quite puzzled here. I first tried inserting a sleep() call in my queue processing loop but then I noticed that it had a bad effect. It's true that I haven't read the man page very carefully the first time. I'll blame it on the hurry. However, while writing this message, an idea occured to me. What if I write the processing loop as follows: -- cut here -- int i; while (1) { i = 0; msgctl(queueid, IPC_STAT, &queuestat); while (i <= queuestat.msg_qnum) { msgrcv(queueid, &message, sizeof(message), 0, 0); process_message(message); i++; } sleep(5); } -- and here -- Does this look pheasible ? I'm expecting an injection of about 100k messages per second or even more. There'll be quite a lot of unprocessed ones at the end of each run, I suppose. I'll measure the average time spent for one run and decide on the sleep interval. However, does anyone have a better design ? ---- If it's there, and you can see it, it's real. If it's not there, and you can see it, it's virtual. If it's there, and you can't see it, it's transparent. If it's not there, and you can't see it, you erased it. From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 11 19:02:40 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DCD2516A4CE for ; Sun, 11 Apr 2004 19:02:40 -0700 (PDT) Received: from web40709.mail.yahoo.com (web40709.mail.yahoo.com [66.218.78.166]) by mx1.FreeBSD.org (Postfix) with SMTP id A7B7D43D41 for ; Sun, 11 Apr 2004 19:02:40 -0700 (PDT) (envelope-from cykyc@yahoo.com) Message-ID: <20040412020234.28971.qmail@web40709.mail.yahoo.com> Received: from [209.98.54.121] by web40709.mail.yahoo.com via HTTP; Sun, 11 Apr 2004 19:02:34 PDT Date: Sun, 11 Apr 2004 19:02:34 -0700 (PDT) From: Jon Passki To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: bus_allloc_resource() in -STABLE sys/pci/if_de.c returning NULL X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: cykyc@yahoo.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2004 02:02:41 -0000 Hello all, (if this question is not on topic, please let me know) I'm attempting to debug an issue and I need some assistance. I am running a complicated setup using the following: --) Mac OS X (Panther) running Virtual PC --) Etherboot boot1a.bin & bin/tulip.rom Virtual PC disk --) FreeBSD -STABLE diskless-enabled kernel --) FreeBSD -STABLE Virtual PC disk I can boot the FreeBSD VPC disk, with everything working great. I can boot the Etherboot VPC disk, which netboots a FreeBSD kernel. The kernel loads, but the virtual DEC 21041 (de0) driver fails to attach. I've figured this out to be at bus_alloc_resource() within tulip_pci_attach() in sys/pci/if_de.c. I'm trying to figure out what's going on and I want to see the why the attach is failing. How should I go about this? Thanks, Jon Passki __________________________________ Do you Yahoo!? Yahoo! Tax Center - File online by April 15th http://taxes.yahoo.com/filing.html From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 11 22:58:49 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6C38016A4CE for ; Sun, 11 Apr 2004 22:58:49 -0700 (PDT) Received: from smtp.netli.com (ip2-pal-focal.netli.com [66.243.52.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1950F43D31 for ; Sun, 11 Apr 2004 22:58:49 -0700 (PDT) (envelope-from vlm@netli.com) Received: (qmail 9034 invoked by uid 84); 12 Apr 2004 05:58:46 -0000 Received: from vlm@netli.com by l3-1 with qmail-scanner-0.96 (uvscan: v4.1.40/v4121. . Clean. Processed in 0.179402 secs); 12 Apr 2004 05:58:46 -0000 Received: from unknown (HELO netli.com) (172.17.1.12) by mx01-pal-lan.netli.lan with SMTP; 12 Apr 2004 05:58:46 -0000 Message-ID: <407A3076.8030005@netli.com> Date: Sun, 11 Apr 2004 23:00:22 -0700 From: Lev Walkin Organization: Netli, Inc. User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.6) Gecko/20040307 X-Accept-Language: ru, en-us, en MIME-Version: 1.0 To: dudu@diaspar.rdsnet.ro References: <20040412011216.P7661@qvnfcne.eqfarg.eb> In-Reply-To: <20040412011216.P7661@qvnfcne.eqfarg.eb> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re: SYSV message queues X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2004 05:58:49 -0000 Vlad GALU wrote: > Hello. I have the following scenario: one process that creates a > message queue and goes through it in a loop, together with another process > that inserts various messages into the queue. What I wish is for the > 'listening' process to be able to fully process the queue at a fixed > amount of time. In short, I'd like msgrcv() to iterate throught the queue > and visit every element in a single run. That set of operations being done > periodically. > Do you find this possible ? I'm quite puzzled here. I first tried > inserting a sleep() call in my queue processing loop but then I noticed > that it had a bad effect. It's true that I haven't read the man page very > carefully the first time. I'll blame it on the hurry. > > However, while writing this message, an idea occured to me. What > if I write the processing loop as follows: > > -- cut here -- > int i; > while (1) { > i = 0; > msgctl(queueid, IPC_STAT, &queuestat); > while (i <= queuestat.msg_qnum) { > msgrcv(queueid, &message, sizeof(message), 0, 0); > process_message(message); > i++; > } > sleep(5); > } > -- and here -- > > Does this look pheasible ? I'm expecting an injection of about > 100k messages per second or even more. There'll be quite a lot of > unprocessed ones at the end of each run, I suppose. I'll measure the average time spent for > one run and decide on the sleep interval. Did you try to grok what the msgrcv() call is supposed to return? Specifically, read about -1/EAGAIN and IPC_NOWAIT. Then remove sleep(). > However, does anyone have a better design ? Yes. Use sockets. Obsolescent Unix IPC Methods http://www.catb.org/~esr/writings/taoup/html/ch07s03.html#id2923376 -- Lev Walkin vlm@netli.com From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 12 01:56:07 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9AE4F16A4D0 for ; Mon, 12 Apr 2004 01:56:07 -0700 (PDT) Received: from diaspar.rdsnet.ro (diaspar.rdsnet.ro [213.157.165.224]) by mx1.FreeBSD.org (Postfix) with ESMTP id B67C143D54 for ; Mon, 12 Apr 2004 01:56:06 -0700 (PDT) (envelope-from dudu@diaspar.rdsnet.ro) Received: (qmail 68955 invoked by uid 89); 12 Apr 2004 08:55:53 -0000 Received: from unknown (HELO diaspar.rdsnet.ro) (213.157.165.224) by 0 with AES256-SHA encrypted SMTP; 12 Apr 2004 08:55:53 -0000 Date: Mon, 12 Apr 2004 11:55:51 +0300 (EEST) From: Vlad GALU To: Lev Walkin In-Reply-To: <407A3076.8030005@netli.com> Message-ID: <20040412114211.P35430@qvnfcne.eqfarg.eb> References: <20040412011216.P7661@qvnfcne.eqfarg.eb> <407A3076.8030005@netli.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org Subject: Re: SYSV message queues X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: dudu@diaspar.rdsnet.ro List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2004 08:56:07 -0000 On Sun, 11 Apr 2004, Lev Walkin wrote: > Vlad GALU wrote: > > Hello. I have the following scenario: one process that creates a > > message queue and goes through it in a loop, together with another process > > that inserts various messages into the queue. What I wish is for the > > 'listening' process to be able to fully process the queue at a fixed > > amount of time. In short, I'd like msgrcv() to iterate throught the queue > > and visit every element in a single run. That set of operations being done > > periodically. > > Do you find this possible ? I'm quite puzzled here. I first tried > > inserting a sleep() call in my queue processing loop but then I noticed > > that it had a bad effect. It's true that I haven't read the man page very > > carefully the first time. I'll blame it on the hurry. > > > > However, while writing this message, an idea occured to me. What > > if I write the processing loop as follows: > > > > -- cut here -- > > int i; > > while (1) { > > i = 0; > > msgctl(queueid, IPC_STAT, &queuestat); > > while (i <= queuestat.msg_qnum) { > > msgrcv(queueid, &message, sizeof(message), 0, 0); > > process_message(message); > > i++; > > } > > sleep(5); > > } > > -- and here -- > > > > Does this look pheasible ? I'm expecting an injection of about > > 100k messages per second or even more. There'll be quite a lot of > > unprocessed ones at the end of each run, I suppose. I'll measure the average time spent for > > one run and decide on the sleep interval. > > > Did you try to grok what the msgrcv() call is supposed to return? > Specifically, read about -1/EAGAIN and IPC_NOWAIT. Then remove sleep(). > It is supposed to block, waiting for more events to be inserted into the queue. > > However, does anyone have a better design ? > > Yes. Use sockets. My program currently uses sockets. I found it easier to write clean code with SYSV SHM. In fact, I turned to a SYSV message queue because I wanted to rely on the kernel to manage it, rather than doing it myself. Of course, this raises some portability problems, but the goal of the software I'm currently writing is very biased. It will only run on FreeBSD, so I guess there's no problem with that. > > Obsolescent Unix IPC Methods > http://www.catb.org/~esr/writings/taoup/html/ch07s03.html#id2923376 > Thanks. That was a nice reading material. I don't entirely agree with it though. It has some strong points against using shared memory areas and/or threads. Unfortunately, theory often does not apply in practice. I think' it's easier for one to program using one of the above methods. Nowadays most UNIX software makes use of them. > -- > Lev Walkin > vlm@netli.com > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > ---- If it's there, and you can see it, it's real. If it's not there, and you can see it, it's virtual. If it's there, and you can't see it, it's transparent. If it's not there, and you can't see it, you erased it. From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 13 03:13:24 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 299B116A4CE for ; Tue, 13 Apr 2004 03:13:24 -0700 (PDT) Received: from profi.kharkov.ua (ats36sas-23.kharkov.ukrtel.net [195.5.17.87]) by mx1.FreeBSD.org (Postfix) with ESMTP id B9FCA43D1F for ; Tue, 13 Apr 2004 03:13:23 -0700 (PDT) (envelope-from greg@profi.kharkov.ua) Received: by profi.kharkov.ua (Postfix, from userid 1000) id 945B8A86EE; Tue, 13 Apr 2004 13:13:34 +0300 (EEST) Date: Tue, 13 Apr 2004 13:13:34 +0300 From: Gregory Edigarov To: freebsd-hackers@freebsd.org Message-ID: <20040413101334.GD26803@profi.kharkov.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline User-Agent: Mutt/1.4.1i Subject: killpower(UPS inverter shutdown) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2004 10:13:24 -0000 Hello, If anyone have the working sources to killpower an USB UPS under FreeBSD please enlight me. I have APC RS 500, but an example for any other should also be ok. Thanks a lot in advance. -- With best regards, Gregory Edigarov ------------------------------------------------------------------------------ profi.kharkov.ua Systems Administrator ------------------------------------------------------------------------------ From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 12 17:55:48 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9BCFF16A4CE; Mon, 12 Apr 2004 17:55:48 -0700 (PDT) Received: from mailout2.pacific.net.au (mailout2.pacific.net.au [61.8.0.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id D483943D54; Mon, 12 Apr 2004 17:55:47 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.0.87])i3D0tX5v008969; Tue, 13 Apr 2004 10:55:33 +1000 Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) i3D0tUsg019606; Tue, 13 Apr 2004 10:55:32 +1000 Date: Tue, 13 Apr 2004 10:55:30 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Roman Kurakin In-Reply-To: <407995BF.7060504@cronyx.ru> Message-ID: <20040413101307.D1606@gamplex.bde.org> References: <4061E207.8070406@cronyx.ru> <407995BF.7060504@cronyx.ru> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Mailman-Approved-At: Tue, 13 Apr 2004 04:57:54 -0700 cc: freebsd-hackers@freebsd.org cc: freebsd-current@freebsd.org Subject: Re: ATA/CHS problem (path + new information) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2004 00:55:48 -0000 On Sun, 11 Apr 2004, Roman Kurakin wrote: > I remind you that now I have two problems. First one that FreeBSD uses > wrong assumption about which device should be CHS and which LBA: > > if (!ad_version(atadev->param->version_major) || > !(atadev->param->atavalid & ATA_FLAG_54_58) || !lbasize) > atadev->flags |= ATA_D_USE_CHS; > > True ATA device may not have ATA_FLAG_54_58 valid bit, and also due > to last ATA standard this bit is obsoleted. > > I also want to know why ata driver doesn't check LBA support from word 49? > May be this one check could solve my problems and didn't breake code for > non-ATA devices. Possibly for similar reasons. It's hard to tell what's in the LBA bit for pre-ATA devices older than LBA. Similarly for the lbasize words, but it's easier to do a sanity check on a 32-bit values that a 1-bit flag. > Second one, that only 20G part of my hard disk works with CHS. This is other > side of the same problem. Device should work in CHS mode. And it works > witch ICH5 controller. But with ICH2 it doesn't with out hack. > > I've checked standard again and I sew command 91h (Initialize drive > parameters). Check out the commands for limiting the (apparent) disk size. IIRC, the CHS limit can be set independently of the LBA limit, and some settings are harder than others so that they can't be cleared by old commands like 0x91. The limits may be set to prevent old drivers which only understand old commands from becoming confused by trying to actually use the whole disk. Bruce From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 12 20:41:02 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 06B7B16A4CE; Mon, 12 Apr 2004 20:41:02 -0700 (PDT) Received: from smtp0.server.rpi.edu (smtp0.server.rpi.edu [128.113.53.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9F25443D45; Mon, 12 Apr 2004 20:41:01 -0700 (PDT) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp0.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i3D3f0Ed023843; Mon, 12 Apr 2004 23:41:00 -0400 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: Date: Mon, 12 Apr 2004 23:40:59 -0400 To: freebsd-ports@freebsd.org From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) X-Mailman-Approved-At: Tue, 13 Apr 2004 04:57:55 -0700 Subject: Second "RFC" on pkg-data idea for ports X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2004 03:41:02 -0000 [this is BCC'ed to -hackers and -arch just so everyone has a chance to see it, but I expect the bulk of the discussion should take place on the freebsd-ports mailing list] Back in January I send out a long-ish email asking for feedback on some ideas I had for the ports-collection. I received a fair number of comments, and have finally re-organized my ideas into a few web pages. Hopefully these will make more sense. Initially I had written the ideas up as a bunch of Wiki pages, but the machine holding that Wiki died, taking with it all the pages I had written... I have not proof-read the web pages, so there's probably some spelling mistakes and odd sentences on them. Apologies for that, but I wanted to get *something* sent out this week. This project has been blocked due to a lack of time on my part, and I want to get it moving again... The basic idea is to collapse many of the separate files for a port into a single pkg-data file. The web pages explain why I think this might be worth doing. Please check them out at: http://people.freebsd.org/~gad/PkgData/ Some of the work for this has been done, mainly just to see how well it might work out. The project is still probably more work than Darren and I can finish, so we might limit ourselves to a subset of the idea. For instance, we might start out by just collapsing the distinfo, pkg-plist, and "files/patches-*" files into a pkg-data file, and leave the other files for some later project. What I'd like is some idea of whether this project is worth pursuing. If not, then Darren and I will concentrate on some other, less disruptive project. If people like the general idea of this project, then we'll see how much of we can do. If we have some of the details wrong, then let us know what we need to change or where we need to look for more information. I know that I am not a full-fledged expert in every facet of the ports collection, and I am not looking to ram some ideas down everyone's throat. I just think that some change like this one could be useful for the ports collection, and I'm trying to come up with something that everyone sees as useful. If this project does not seem like it would be worth the effort, then that will be perfectly okay too. Please let me know what you think. Also, please read the web pages before responding. It took me a fair amount of time to write the web pages that are there (as lame as they are...), and I'd rather not have to retype all of that into a long series of disjointed messages... -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 13 01:56:27 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7FF2E16A4CE for ; Tue, 13 Apr 2004 01:56:27 -0700 (PDT) Received: from bps.jodocus.org (g157016.upc-g.chello.nl [80.57.157.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id A17B643D49 for ; Tue, 13 Apr 2004 01:56:26 -0700 (PDT) (envelope-from joost@jodocus.org) Received: from jodocus.org (localhost [127.0.0.1]) by bps.jodocus.org (8.12.10/8.12.10) with ESMTP id i3D8uOhJ083269 for ; Tue, 13 Apr 2004 10:56:25 +0200 (CEST) (envelope-from joost@jodocus.org) Received: (from joost@localhost) by jodocus.org (8.12.10/8.12.10/Submit) id i3D8uOlU083268 for hackers@freebsd.org; Tue, 13 Apr 2004 10:56:24 +0200 (CEST) (envelope-from joost) Date: Tue, 13 Apr 2004 10:56:24 +0200 From: Joost Bekkers To: hackers@freebsd.org Message-ID: <20040413085624.GA82980@bps.jodocus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Mailman-Approved-At: Tue, 13 Apr 2004 04:57:54 -0700 Subject: sanity checking for config(8) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2004 08:56:27 -0000 Hi I'm thinking of adding some basic kernel-config sanity checking to config(8) config would then complain about things like 'device da' without 'device scbus' and 'device gif' without 'options INET' and 'OPTIONS INET6' just to name a few. It would be really nice if the list of what a device depends on could be generated automaticly. Can any of you think of a way to do that? (aside from generating lots of config files and test if they make(1)) -- greetz Joost joost@jodocus.org From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 13 02:53:16 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DB6E216A4CE for ; Tue, 13 Apr 2004 02:53:16 -0700 (PDT) Received: from profi.kharkov.ua (ats36sas-23.kharkov.ukrtel.net [195.5.17.87]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9A14243D54 for ; Tue, 13 Apr 2004 02:53:15 -0700 (PDT) (envelope-from greg@profi.kharkov.ua) Received: by profi.kharkov.ua (Postfix, from userid 1000) id 561E535E9C; Tue, 13 Apr 2004 12:53:25 +0300 (EEST) Date: Tue, 13 Apr 2004 12:53:25 +0300 From: Gregory Edigarov To: freebsd-hackers@freebsd.org Message-ID: <20040413095325.GA26424@profi.kharkov.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Mailman-Approved-At: Tue, 13 Apr 2004 04:57:54 -0700 Subject: looking for killpower source X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2004 09:53:17 -0000 Hi, I need killpower (invertor shutdown) source for any USB UPS. I have APC BackUPS RS 500, but any other source should help, if it works under FreeBSD. Thanks a lot in advance. -- With best regards, Gregory Edigarov ------------------------------------------------------------------------------ profi.kharkov.ua Systems Administrator ------------------------------------------------------------------------------ From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 13 04:54:07 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 13ECF16A53C for ; Tue, 13 Apr 2004 04:54:07 -0700 (PDT) Received: from mail.nfluid.com (ors.orctel.co.uk [194.75.36.222]) by mx1.FreeBSD.org (Postfix) with ESMTP id A200D43D31 for ; Tue, 13 Apr 2004 04:54:06 -0700 (PDT) (envelope-from chris@nfluid.com) Received: from chris by mail.nfluid.com with local (Exim 4.30) id 1BDMWb-0002qE-B8; Tue, 13 Apr 2004 12:56:21 +0100 Content-Type: text/plain; charset="iso-8859-1" From: Chris Smith Organization: netFluid Technology Ltd To: freebsd-hackers@freebsd.org Date: Tue, 13 Apr 2004 12:56:21 +0100 User-Agent: KMail/1.4.3 References: <20040412011216.P7661@qvnfcne.eqfarg.eb> <407A3076.8030005@netli.com> <20040412114211.P35430@qvnfcne.eqfarg.eb> In-Reply-To: <20040412114211.P35430@qvnfcne.eqfarg.eb> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200404131256.21319.chris@nfluid.co.uk> Sender: Chris Smith cc: dudu@diaspar.rdsnet.ro Subject: Re: SYSV message queues X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: chris@nfluid.co.uk List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2004 11:54:07 -0000 On Monday 12 Apr 2004 09:55, Vlad GALU wrote: > > Did you try to grok what the msgrcv() call is supposed to return? > > Specifically, read about -1/EAGAIN and IPC_NOWAIT. Then remove sleep(= ). > > =09It is supposed to block, waiting for more events to be inserted > into the queue. Yes but sometimes it can't and will return an EAGAIN. You *MUST* trap this and try the msgrcv again. > > > However, does anyone have a better design ? > > > > Yes. Use sockets. Sockets (streams etc) work excellently _unless_ you periodically need to = pick=20 messages out of the queue out of FIFO order. Priorities etc, or when you= 've=20 got multiple processes reading a single queue and want to send a particul= ar=20 process a message. SYSV queues are just the ticket for this..... Be carefull with SYSV Message Queues though as the default settings of qu= eue=20 size etc are broken in freeBSD/netBSD/openBSD (see my earlier email=20 http://lists.FreeBSD.org/pipermail/freebsd-hackers/2004-March/006011.html= ) Incidentally, what is the resolution of this?? Cheers,=20 Chris --=20 Chris Smith Technical Architect - netFluid Technology Ltd. "Internet Technologies, Distributed Systems and Tuxedo Consultancy" E: chris@nfluid.co.uk W: http://www.nfluid.co.uk From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 13 06:07:29 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D495A16A4CE for ; Tue, 13 Apr 2004 06:07:29 -0700 (PDT) Received: from hanoi.cronyx.ru (hanoi.cronyx.ru [144.206.181.53]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1ED8643D54 for ; Tue, 13 Apr 2004 06:07:29 -0700 (PDT) (envelope-from rik@cronyx.ru) Received: (from root@localhost) by hanoi.cronyx.ru id i3DD5BkL043869 for freebsd-hackers@freebsd.org.checked; (8.12.8/vak/2.1) Tue, 13 Apr 2004 17:05:11 +0400 (MSD) (envelope-from rik@cronyx.ru) Received: from cronyx.ru (hi.cronyx.ru [144.206.181.94]) by hanoi.cronyx.ru with ESMTP id i3DD3tNn043673; (8.12.8/vak/2.1) Tue, 13 Apr 2004 17:03:55 +0400 (MSD) (envelope-from rik@cronyx.ru) Message-ID: <407BE532.8060608@cronyx.ru> Date: Tue, 13 Apr 2004 17:03:46 +0400 From: Roman Kurakin User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031208 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Bruce Evans References: <4061E207.8070406@cronyx.ru> <407995BF.7060504@cronyx.ru> <20040413101307.D1606@gamplex.bde.org> In-Reply-To: <20040413101307.D1606@gamplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org cc: freebsd-current@freebsd.org Subject: Re: ATA/CHS problem (path + new information) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2004 13:07:30 -0000 Bruce Evans wrote: >On Sun, 11 Apr 2004, Roman Kurakin wrote: > > >>I remind you that now I have two problems. First one that FreeBSD uses >>wrong assumption about which device should be CHS and which LBA: >> >>if (!ad_version(atadev->param->version_major) || >>!(atadev->param->atavalid & ATA_FLAG_54_58) || !lbasize) >>atadev->flags |= ATA_D_USE_CHS; >> >>True ATA device may not have ATA_FLAG_54_58 valid bit, and also due >>to last ATA standard this bit is obsoleted. >> >>I also want to know why ata driver doesn't check LBA support from word 49? >>May be this one check could solve my problems and didn't breake code for >>non-ATA devices. >> >> >Possibly for similar reasons. It's hard to tell what's in the LBA bit for >pre-ATA devices older than LBA. Similarly for the lbasize words, but it's >easier to do a sanity check on a 32-bit values that a 1-bit flag. > > But since ATA_FLAG_54_58 bit from the fist spec means 1 - "valid" and 0 - "may be valid" this check is initialy incorrect. According to ATA-5 it is depricated. But in later revisions of ST380021A (according to their datasheet, I don't have one) Seagate changed this bit to 1 back, I may guess that this was done since probably others uses the same check. :-( Anyway, it seems that Soren already removed this check. So my ST380021A should back to the life. >>Second one, that only 20G part of my hard disk works with CHS. This is other >>side of the same problem. Device should work in CHS mode. And it works >>witch ICH5 controller. But with ICH2 it doesn't with out hack. >> >>I've checked standard again and I sew command 91h (Initialize drive >>parameters). >> >> > >Check out the commands for limiting the (apparent) disk size. IIRC, >the CHS limit can be set independently of the LBA limit, and some >settings are harder than others so that they can't be cleared by old >commands like 0x91. The limits may be set to prevent old drivers which >only understand old commands from becoming confused by trying to actually >use the whole disk. > > This is good idea. I sew only LBA limits, but I didn't see anytihng about CHS limits. I'll try to check for some more commands. I can't get how ATA controller could affect on this. Brobably this is not controller problem but BIOS, but changing its settings didn't affect. Thanks for reply, I hope your suggestions will help me. Since Soren removed first bug I'll keep digging from obstinacy :-) rik From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 13 08:50:44 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F162016A4CE for ; Tue, 13 Apr 2004 08:50:44 -0700 (PDT) Received: from the-macgregors.org (82-33-62-105.cable.ubr06.stav.blueyonder.co.uk [82.33.62.105]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8397543D5D for ; Tue, 13 Apr 2004 08:50:43 -0700 (PDT) (envelope-from freebsd.macgregor@blueyonder.co.uk) X-Urban-Legend: Mail headers contain urban legends Received: from fire (fire.macgregor [192.168.32.100]) by the-macgregors.org (8.12.11/8.12.11) with ESMTP id i3DFofif023274 for ; Tue, 13 Apr 2004 15:50:41 GMT Message-Id: <200404131550.i3DFofif023274@the-macgregors.org> From: "Rob MacGregor" To: Date: Tue, 13 Apr 2004 16:50:41 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.5510 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 In-Reply-To: <20040413095325.GA26424@profi.kharkov.ua> Thread-Index: AcQhT0GaR49bLfBnT+mti2hzfndZpwAH6cGg X-Virus-Scanned: by amavisd-milter (http://www.amavis.org/) Subject: RE: looking for killpower source X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2004 15:50:45 -0000 Only one post is required... Take a look at NUT (Network UPS Tools), which is in the ports. It should do everything you want. You can find the web page at http://www.networkupstools.org. -- Rob | Oh my God! They killed init! You bastards! > -----Original Message----- > From: owner-freebsd-hackers@freebsd.org > [mailto:owner-freebsd-hackers@freebsd.org] On Behalf Of > Gregory Edigarov > Sent: Tuesday, April 13, 2004 10:53 AM > To: freebsd-hackers@freebsd.org > Subject: looking for killpower source > > Hi, > > I need killpower (invertor shutdown) source for any USB UPS. I have > APC BackUPS RS 500, but any other source should help, if it works > under FreeBSD. > Thanks a lot in advance. > > -- > With best regards, > Gregory Edigarov > -------------------------------------------------------------- > ---------------- > profi.kharkov.ua > Systems Administrator > -------------------------------------------------------------- > ---------------- > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to > "freebsd-hackers-unsubscribe@freebsd.org" > > > From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 13 09:16:24 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 45CBF16A4CE for ; Tue, 13 Apr 2004 09:16:24 -0700 (PDT) Received: from hanoi.cronyx.ru (hanoi.cronyx.ru [144.206.181.53]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8938C43D2F for ; Tue, 13 Apr 2004 09:16:23 -0700 (PDT) (envelope-from rik@cronyx.ru) Received: (from root@localhost) by hanoi.cronyx.ru id i3DGE7TJ054989 for freebsd-hackers@freebsd.org.checked; (8.12.8/vak/2.1) Tue, 13 Apr 2004 20:14:07 +0400 (MSD) (envelope-from rik@cronyx.ru) Received: from cronyx.ru (hi.cronyx.ru [144.206.181.94]) by hanoi.cronyx.ru with ESMTP id i3DGBRxs054899 for ; (8.12.8/vak/2.1) Tue, 13 Apr 2004 20:11:27 +0400 (MSD) (envelope-from rik@cronyx.ru) Message-ID: <407C1127.9080202@cronyx.ru> Date: Tue, 13 Apr 2004 20:11:19 +0400 From: Roman Kurakin User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031208 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: sysinstall X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2004 16:16:24 -0000 Hi, If sysinstall detects wrong geometry, it tries to correct it and suggests to use G option to chage geometry if I disagree with it. But it doesn't allow to set whatever geometry I want with G. Is this intentional behaviour or it should be fixed. (in case it should be fixed I may send my solution of this problem). PS. While searching for other things, I repeatedly faced with threads about such problem, and if my memory does not fail, I saw pr about it. But now I can't find any prs and messages about this behaviour of sysinstall. So please take my apologies if I am opening already closed subject. Best regards, Roman Kurakin From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 13 14:52:03 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 513E216A4CE; Tue, 13 Apr 2004 14:52:03 -0700 (PDT) Received: from ms-smtp-02-eri0.southeast.rr.com (ms-smtp-02-lbl.southeast.rr.com [24.25.9.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id D68E843D1F; Tue, 13 Apr 2004 14:52:02 -0700 (PDT) (envelope-from jason@ec.rr.com) Received: from ec.rr.com (cpe-024-211-231-149.ec.rr.com [24.211.231.149]) i3DLpwkF007814; Tue, 13 Apr 2004 17:51:58 -0400 (EDT) Message-ID: <407C61B6.1020005@ec.rr.com> Date: Tue, 13 Apr 2004 17:55:02 -0400 From: jason User-Agent: Mozilla Thunderbird 0.5 (X11/20040330) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Baldur Gislason References: <200404011954.51014.baldur@foo.is> In-Reply-To: <200404011954.51014.baldur@foo.is> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Symantec AntiVirus Scan Engine cc: freebsd-hackers@freebsd.org cc: freebsd-hardware@freebsd.org Subject: Re: Invalid realloc size of 0 when installing on an AMD athlonXP barton powered machine X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2004 21:52:03 -0000 Baldur Gislason wrote: >I'm trying to install 5.2.1-rel from FTP with an intel 100Mb network card on >an AMD AthlonXP barton 2500+ with an Aopen AK77-8XN motherboard and 1GB ram. >When at 65% through extracting base, sysinstall crashes with the message: >Fatal error: Invalid realloc size of 0! - PRESS ANY KEY TO REBOOT >I know this is a very common problem these days, has any solution been found? >I'd rather sell this machine than using some other operating system on it. > >Baldur > >_______________________________________________ >freebsd-hardware@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-hardware >To unsubscribe, send any mail to "freebsd-hardware-unsubscribe@freebsd.org" > > > I have an athlon barton core on an epox 8rda3i. I have never seen this problem and I cvsup every few weeks on current. I have not done a clean install since last year. Is that a local ftp or the net? Can you make a cd from the iso, or do you not want to? I have done both in the past and the cd is much faster, even if you hae broad band. Maybe not if you have a t3 or better, but not all ftp servers will be fast all the time. From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 13 20:11:00 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DED6616A4CE for ; Tue, 13 Apr 2004 20:11:00 -0700 (PDT) Received: from smtp3b.sentex.ca (smtp3b.sentex.ca [205.211.164.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9AFC343D5A for ; Tue, 13 Apr 2004 20:11:00 -0700 (PDT) (envelope-from mike@sentex.net) Received: from smtp1.sentex.ca (smtp1.sentex.ca [199.212.134.4]) by smtp3b.sentex.ca (8.12.11/8.12.11) with ESMTP id i3E3AwvZ020519; Tue, 13 Apr 2004 23:10:58 -0400 (EDT) (envelope-from mike@sentex.net) Received: from BLUELAPIS.sentex.ca (cage.simianscience.com [64.7.134.1]) by smtp1.sentex.ca (8.12.11/8.12.11) with SMTP id i3E3AwIZ045657; Tue, 13 Apr 2004 23:10:58 -0400 (EDT) (envelope-from mike@sentex.net) From: Mike Tancsa To: "Rob MacGregor" Date: Tue, 13 Apr 2004 23:11:09 -0400 Message-ID: References: <20040413095325.GA26424@profi.kharkov.ua> <200404131550.i3DFofif023274@the-macgregors.org> In-Reply-To: <200404131550.i3DFofif023274@the-macgregors.org> X-Mailer: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable cc: freebsd-hackers@freebsd.org Subject: Re: looking for killpower source X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2004 03:11:01 -0000 On Tue, 13 Apr 2004 16:50:41 +0100, in sentex.lists.freebsd.hackers you wrote: >Only one post is required... > >Take a look at NUT (Network UPS Tools), which is in the ports. It >should do everything you want. You can find the web page at >http://www.networkupstools.org. I think he is looking for USB info. From the NUT FAQ, Q: I just bought a new WhizBang UPS that has a USB connector. How do I monitor it? A: If you're using a very new version of Linux that has hiddev support or just happen to have the hiddev patches applied and working, you're in luck. On any other system or an older Linux kernel, there's nothing for you just yet. ----Mike From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 13 05:26:58 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8E1E216A4CE for ; Tue, 13 Apr 2004 05:26:58 -0700 (PDT) Received: from tower.berklix.org (bsd.bsn.com [194.221.32.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9AD2343D6B for ; Tue, 13 Apr 2004 05:26:57 -0700 (PDT) (envelope-from jhs@flat.berklix.net) Received: from js.berklix.net (pD9E4DD69.dip.t-dialin.net [217.228.221.105]) (authenticated bits=0) by tower.berklix.org (8.12.9p2/8.12.9) with ESMTP id i3DCQsk3064261; Tue, 13 Apr 2004 14:26:55 +0200 (CEST) (envelope-from jhs@flat.berklix.net) Received: from fire.jhs.private (fire.jhs.private [192.168.91.41]) by js.berklix.net (8.12.9p2/8.12.9) with ESMTP id i3DCQrOs027742; Tue, 13 Apr 2004 14:26:53 +0200 (CEST) (envelope-from jhs@flat.berklix.net) Received: from fire.jhs.private (localhost [127.0.0.1]) by fire.jhs.private (8.12.9p2/8.12.9) with ESMTP id i3DCQl8p058239; Tue, 13 Apr 2004 14:26:47 +0200 (CEST) (envelope-from jhs@fire.jhs.private) Message-Id: <200404131226.i3DCQl8p058239@fire.jhs.private> To: Gregory Edigarov In-Reply-To: Message from Gregory Edigarov <20040413101334.GD26803@profi.kharkov.ua> Date: Tue, 13 Apr 2004 14:26:47 +0200 From: "Julian H. Stacey" X-Mailman-Approved-At: Wed, 14 Apr 2004 05:18:15 -0700 cc: freebsd-hackers@freebsd.org Subject: Re: killpower(UPS inverter shutdown) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2004 12:26:58 -0000 Gregory Edigarov wrote: > Hello, > > If anyone have the working sources to killpower an USB UPS under > FreeBSD please enlight me. I have APC RS 500, but an example for any > other should also be ok. Thanks a lot in advance. Tip: Also try mail lists & web of the UPS ports on FreeBSD (4 when I counted, a couple of year back,) inc. my favourite: /usr/ports/sysutils/nut -- This is a developing project to monitor a large assortment of UPS hardware. Network communications are used so that multiple systems can monitor a single physical UPS and shut down together if necessary without any special "sharing hardware" on the UPS itself. CGI scripts provided to monitor UPS status via WEB browser. -- - Julian Stacey. Unix C & Net Services Consultant - Munich. http://berklix.com Mail me in Ascii text/plain: Html is dumped as Spam. Schnupftabak probieren: Ihr Rauchen = mein allergischer Kopfschmerz ! Surplus hardware http://berklix.com/surplus/ From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 13 17:19:17 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6824916A4CE for ; Tue, 13 Apr 2004 17:19:17 -0700 (PDT) Received: from smtp.mmedia.is (smtp.mmedia.is [217.151.180.18]) by mx1.FreeBSD.org (Postfix) with ESMTP id AFEF143D45 for ; Tue, 13 Apr 2004 17:19:16 -0700 (PDT) (envelope-from baldur@foo.is) Received: from acabus (tesla.foo.is [217.151.166.96])i3E0J6eY014068; Wed, 14 Apr 2004 00:19:07 GMT From: Baldur Gislason To: jason Date: Wed, 14 Apr 2004 00:19:05 +0000 User-Agent: KMail/1.5.4 References: <200404011954.51014.baldur@foo.is> <407C61B6.1020005@ec.rr.com> In-Reply-To: <407C61B6.1020005@ec.rr.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200404140019.05393.baldur@foo.is> X-Mailman-Approved-At: Wed, 14 Apr 2004 05:18:15 -0700 cc: freebsd-hackers@freebsd.org Subject: Re: Invalid realloc size of 0 when installing on an AMD athlonXP barton poweredmachine X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2004 00:19:17 -0000 Turned out to be a bug in sysinstall when booting from a floppy and installing over a network, I had no problems when I just wrote the ISO but I prefer network install since it takes me about an hour to download the ISO, and by that time I could have the machine up and running if I used network install. Baldur On Tuesday 13 April 2004 21:55, jason wrote: > Baldur Gislason wrote: > >I'm trying to install 5.2.1-rel from FTP with an intel 100Mb network card > > on an AMD AthlonXP barton 2500+ with an Aopen AK77-8XN motherboard and > > 1GB ram. When at 65% through extracting base, sysinstall crashes with the > > message: Fatal error: Invalid realloc size of 0! - PRESS ANY KEY TO > > REBOOT I know this is a very common problem these days, has any solution > > been found? I'd rather sell this machine than using some other operating > > system on it. > > > >Baldur > > > >_______________________________________________ > >freebsd-hardware@freebsd.org mailing list > >http://lists.freebsd.org/mailman/listinfo/freebsd-hardware > >To unsubscribe, send any mail to > > "freebsd-hardware-unsubscribe@freebsd.org" > > I have an athlon barton core on an epox 8rda3i. I have never seen this > problem and I cvsup every few weeks on current. I have not done a clean > install since last year. Is that a local ftp or the net? Can you make > a cd from the iso, or do you not want to? I have done both in the past > and the cd is much faster, even if you hae broad band. Maybe not if you > have a t3 or better, but not all ftp servers will be fast all the time. > _______________________________________________ > freebsd-hardware@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hardware > To unsubscribe, send any mail to "freebsd-hardware-unsubscribe@freebsd.org" From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 14 14:56:03 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 41FBD16A4D0 for ; Wed, 14 Apr 2004 14:56:03 -0700 (PDT) Received: from sccrmhc12.comcast.net (sccrmhc12.comcast.net [204.127.202.56]) by mx1.FreeBSD.org (Postfix) with ESMTP id 01B6E43D4C for ; Wed, 14 Apr 2004 14:56:02 -0700 (PDT) (envelope-from rodrigc@h00609772adf0.ne.client2.attbi.com) Received: from dibbler.crodrigues.org (h00609772adf0.ne.client2.attbi.com[66.31.45.197]) by comcast.net (sccrmhc12) with ESMTP id <20040414215602012001em6le>; Wed, 14 Apr 2004 21:56:02 +0000 Received: from dibbler.crodrigues.org (localhost.crodrigues.org [127.0.0.1]) i3ELu2QD004022 for ; Wed, 14 Apr 2004 17:56:02 -0400 (EDT) (envelope-from rodrigc@h00609772adf0.ne.client2.attbi.com) Received: (from rodrigc@localhost) by dibbler.crodrigues.org (8.12.11/8.12.11/Submit) id i3ELu13u004021 for freebsd-hackers@freebsd.org; Wed, 14 Apr 2004 17:56:01 -0400 (EDT) (envelope-from rodrigc) Date: Wed, 14 Apr 2004 17:56:01 -0400 From: Craig Rodrigues To: freebsd-hackers@freebsd.org Message-ID: <20040414215601.GA3923@crodrigues.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Subject: C code for parsing rc.conf? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2004 21:56:03 -0000 Hi, Is there a C library that comes with FreeBSD which can be used to parse, append to, and validate rc.conf? I'd like to customize some of the settings in /etc/rc.conf with my own GUI-based program. It's not too hard to write something on my own, but I was wondering if a reusable library existed in FreeBSD 4.x or 5.x for doing this. Thanks. -- Craig Rodrigues http://crodrigues.org rodrigc@crodrigues.org From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 14 15:23:08 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AD0B816A4CE for ; Wed, 14 Apr 2004 15:23:08 -0700 (PDT) Received: from thong.s2s.msu.ru (thong.s2s.msu.ru [193.232.119.74]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9411B43D31 for ; Wed, 14 Apr 2004 15:23:07 -0700 (PDT) (envelope-from chinhngt@sectorb.msk.ru) Received: from hq.sectorb.msk.ru (petaflop.lcm.msu.ru [193.232.113.220]) by thong.s2s.msu.ru (Postfix) with ESMTP id C2313864B; Thu, 15 Apr 2004 02:23:05 +0400 (MSD) Received: from unix.local (unix.local [172.16.12.120]) by hq.sectorb.msk.ru (Postfix) with ESMTP id 359791A81; Thu, 15 Apr 2004 02:23:05 +0400 (MSD) Date: Thu, 15 Apr 2004 02:23:15 +0400 (MSD) From: Nguyen Tam Chinh X-X-Sender: chinhngt@chinhngt.b.gz.ru To: Craig Rodrigues In-Reply-To: <20040414215601.GA3923@crodrigues.org> Message-ID: <20040415021631.N1878@chinhngt.b.gz.ru> References: <20040414215601.GA3923@crodrigues.org> Website: http://chinhngt.hotmail.ru Home-addr: Vietnam_SR:Hue-city:45-Le_Huan-st Current-addr: Russian_Federation:Moscow:119234:Main_Building-MSU:Sector_B:Room_539 Keywords: 216091683 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org Subject: Re: C code for parsing rc.conf? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2004 22:23:08 -0000 On Wed, 14 Apr 2004, Craig Rodrigues wrote: > Hi, > > Is there a C library that comes with FreeBSD which > can be used to parse, append to, and validate > rc.conf? > > I'd like to customize some of the settings in /etc/rc.conf > with my own GUI-based program. It's not too hard > to write something on my own, but I was wondering > if a reusable library existed in FreeBSD 4.x or 5.x for doing this. > rc.conf is parsed/executed by scripts in /etc/rc*. With your GUI program, simply take and change these scripts. ----- With best regards, | The Power to Serve Nguyen Tam Chinh | http://www.FreeBSD.org From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 14 15:31:54 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9FF7E16A4CE for ; Wed, 14 Apr 2004 15:31:54 -0700 (PDT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 43E5243D48 for ; Wed, 14 Apr 2004 15:31:54 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.10/8.12.10) id i3EMVaCF018902; Wed, 14 Apr 2004 17:31:36 -0500 (CDT) (envelope-from dan) Date: Wed, 14 Apr 2004 17:31:36 -0500 From: Dan Nelson To: Nguyen Tam Chinh Message-ID: <20040414223136.GG28745@dan.emsphone.com> References: <20040414215601.GA3923@crodrigues.org> <20040415021631.N1878@chinhngt.b.gz.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040415021631.N1878@chinhngt.b.gz.ru> X-OS: FreeBSD 5.2-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.6i cc: Craig Rodrigues cc: freebsd-hackers@freebsd.org Subject: Re: C code for parsing rc.conf? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2004 22:31:54 -0000 In the last episode (Apr 15), Nguyen Tam Chinh said: > On Wed, 14 Apr 2004, Craig Rodrigues wrote: > > Is there a C library that comes with FreeBSD which can be used to > > parse, append to, and validate rc.conf? > > > > I'd like to customize some of the settings in /etc/rc.conf with my > > own GUI-based program. It's not too hard to write something on my > > own, but I was wondering if a reusable library existed in FreeBSD > > 4.x or 5.x for doing this. > > rc.conf is parsed/executed by scripts in /etc/rc*. With your GUI > program, simply take and change these scripts. .. and be aware that although most lines will be in the standard name="value" format, admins are free to put any shell syntax or commands they like in there. So make sure your gui tool preserves unchanged lines when saving (instead of regenerating the entire file from a parsed array, for example). That will let an admin use shell tricks to generate ifconfig_XX0_aliasXX variables, for example, and still allow using your tool to change moused flags. -- Dan Nelson dnelson@allantgroup.com From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 14 15:34:51 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8656F16A4D0 for ; Wed, 14 Apr 2004 15:34:51 -0700 (PDT) Received: from sccrmhc12.comcast.net (sccrmhc12.comcast.net [204.127.202.56]) by mx1.FreeBSD.org (Postfix) with ESMTP id 28C6343D5F for ; Wed, 14 Apr 2004 15:34:51 -0700 (PDT) (envelope-from berhart@erhartgroup.com) Received: from cocaine.erhartgroup.com (c-67-166-0-138.client.comcast.net[67.166.0.138]) by comcast.net (sccrmhc12) with SMTP id <20040414223449012001h9sje>; Wed, 14 Apr 2004 22:34:50 +0000 Message-Id: <6.0.2.0.2.20040414162810.01c8cb48@mx1.erhartgroup.com> X-Sender: berhart%erhartgroup.com@mx1.erhartgroup.com (Unverified) X-Mailer: QUALCOMM Windows Eudora Version 6.0.2.0 Date: Wed, 14 Apr 2004 16:35:02 -0600 To: Craig Rodrigues From: Brandon Erhart In-Reply-To: <20040414215601.GA3923@crodrigues.org> References: <20040414215601.GA3923@crodrigues.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed cc: freebsd-hackers@freebsd.org Subject: Re: C code for parsing rc.conf? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2004 22:34:51 -0000 Not that I know of, but it should be a breeze to write a simple parsing engine. Just ignore all lines starting with a '#', and break at the '=' sign. The first part would be your variable name, the last part your value for it. Then just display variables and their names, and maybe parse the variable names so you can assign meaningful help information to them. I didn't compile this, not sure if it'll work, but it'll give you a good idea as to what your code may look like .. int main(int argc, char **argv) { FILE *rc; char buf[512]; if ( (rc=fopen("/etc/rc.conf", "r")) == NULL) { perror("fopen()"); exit(EXIT_FAILURE); } while (fgets(buf, sizeof(buf), rc) != NULL) { char *eq_ptr, var_name[256], var_value[256]; some_function_to_strip_trailing_and_pre_whitespace(buf); /* this function will just strip pre- and trailing whitespace from the line */ if (!strlen(buf)) continue; /* blank line */ if (buf[0] == '#') continue; /* comment line */ if ( (eq_ptr = index(buf, '=')) == NULL) continue; /* no equal sign */ *eq_ptr = '\0'; memset(var_name, 0, 256); memset(var_value, 0, 256); if (!strlen(buf) || !strlen(eq_ptr+1)) continue; /* either the variable name or the value was empty */ strncpy(var_name, buf, 255); strncpy(var_value, eq_ptr+1, 255); printf("%s=%s\n", var_name, var_value); } exit(EXIT_SUCCESS); } At 03:56 PM 4/14/2004, you wrote: >Hi, > >Is there a C library that comes with FreeBSD which >can be used to parse, append to, and validate >rc.conf? > >I'd like to customize some of the settings in /etc/rc.conf >with my own GUI-based program. It's not too hard >to write something on my own, but I was wondering >if a reusable library existed in FreeBSD 4.x or 5.x for doing this. > >Thanks. > >-- >Craig Rodrigues >http://crodrigues.org >rodrigc@crodrigues.org >_______________________________________________ >freebsd-hackers@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-hackers >To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 14 15:59:26 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EF62616A4CE for ; Wed, 14 Apr 2004 15:59:26 -0700 (PDT) Received: from web10505.mail.yahoo.com (web10505.mail.yahoo.com [216.136.130.155]) by mx1.FreeBSD.org (Postfix) with SMTP id CA98D43D2F for ; Wed, 14 Apr 2004 15:59:26 -0700 (PDT) (envelope-from b_oshea@yahoo.com) Message-ID: <20040414225922.41892.qmail@web10505.mail.yahoo.com> Received: from [156.153.254.41] by web10505.mail.yahoo.com via HTTP; Wed, 14 Apr 2004 15:59:22 PDT Date: Wed, 14 Apr 2004 15:59:22 -0700 (PDT) From: Brian O'Shea To: Brandon Erhart , Craig Rodrigues In-Reply-To: <6.0.2.0.2.20040414162810.01c8cb48@mx1.erhartgroup.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii cc: freebsd-hackers@freebsd.org Subject: Re: C code for parsing rc.conf? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2004 22:59:27 -0000 --- Brandon Erhart wrote: > Not that I know of, but it should be a breeze to write a simple parsing > engine. > Just ignore all lines starting with a '#', and break at the '=' sign. The > first part would be your variable name, the last part your value for it. Don't forget to deal with quotes: some_variable="Double-quoted value" - or - some_other_variable='Single-quoted value' Not to mention lines with trailing comments: some_variable="Some Value" # Set some variable to some value. And, as somebody else pointed out, some other embedded shell syntax (which might contain an equal sign, so just blindly splitting lines on equal signs won't work): if [ "$some_variable" = "NO" ]; then # do something here... fi Remember that /etc/rc.conf is just a shell script, and so it is parsed by the shell interpreter (/bin/sh). You might end up writing a shell parser if you want to cover all possibilities! (in other words, re-inventing the wheel.) Be careful. -brian > Then just display variables and their names, and maybe parse the variable > names so you can assign meaningful help information to them. > > I didn't compile this, not sure if it'll work, but it'll give you a good > idea as to what your code may look like .. > [...] __________________________________ Do you Yahoo!? Yahoo! Tax Center - File online by April 15th http://taxes.yahoo.com/filing.html From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 14 17:05:04 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 85A4E16A4CE for ; Wed, 14 Apr 2004 17:05:04 -0700 (PDT) Received: from sccrmhc12.comcast.net (sccrmhc12.comcast.net [204.127.202.56]) by mx1.FreeBSD.org (Postfix) with ESMTP id 17BA043D1F for ; Wed, 14 Apr 2004 17:05:04 -0700 (PDT) (envelope-from berhart@erhartgroup.com) Received: from cocaine.erhartgroup.com (c-67-166-0-138.client.comcast.net[67.166.0.138]) by comcast.net (sccrmhc12) with SMTP id <20040415000502012001fgene>; Thu, 15 Apr 2004 00:05:03 +0000 Message-Id: <6.0.2.0.2.20040414180437.01c87ac0@mx1.erhartgroup.com> X-Sender: berhart%erhartgroup.com@mx1.erhartgroup.com (Unverified) X-Mailer: QUALCOMM Windows Eudora Version 6.0.2.0 Date: Wed, 14 Apr 2004 18:05:15 -0600 To: Brian O'Shea From: Brandon Erhart In-Reply-To: <20040414225922.41892.qmail@web10505.mail.yahoo.com> References: <6.0.2.0.2.20040414162810.01c8cb48@mx1.erhartgroup.com> <20040414225922.41892.qmail@web10505.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed cc: freebsd-hackers@freebsd.org Subject: Re: C code for parsing rc.conf? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2004 00:05:04 -0000 Ah yes, I was just being crude .. giving some lame example :-P Parsing the rc.conf would take considerably more work than that "Tha whistles go WOOOOOO!" - Bubb Rubb Brandon At 04:59 PM 4/14/2004, you wrote: >--- Brandon Erhart wrote: > > Not that I know of, but it should be a breeze to write a simple parsing > > engine. > > Just ignore all lines starting with a '#', and break at the '=' sign. The > > first part would be your variable name, the last part your value for it. > >Don't forget to deal with quotes: > >some_variable="Double-quoted value" > > - or - > >some_other_variable='Single-quoted value' > >Not to mention lines with trailing comments: > >some_variable="Some Value" # Set some variable to some value. > >And, as somebody else pointed out, some other embedded shell syntax (which >might contain an equal sign, so just blindly splitting lines on equal signs >won't work): > >if [ "$some_variable" = "NO" ]; then > # do something here... >fi > >Remember that /etc/rc.conf is just a shell script, and so it is parsed by >the shell interpreter (/bin/sh). You might end up writing a shell parser >if you want to cover all possibilities! (in other words, re-inventing the >wheel.) Be careful. > >-brian > > > Then just display variables and their names, and maybe parse the variable > > names so you can assign meaningful help information to them. > > > > I didn't compile this, not sure if it'll work, but it'll give you a good > > idea as to what your code may look like .. > > >[...] > > > > > >__________________________________ >Do you Yahoo!? >Yahoo! Tax Center - File online by April 15th >http://taxes.yahoo.com/filing.html From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 14 17:15:04 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0968F16A4CE for ; Wed, 14 Apr 2004 17:15:04 -0700 (PDT) Received: from kientzle.com (h-66-166-149-50.snvacaid.covad.net [66.166.149.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id E793343D2D for ; Wed, 14 Apr 2004 17:15:02 -0700 (PDT) (envelope-from tim@kientzle.com) Received: from kientzle.com (p54.kientzle.com [66.166.149.54]) by kientzle.com (8.12.9/8.12.9) with ESMTP id i3F0Es90032428; Wed, 14 Apr 2004 17:14:54 -0700 (PDT) (envelope-from tim@kientzle.com) Message-ID: <407DD3FE.5010303@kientzle.com> Date: Wed, 14 Apr 2004 17:14:54 -0700 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20031006 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Craig Rodrigues References: <20040414215601.GA3923@crodrigues.org> In-Reply-To: <20040414215601.GA3923@crodrigues.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re: C code for parsing rc.conf? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2004 00:15:04 -0000 Craig Rodrigues wrote: > Is there a C library that comes with FreeBSD which > can be used to parse, append to, and validate > rc.conf? > > I'd like to customize some of the settings in /etc/rc.conf > with my own GUI-based program. It's not too hard > to write something on my own, but I was wondering > if a reusable library existed in FreeBSD 4.x or 5.x for doing this. There was a detailed discussion of this topic about a year ago. Here is how to obtain the current settings from rc.conf from within a C program: * Clear the current environment * popen() a shell command that sources rc.conf, then runs printenv * read and parse the output of printenv The basic idea is to just let the shell do the work for you. You can make this process a bit more predictable by using a modified printenv that dumps variable names and values in hex or something similar. (Or, submit a patch to the existing printenv.) To update rc.conf, just append new statements to the end of the file. Don't try to edit it in place. Later variable settings will override earlier ones, so this will have the expected result without possibly trashing someone's custom shell scripting. I may have overlooked a few details, but this should be enough to get you started. Tim Kientzle From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 14 23:29:34 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9E79D16A4CE for ; Wed, 14 Apr 2004 23:29:34 -0700 (PDT) Received: from bogslab.ucdavis.edu (bogslab.ucdavis.edu [169.237.68.34]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7B12D43D31 for ; Wed, 14 Apr 2004 23:29:34 -0700 (PDT) (envelope-from gkshenaut@ucdavis.edu) Received: from [198.137.203.49] (merlin.bogs.org [198.137.203.49]) by bogslab.ucdavis.edu (8.12.8/8.12.8) with ESMTP id i3F6TJDb034062; Wed, 14 Apr 2004 23:29:19 -0700 (PDT) In-Reply-To: <407DD3FE.5010303@kientzle.com> References: <20040414215601.GA3923@crodrigues.org> <407DD3FE.5010303@kientzle.com> Mime-Version: 1.0 (Apple Message framework v613) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Greg Shenaut Date: Wed, 14 Apr 2004 23:25:28 -0700 To: Tim Kientzle X-Mailer: Apple Mail (2.613) cc: freebsd-hackers@freebsd.org cc: Craig Rodrigues Subject: Re: C code for parsing rc.conf? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2004 06:29:34 -0000 On Apr 14, 2004, at 5:14 PM, Tim Kientzle wrote: > Craig Rodrigues wrote: >> Is there a C library that comes with FreeBSD which >> can be used to parse, append to, and validate >> rc.conf? >> I'd like to customize some of the settings in /etc/rc.conf >> with my own GUI-based program. It's not too hard >> to write something on my own, but I was wondering >> if a reusable library existed in FreeBSD 4.x or 5.x for doing this. > > There was a detailed discussion of this topic about a year > ago. Here is how to obtain the current settings from rc.conf > from within a C program: > > * Clear the current environment > > * popen() a shell command that sources rc.conf, then > runs printenv > > * read and parse the output of printenv > > The basic idea is to just let the shell do > the work for you. It's a little more awkward, but another way to do this is to use a shell shim along the lines of #!/bin/sh . /etc/whatever exec /your/program The shell's environment will be exported to your program's environment. Greg Shenaut From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 15 01:20:48 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ED8A216A4CE; Thu, 15 Apr 2004 01:20:48 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id CFF4343D5F; Thu, 15 Apr 2004 01:20:48 -0700 (PDT) (envelope-from julian@FreeBSD.org) Received: from freefall.freebsd.org (julian@localhost [127.0.0.1]) i3F8Kmbv028557; Thu, 15 Apr 2004 01:20:48 -0700 (PDT) (envelope-from julian@freefall.freebsd.org) Received: (from julian@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i3F8Km7u028556; Thu, 15 Apr 2004 01:20:48 -0700 (PDT) (envelope-from julian) Date: Thu, 15 Apr 2004 01:20:48 -0700 (PDT) From: Julian Elischer Message-Id: <200404150820.i3F8Km7u028556@freefall.freebsd.org> To: hackers@FreeBSD.org, stable@FreeBSD.org cc: developers@FreeBSD.org Subject: small USB MFC for perusal. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2004 08:20:49 -0000 This cleans up most of the remaining MFC issues.. http://www.freebsd.org/~julian/usbdiff these are cosmetic changes to: M if_aue.c M if_cue.c M if_rue.c M uftdi.c M uhci.c M usbdi.c M uscanner.c M uvisor.c M uvscom.c and consists of: ID additions for some devices and probing additions for the Clie 350 one copyright addition and two bits of code missed in the main MFC. (tiny) A couple of variable renames. anyone care to comment? I'd send this to the USB list but it's almost dead.. From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 15 07:39:12 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 15D0016A4CE; Thu, 15 Apr 2004 07:39:12 -0700 (PDT) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4E46543D5A; Thu, 15 Apr 2004 07:39:11 -0700 (PDT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.10/8.12.9) with ESMTP id i3FEdAkj040931; Thu, 15 Apr 2004 08:39:10 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 15 Apr 2004 08:40:07 -0600 (MDT) Message-Id: <20040415.084007.132072802.imp@bsdimp.com> To: julian@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <200404150820.i3F8Km7u028556@freefall.freebsd.org> References: <200404150820.i3F8Km7u028556@freefall.freebsd.org> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: stable@FreeBSD.org cc: hackers@FreeBSD.org cc: developers@FreeBSD.org Subject: Re: small USB MFC for perusal. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2004 14:39:12 -0000 In message: <200404150820.i3F8Km7u028556@freefall.freebsd.org> Julian Elischer writes: : I'd send this to the USB list but it's almost dead.. So instead you send it to a public list and cc a private one? Please don't cross post things to developers. Warner From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 15 10:20:24 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5841516A4CE for ; Thu, 15 Apr 2004 10:20:24 -0700 (PDT) Received: from mail4.speakeasy.net (mail4.speakeasy.net [216.254.0.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2FA3543D1D for ; Thu, 15 Apr 2004 10:20:24 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: (qmail 1981 invoked from network); 15 Apr 2004 17:20:23 -0000 Received: from dsl017-045-168.spk4.dsl.speakeasy.net (HELO hydrogen.funkthat.com) ([69.17.45.168]) (envelope-sender ) by mail4.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 15 Apr 2004 17:20:23 -0000 Received: from hydrogen.funkthat.com (szcdsd@localhost.funkthat.com [127.0.0.1])i3FHKMOE026358; Thu, 15 Apr 2004 10:20:23 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.12.10/8.12.10/Submit) id i3FHKMqc026357; Thu, 15 Apr 2004 10:20:22 -0700 (PDT) Date: Thu, 15 Apr 2004 10:20:22 -0700 From: John-Mark Gurney To: Julian Elischer Message-ID: <20040415172022.GR567@funkthat.com> Mail-Followup-To: Julian Elischer , hackers@freebsd.org, stable@freebsd.org References: <200404150820.i3F8Km7u028556@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200404150820.i3F8Km7u028556@freefall.freebsd.org> User-Agent: Mutt/1.4.1i X-Operating-System: FreeBSD 4.2-RELEASE i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html cc: stable@freebsd.org cc: hackers@freebsd.org Subject: Re: small USB MFC for perusal. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: John-Mark Gurney List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2004 17:20:24 -0000 Julian Elischer wrote this message on Thu, Apr 15, 2004 at 01:20 -0700: > This cleans up most of the remaining MFC issues.. > > http://www.freebsd.org/~julian/usbdiff [...] > ID additions for some devices and probing additions for the Clie 350 > one copyright addition > and two bits of code missed in the main MFC. (tiny) > A couple of variable renames. > > anyone care to comment? Looks minor enough. I don't see any problems with it. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 15 18:44:04 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9027816A4CE for ; Thu, 15 Apr 2004 18:44:04 -0700 (PDT) Received: from mxfep01.bredband.com (mxfep01.bredband.com [195.54.107.70]) by mx1.FreeBSD.org (Postfix) with ESMTP id 719A043D49 for ; Thu, 15 Apr 2004 18:44:03 -0700 (PDT) (envelope-from peter.schuller@infidyne.com) Received: from scode.mine.nu ([213.113.221.56] [213.113.221.56]) by mxfep01.bredband.com with ESMTP id <20040416014402.HUZN7099.mxfep01.bredband.com@scode.mine.nu> for ; Fri, 16 Apr 2004 03:44:02 +0200 Received: from localhost (localhost [127.0.0.1]) by scode.mine.nu (Postfix) with ESMTP id 8287313EDD7 for ; Fri, 16 Apr 2004 03:44:17 +0200 (CEST) From: Peter Schuller To: freebsd-hackers@freebsd.org Date: Fri, 16 Apr 2004 03:44:16 +0200 User-Agent: KMail/1.6 MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200404160344.16704.peter.schuller@infidyne.com> Subject: fsck_ffs: bgfsck fails becuase FS_UNCLEAN is not set X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2004 01:44:04 -0000 Hello, I am trying to track down once and for all why I never seem to be able to enjoy background filesystems on the root filesystem of any machine. I have determined that checkfilesys() in fsck_ffs/main.c is bailing at the following location, thus triggering foreground checking: if ((mntp == NULL && sblock.fs_clean == 1) || (mntp != NULL && (sblock.fs_flags & FS_UNCLEAN) == 0)) exit(7); /* Filesystem clean, report it now */ And I have confirmed that it is because (sblock.fs_flags & FS_UNCLEAN) == 0. The question is why[1]. I cannot find any code that unsets the FS_UNCLEAN flag (except ckfini()). I had expected the problem to be related to the root fs being mounted ro at that point in the boot sequence, which can be worked around. But fsck_ffs is not getting far enough to even check for that... Any pointers would be greatly appreciated. [1] The fs is in fact dirty due to a hard power-off and is detected as such when foreground checking is invoked. -- / Peter Schuller, InfiDyne Technologies HB PGP userID: 0xE9758B7D or 'Peter Schuller ' Key retrieval: Send an E-Mail to getpgpkey@scode.org E-Mail: peter.schuller@infidyne.com Web: http://www.scode.org From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 15 22:49:04 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 444B016A4CE for ; Thu, 15 Apr 2004 22:49:04 -0700 (PDT) Received: from kientzle.com (h-66-166-149-50.snvacaid.covad.net [66.166.149.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id F0B0943D53 for ; Thu, 15 Apr 2004 22:49:03 -0700 (PDT) (envelope-from tim@kientzle.com) Received: from kientzle.com (p54.kientzle.com [66.166.149.54]) by kientzle.com (8.12.9/8.12.9) with ESMTP id i3G5mx90041587; Thu, 15 Apr 2004 22:48:59 -0700 (PDT) (envelope-from tim@kientzle.com) Message-ID: <407F73C8.8090306@kientzle.com> Date: Thu, 15 Apr 2004 22:48:56 -0700 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20031006 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Greg Shenaut References: <20040414215601.GA3923@crodrigues.org> <407DD3FE.5010303@kientzle.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org cc: Craig Rodrigues Subject: Re: C code for parsing rc.conf? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2004 05:49:04 -0000 Greg Shenaut wrote: > On Apr 14, 2004, at 5:14 PM, Tim Kientzle wrote: >> Craig Rodrigues wrote: >> >>> Is there a C library that comes with FreeBSD which >>> can be used to parse, append to, and validate >>> rc.conf? >> >> * Clear the current environment >> * popen() a shell command that sources rc.conf, then >> runs printenv >> * read and parse the output of printenv >> >> The basic idea is to just let the shell do >> the work for you. > > It's a little more awkward, but another way to do this is to use a shell > shim > along the lines of > > #!/bin/sh > . /etc/whatever > exec /your/program > > The shell's environment will be exported to your program's environment. Not quite. This approach gives you the rc.conf settings intermingled with the rest of the environment, which is probably not what you want. (It's okay if you're just testing a few particular rc.conf settings, but if you want to collect an accurate list of all rc.conf settings, it won't do.) Tim Kientzle From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 15 23:31:57 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AFE3016A4CE for ; Thu, 15 Apr 2004 23:31:57 -0700 (PDT) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 36A3C43D1F for ; Thu, 15 Apr 2004 23:31:56 -0700 (PDT) (envelope-from doconnor@gsoft.com.au) Received: from inchoate.gsoft.com.au (localhost [127.0.0.1]) (authenticated bits=0) by cain.gsoft.com.au (8.12.9/8.12.8) with ESMTP id i3G6VNQ9019058; Fri, 16 Apr 2004 16:01:24 +0930 (CST) (envelope-from doconnor@gsoft.com.au) From: "Daniel O'Connor" To: freebsd-hackers@freebsd.org Date: Fri, 16 Apr 2004 16:01:21 +0930 User-Agent: KMail/1.6.1 References: <20040414215601.GA3923@crodrigues.org> <407F73C8.8090306@kientzle.com> In-Reply-To: <407F73C8.8090306@kientzle.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200404161601.21446.doconnor@gsoft.com.au> X-Spam-Score: -3.6 () CARRIAGE_RETURNS,IN_REP_TO,REFERENCES,SPAM_PHRASE_02_03,USER_AGENT,USER_AGENT_KMAIL X-Scanned-By: MIMEDefang 2.16 (www . roaringpenguin . com / mimedefang) cc: Craig Rodrigues Subject: Re: C code for parsing rc.conf? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2004 06:31:57 -0000 On Fri, 16 Apr 2004 15:18, Tim Kientzle wrote: > > The shell's environment will be exported to your program's environment. > > Not quite. This approach gives you the rc.conf settings > intermingled with the rest of the environment, which is > probably not what you want. > > (It's okay if you're just testing a few particular > rc.conf settings, but if you want to collect an accurate > list of all rc.conf settings, it won't do.) And it still only gives you read-only access to shell-trick mangled parameters. I suspect those are pretty rare and a parser which noted which parameters it couldn't parse and reproduced them verbatim out write-out would probably be OK. -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 9A8C 569F 685A D928 5140 AE4B 319B 41F4 5D17 FDD5 From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 16 04:19:47 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5C61A16A4CE for ; Fri, 16 Apr 2004 04:19:47 -0700 (PDT) Received: from rwcrmhc11.comcast.net (rwcrmhc11.comcast.net [204.127.198.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1E47D43D41 for ; Fri, 16 Apr 2004 04:19:47 -0700 (PDT) (envelope-from rodrigc@h00609772adf0.ne.client2.attbi.com) Received: from dibbler.crodrigues.org (h00609772adf0.ne.client2.attbi.com[66.31.45.197]) by comcast.net (rwcrmhc11) with ESMTP id <2004041611194601300fbsope>; Fri, 16 Apr 2004 11:19:46 +0000 Received: from dibbler.crodrigues.org (localhost.crodrigues.org [127.0.0.1]) i3GBJjSu023311; Fri, 16 Apr 2004 07:19:45 -0400 (EDT) (envelope-from rodrigc@h00609772adf0.ne.client2.attbi.com) Received: (from rodrigc@localhost) by dibbler.crodrigues.org (8.12.11/8.12.11/Submit) id i3GBJjI5023310; Fri, 16 Apr 2004 07:19:45 -0400 (EDT) (envelope-from rodrigc) Date: Fri, 16 Apr 2004 07:19:45 -0400 From: Craig Rodrigues To: Tim Kientzle Message-ID: <20040416111945.GA23290@crodrigues.org> References: <20040414215601.GA3923@crodrigues.org> <407DD3FE.5010303@kientzle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <407DD3FE.5010303@kientzle.com> User-Agent: Mutt/1.4.1i cc: freebsd-hackers@freebsd.org Subject: Re: C code for parsing rc.conf? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2004 11:19:47 -0000 On Wed, Apr 14, 2004 at 05:14:54PM -0700, Tim Kientzle wrote: > There was a detailed discussion of this topic about a year > ago. Here is how to obtain the current settings from rc.conf > from within a C program: > > * Clear the current environment > > * popen() a shell command that sources rc.conf, then > runs printenv > > * read and parse the output of printenv I like this. Would it be worth putting a small writeup of this in the Developer's Handbook? Being able to write programs which can parse and edit rc.conf is actually quite useful in certain cases. An analogy for this would be the API that is used to read/write settings to the Windows registry. On a side note, is there any code in sysinstall that could be reused outside of the sysinstall application in order to parse rc.conf? -- Craig Rodrigues http://crodrigues.org rodrigc@crodrigues.org From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 15 08:33:09 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 14CCB16A4D0 for ; Thu, 15 Apr 2004 08:33:09 -0700 (PDT) Received: from hotmail.com (bay14-dav32.bay14.hotmail.com [64.4.48.89]) by mx1.FreeBSD.org (Postfix) with ESMTP id EBF8943D41 for ; Thu, 15 Apr 2004 08:33:08 -0700 (PDT) (envelope-from liamtohhu@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Thu, 15 Apr 2004 08:33:08 -0700 Received: from 61.187.54.11 by bay14-dav32.bay14.hotmail.com with DAV; Thu, 15 Apr 2004 15:33:08 +0000 X-Originating-IP: [61.187.54.11] X-Originating-Email: [liamtohhu@hotmail.com] X-Sender: liamtohhu@hotmail.com From: "HU Xiang-hua" To: Date: Thu, 15 Apr 2004 23:32:50 +0800 MIME-Version: 1.0 X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Message-ID: X-OriginalArrivalTime: 15 Apr 2004 15:33:08.0835 (UTC) FILETIME=[F443FB30:01C422FE] X-Mailman-Approved-At: Fri, 16 Apr 2004 05:09:11 -0700 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.1 Subject: how to disable/enable kbd during kernel startup? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2004 15:33:09 -0000 hi, I have tried to display a progress bar during FreeBSD5.2 startup. = The method is based on splash_bmp and insert several PROGRESS like Linux = Progress Patch into mi_startup and rc.sysinit. It is urgly ,but it do = work! :-) Now the problem is: any key pressed during kernel startup will ruin the = splash progress, and disable to show "login:".=20 So I want to disable keyboard for the period of kernel startup. I = comment out kbd_enable in kbd_atttach(), but how can I enable it ? From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 15 10:06:35 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A323916A4CE for ; Thu, 15 Apr 2004 10:06:35 -0700 (PDT) Received: from thunder.nws.noaa.gov (fs1-nhdw.nws.noaa.gov [140.90.90.97]) by mx1.FreeBSD.org (Postfix) with ESMTP id 220B643D55 for ; Thu, 15 Apr 2004 10:06:35 -0700 (PDT) (envelope-from ash.gokhale@noaa.gov) Received: from [192.168.0.66] (hel [140.90.90.7])ESMTP id RAA17305 for ; Thu, 15 Apr 2004 17:06:33 GMT Mime-Version: 1.0 (Apple Message framework v613) In-Reply-To: <407DD3FE.5010303@kientzle.com> References: <20040414215601.GA3923@crodrigues.org> <407DD3FE.5010303@kientzle.com> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <3DFA0E20-8EFF-11D8-AF6E-00039383C51E@noaa.gov> Content-Transfer-Encoding: 7bit From: Ash Gokhale Date: Thu, 15 Apr 2004 13:06:31 -0400 To: freebsd-hackers@freebsd.org X-Mailer: Apple Mail (2.613) X-Mailman-Approved-At: Fri, 16 Apr 2004 05:09:11 -0700 Subject: Re: C code for parsing rc.conf? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2004 17:06:35 -0000 I'll give you another 'easy' hack to contemplate. 6 == 12 * 0,5 Make your tool system('sh /etc/rc.conf'); And then use the native [get|set]env(3) functions to read/write the values you are intested in. When you are ready to commit the process scan **environ (7) to rebuild it without the redundant stuff (and without your uid env). I think it's much better to use the shells logic rather than parsing. There may be installations that require a little math or early reentrant shell programming to manage startup. What ever you do _pleese_ offer automatic failback to the previous rc.conf if the system comes up sour with the generated rc. Perhaps this should be hooks to rc itself. Has anyone used SystemStarter under FreeBSD? It can really haul a machine through the startup sequence by parallel execution of non critical startup binaries. I've seen it pull an otherwise sluggish darwin up in a big hurry. On Apr 14, 2004, at 8:14 PM, Tim Kientzle wrote: > Craig Rodrigues wrote: >> Is there a C library that comes with FreeBSD which >> can be used to parse, append to, and validate >> rc.conf? > > There was a detailed discussion of this topic about a year > ago. Here is how to obtain the current settings from rc.conf > from within a C program: > > * Clear the current environment > > * popen() a shell command that sources rc.conf, then > runs printenv > > * read and parse the output of printenv > > The basic idea is to just let the shell do > the work for you. > > Ash.Gokhale@noaa.gov System Administration Lead, NOAA/MDL From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 17 07:19:52 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1D3AD16A4CE for ; Sat, 17 Apr 2004 07:19:52 -0700 (PDT) Received: from asarian-host.net (mail.asarian-host.net [194.109.160.70]) by mx1.FreeBSD.org (Postfix) with ESMTP id 76F5343D5C for ; Sat, 17 Apr 2004 07:19:51 -0700 (PDT) SRS0=Qq1AmAcR=HN=asarian-host.net=admin@asarian-host.net) Comments: To protect the identity of the sender, certain header fields are either not shown, or masked. Anonymous email accounts can be requested by filling in the appropriate form at: https://asarian-host.net/cgi-bin/signup.cgi Received: (from root@localhost) by mail.asarian-host.net (8.12.11/8.12.11) id i3HEJoxw042786 for freebsd-hackers@freebsd.org; Sat, 17 Apr 2004 16:19:50 +0200 (CEST) (envelope-from admin@asarian-host.net) From: Mark Received-SPF: pass (asarian-host.net: domain of admin@asarian-host.net designates sender IP as SASL permitted sender) Message-Id: <200404171419.I3HEJNLH042774@asarian-host.net> Date: Sat, 17 Apr 2004 14:19:49 GMT X-Authenticated-Sender: admin@asarian-host.net X-Trace: 2SMYG6kafSdzRi4N/dOjVgZ+TeKpAy4kDvX7wQXIeu9YyOK3DjnSlTvEu4zTffRRc2u+X4jZBRS+aBjnLRdKuQ== X-Complaints-To: abuse@asarian-host.net X-Abuse-Info: Please be sure to forward a copy of ALL headers, otherwise we are unable to process your complaint Organization: Asarian-host To: MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 X-Auth: Asarian-host PGP signature iQEVAwUAQIE9BTFqW1BleBN9AQGfGQf/T5fXwegEk7/CZW4b/CcsKBr+F3EaKy3j frO8CimhRHxdRy3MY55jdzQLleHDB1SQ0EgMcUWIV2R73YyxjHN6hMBPRIh81mBq qC+jpdmvTD3JnIkKNaNu8S/kdDSocl3YmVPjtkW+yDOxLW6vny0bHQEKsuL87R3V V3eCb62wUgxQQMcsBfrbcLf5VtEdIpwfd5zeXljZpooquc0wd85v2pdbRj6b5LLL CTM6p0w7FD3bORe28V1H4fCKjIIk2ucKDffStTKNZkcx85sXXekIlI7JhpgkR32L 2Iut70Zkp83iUjr5DdofGHDjEM8N6niTiFfunXMzqGD5tyjQo2Rwaw== =3LCs Subject: Does FreeBSD 4.9R-p3 support the 3Com 3C940 LAN card? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2004 14:19:52 -0000 Hello, Does FreeBSD 4.9R-p3 support the 3Com 3C940 LAN card? The 3Com 3C940 does not appear on either the 5.x or 4.9 hardware list, but someone one the freebsd-questions list said I should try the sk(4) driver. Which I do not quite understand; as: device sk # SysKonnect SK-984x and SK-982x gigabit ethernet Seems to support a different kind of NIC. Can someone please clarify this for me? Thanks! - Mark From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 17 07:34:37 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7C90916A4CF for ; Sat, 17 Apr 2004 07:34:37 -0700 (PDT) Received: from asarian-host.net (mail.asarian-host.net [194.109.160.70]) by mx1.FreeBSD.org (Postfix) with ESMTP id D6A9443D1D for ; Sat, 17 Apr 2004 07:34:36 -0700 (PDT) SRS0=Qq1AmAcR=HN=asarian-host.net=admin@asarian-host.net) Comments: To protect the identity of the sender, certain header fields are either not shown, or masked. Anonymous email accounts can be requested by filling in the appropriate form at: https://asarian-host.net/cgi-bin/signup.cgi Received: (from root@localhost) by mail.asarian-host.net (8.12.11/8.12.11) id i3HEYZim043445 for freebsd-hackers@freebsd.org; Sat, 17 Apr 2004 16:34:35 +0200 (CEST) (envelope-from admin@asarian-host.net) From: Mark Received-SPF: pass (asarian-host.net: domain of admin@asarian-host.net designates sender IP as SASL permitted sender) Message-Id: <200404171434.I3HEYZ34043433@asarian-host.net> Date: Sat, 17 Apr 2004 14:34:35 GMT X-Authenticated-Sender: admin@asarian-host.net X-Trace: 71ZOGhn3YRlDmgWZr+hH8QT8VS0jb0QGprKUfFPuJ+BCCJNfyFROl+bBpy0O+Loo8T6cz83uvKMXyCubr0Sndw== X-Complaints-To: abuse@asarian-host.net X-Abuse-Info: Please be sure to forward a copy of ALL headers, otherwise we are unable to process your complaint Organization: Asarian-host To: References: <200404171419.I3HEJNLH042774@asarian-host.net> <1082212094.40813efed9089@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 X-Auth: Asarian-host PGP signature iQEVAwUAQIFAezFqW1BleBN9AQFaAQf8CcyqPeithdJGP8URIQP9Ytql94jncTut sxMKkL1MvSEq1oLpseyO036A9cKcUUJHO2fe1zLSmV+Dp7Ci1wEaJi5NqI6m3vB/ 2+BC67IiJUn+b8nDVrUM/0nqQFCg5dfSU6xsolYPHU63Ydnd/D14OcGWRJdqLTN2 jNf5JdwgO4qSwuP9um4fr2ZnhXMrdd4DmUmB/Oqsv/8Sk/OsUlDDJaLzTNEXKp4Z RMELehY5r16ooTD3d3kPKX8uoyVz0M5zHuH8w7pjixcJ6uPTVzCZ5S3pl/mKH4Zs nxvZjVLMOjDGvshf5E9SbfurDEj9iNt0OCsWMZ0Rf9lOp6UdVq/zOQ== =Oqpo Subject: Re: Does FreeBSD 4.9R-p3 support the 3Com 3C940 LAN card? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2004 14:34:37 -0000 kai@freshx.de wrote: > Hi Mark, > > as the man page states : > > The sk driver provides support for the SysKonnect SK-984x and > SK-982x series PCI gigabit ethernet adapters, including the > following: > > o 3COM 3C940 single port, 1000baseT adapter I guess I missed that part. Thanks, this solves it. :) - Mark