Re: IBM Thinkpad 755C and FreeBSD's minimal hardware requirements - still usable?

2009-10-19 Thread herbert langhans
Not a long time ago I got an old Thinkpad 600. With 300MHz and 165MB Ram.

Also the same challenge - small and fast ports for daily work. I run X11 with 
fluxbox (installed without! hal support). 

Recommendable ports are: Opera (smaller then Firefox) or even Elinks (there is 
a setting 'graphic mode'). Mutt for e-mails, vim (also gvim) is my text editor 
- it replaces word processing software. Centerim for instant messaging (instead 
of pidgin). Axyftp is a fast ftp-client, also for X11. Generally all the 
motif-programs are small and fast.

For a few bucks I got the PCMCIA-Card TP-Link TL-WN610G. It works perfect, but 
only without hal.

And my battery lasts easily over three hours, almost four with just a text 
editor running.

Maybe you go for a bigger harddisk? Costs a few bucks and will have enough 
space for BSD 7.2 (what I use) and some of the ports? Compiling your own kernel 
and cleaning out the kernel source and the distfiles of the ports is also a 
good idea..

Cheers
herb langhans
 
On Mon, Oct 19, 2009 at 06:47:27AM +0200, Polytropon wrote:
 Dear list,
 
 I'm about to try something strange. Recently, I got back my
 IBM Thinkpad 755C. It's from ca. 1995, has a 486 processor
 at 75 MHz, 20 MB RAM and a 640x480x256 display. The hard disk
 is 330 MB, but I have a 500 MB disk that I want to use. Use
 for what? FreeBSD, of course.
 
 Allthough this device is quite old, the battery lasts 3 hours.
 I'm not joking, I tried it.
 
 The laptop contains two PCCARD (PCMCIA) slots for expansions.
 A floppy disk drive is built in, as well as audio (builtin
 microphone and speaker, connectors for line in and headphones).
 On the back, there are connectors for VGA, serial (9 pin),
 and parallel, as well as for some kind of docking station.
 There's no USB and no CD drive.
 
 Here's my question:
 
 Is it, under any circumstances, possible to run FreeBSD on this
 configuration in order to have a portable and lightweight (in
 regards of software) diagnostic computer?
 
 I thought about putting in a PCCARD based NIC (I have a Realtek
 one that works well with FreeBSD), as well as a WLAN card.
 
 On the software side I would think about CLI tools mostly, but
 it would be great to run X (even at this limited screen, but
 there's always the option of using a bigger virtual desktop).
 Programs should include a web browser, mail client, and finally
 a network traffic diagnostic tool, such as Wireshark (ex Ethereal).
 
 I had FreeBSD 4 running on this device from floppy for testing
 purposes, so I know I have to pay attention to the fact that
 the keyboard needs to be flagged as XT (not AT) - very stange.
 I had FreeBSD 4 running on a 486/60 Toshiba T2130ct with 8 MB
 RAM in the past, but I'm using this one now for programming
 Motorola mobile radios. It's builtin trackpoint is not working
 anymore, but the Thinkpad's is in perfect condition, so I have
 a good pointing device. Furthermore, the Thinkpad's keyboard
 is excellent, compared to the Toshiba and to modern notebooks
 with their floppy-sloppy keys.
 
 Is this imaginable at all?
 
 Any ideas, comments or suggestions are appreciated.
 
 
 PS. Of course I would buy one of those modern Netbooks to
 have the same effect, but why buy when the stuff I have
 arund anywill will work, too? I know, I'm just plain mean,
 and I diskike the Netbook's nearly unusable keyboards as
 well as the absence of a proper pointing device (the ugly
 slimy fingerprint-glidepad is no solution).
 
 
 
 -- 
 Polytropon
 Magdeburg, Germany
 Happy FreeBSD user since 4.0
 Andra moi ennepe, Mousa, ...
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org

-- 
sprachtraining langhans
herbert langhans, warschau
http://www.langhans.com.pl
herbert dot raimund at gmx dot net
+0048 603 341 441

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


ZFS: Strange performance issues

2009-10-19 Thread Christopher Key
Hello,

I'm running FreeBSD 7.2 amd64 on a system with 2GB RAM.  I've a zfs pool
using raidz1 over five 2Tb SATA drives connected via a port multiplier
and a RR2314 card.

I can write to a filesystem on this pool at approx 20MB/s:

# dd if=/dev/urandom of=$FS/testdump bs=1m count=1k
1024+0 records in
1024+0 records out
1073741824 bytes transferred in 47.096440 secs (22798790 bytes/sec)

and zpool iostat -v is consistent with this

   capacity operationsbandwidth
pool used  avail   read  write   read  write
--  -  -  -  -  -  -
films   6.37T  2.69T 11440  53.2K  23.0M
  raidz16.37T  2.69T 11440  53.2K  23.0M
da0 -  -  1214  88.2K  5.58M
da1 -  -  1209  88.6K  5.58M
da2 -  -  1211  76.0K  5.70M
da3 -  -  1213  88.6K  5.77M
da4 -  -  1213  88.6K  5.71M
--  -  -  -  -  -  -


However, the read behaviour is strange:

dd if=$FS/testdump of=/dev/null bs=1m count=1k

1024+0 records in
1024+0 records out
1073741824 bytes transferred in 40.392055 secs (26582996 bytes/sec)

but here, zpool iostat -v is odd:

   capacity operationsbandwidth
pool used  avail   read  write   read  write
--  -  -  -  -  -  -
films   6.37T  2.69T  1.52K  0   194M  0
  raidz16.37T  2.69T  1.52K  0   194M  0
da0 -  -420  0  48.2M  0
da1 -  -274  0  24.0M  0
da2 -  -270  0  24.4M  0
da3 -  -418  0  48.4M  0
da4 -  -418  0  48.4M  0
--  -  -  -  -  -  -

Notice that dd was reading at ~27MB/s, but zfs is reading from the vdev
at ~200MB/s.  Also odd is that fact the reduced read rates for da1, da2.


I'm struggling to understand what's happening to the extra data being
read.  The most likely scenario seems to be that ZFS is inflating its
read size, knowing that it won't delay the transfer significantly, and
hoping to pull in some useful data to the cache.  However, it's either
failing the cache this data correctly, or the file is highly
non-contiguous, and the extra data read doesn't contain anythign useful
to out read.

I'm also somewhat surpised by the poor performance of the pool.  From
memory, when it was first configured (on identical hardware and
software), I could write at ~130MB/s and read at ~200MB/s.

Once conclusion is that the pool is suffering from something akin to
fragmentation, perhaps with files always being allocated from very small
blacks.  The vast majority of the data comprises large (~1Gb) files,
that are written to one 'import' pool, moved to the main pool, then
never modified.  There are however a lot (~5000) of small (1k) files
that get rewritten half hourly, and I'm wondering if that might be
causing problems, and confusing ZFS's block sizing algorithm.

Can anyone shed any light on what might be going on, or how to further
diagnose this problem.  Do any of my tentative conclusions make any sense?


Kind regards,

Christopher Key

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


USB modem support on a FreeBSD box

2009-10-19 Thread Henry Olyer
I know about all the drivers being for windoz.  And how we're pretty much
left out in the cold.  Does any solution exist?  For example, if I access my
USB modem via the Wine emulator, will that work?
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


glabel clarification

2009-10-19 Thread PJ
I understood that labeling a disk with glabel would permit the disk to
be switched to another system and booting from that disk would not
require other manupulations than adjusting network configuration, samba,
rc.conf and a few others..
But what if there is already a disk on the system with the identical
labels in /dev/label/ ?
I understood that whatever the actual disk might be (ad4, ad12,
ad1...)would be irrelevant?
It would appear that the actual booting goes according to the label; so,
if there are duplicate labels the boot will not necessarily be from the
newly installed disk if there is another disk with duplicate glabel labels?
So doing a glabel seems superfluous...
What then is the real purpose of glabel, since the boot process seems to
need a unique identifier?

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: need C help, passing char buffer[] by-value....

2009-10-19 Thread David Kelly
On Mon, Oct 19, 2009 at 05:43:44AM +0200, Polytropon wrote:
 On Sun, 18 Oct 2009 22:23:43 -0500, David Kelly dke...@hiwaay.net wrote:
  When not using a count to indicate how much data is in a char* you  
  should always test for null. Testing for null is not a sure fire way  
  to prevent buffer over runs but its better than nothing.
 
 There are means like
 
   #include assert.h
   ...
   assert(s);
 
 to make sure s is not NULL, or testing for it explicitely like
 
   if(!s)
   ... error handling here ...

You are missing my point that *s == 0 is not a good out of bounds range
check.

 is possible. Furthermore, it is a proven way to give a length
 argument along with the (char *) argument, such as the new
 l-functions for strings, e. g. strlcat() and strlcpy(), do.
 
   char *skiptags(char *s, int l);
 
 You can even double-check for l begin != 0. Or you employ a
 test with strlen() function-internally.

strlen() knows nothing about the buffer allocation. As I originally
said, testing for null (and my example tested) is not foolproof but its
better than nothing. One should *also* test for the known end of the
allocated buffer.

-- 
David Kelly N4HHE, dke...@hiwaay.net

Whom computers would destroy, they must first drive mad.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


RE: glabel clarification

2009-10-19 Thread Johan Hendriks

I understood that labeling a disk with glabel would permit the disk to
be switched to another system and booting from that disk would not
require other manupulations than adjusting network configuration,
samba,
rc.conf and a few others..
But what if there is already a disk on the system with the identical
labels in /dev/label/ ?
I understood that whatever the actual disk might be (ad4, ad12,
ad1...)would be irrelevant?
It would appear that the actual booting goes according to the label;
so,
if there are duplicate labels the boot will not necessarily be from the
newly installed disk if there is another disk with duplicate glabel
labels?
So doing a glabel seems superfluous...
What then is the real purpose of glabel, since the boot process seems
to
need a unique identifier?

Switching between machines is not what labels are for.(enlighten me if
it is)
As far as understand, it makes switching the drive in the same machine
easier.
It does not matter if labels are used, that the device is seen as
/dev/ad0 or /dev/ad{x}.
This makes adding and replacing disk much easier.
Sometimes the disk numbers change when removing raid controllers or
other hardware.

Regards,
Johan
 

No virus found in this outgoing message.
Checked by AVG - www.avg.com 
Version: 8.5.422 / Virus Database: 270.14.20/2444 - Release Date:
10/18/09 09:04:00
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: need C help, passing char buffer[] by-value....

2009-10-19 Thread David Kelly
On Sun, Oct 18, 2009 at 11:30:49PM -0400, Robert Huff wrote:
 
 Glen Barber writes:
   
   // comments are recognized by both C and C++.
 
   How about ... are recognized by both C++ and more recent versions
 of C.?

I think gcc++ and gcc use the same preprocessor? Comments are stripped
in the preprocessor.

The only thing we can really say is that gcc accepts // as a comment. Is
becoming an accepted convention in other C's but I doubt one can
universally state that its accepted in all recent versions.

-- 
David Kelly N4HHE, dke...@hiwaay.net

Whom computers would destroy, they must first drive mad.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: glabel clarification

2009-10-19 Thread PJ
Johan Hendriks wrote:
 I understood that labeling a disk with glabel would permit the disk to
 be switched to another system and booting from that disk would not
 require other manupulations than adjusting network configuration,
 
 samba,
   
 rc.conf and a few others..
 But what if there is already a disk on the system with the identical
 labels in /dev/label/ ?
 I understood that whatever the actual disk might be (ad4, ad12,
 ad1...)would be irrelevant?
 It would appear that the actual booting goes according to the label;
 
 so,
   
 if there are duplicate labels the boot will not necessarily be from the
 newly installed disk if there is another disk with duplicate glabel
 
 labels?
   
 So doing a glabel seems superfluous...
 What then is the real purpose of glabel, since the boot process seems
 
 to
   
 need a unique identifier?
 

 Switching between machines is not what labels are for.(enlighten me if
 it is)
 As far as understand, it makes switching the drive in the same machine
 easier.
 It does not matter if labels are used, that the device is seen as
 /dev/ad0 or /dev/ad{x}.
 This makes adding and replacing disk much easier.
 Sometimes the disk numbers change when removing raid controllers or
 other hardware.
   
Here are my specifics:
I just cloned disk - ad6 from ad12...
I assume that the two are identical except for their bios assignments -
that is ad6 and ad12. Other than that they are quite identical, or 
should be.
ad12 was just glabeled, so I would assume that the clone would have all
the identical information - anyway, it looks like it does.
To test things, I booted from ad12 and then from ad6 but the boot is
always from ad12 - this is evidenced from changing the motd on ad6s1a...
the fstab on both ad4 and ad12 are identical... and dmesg shows the boot
device... so, where have I erred?

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: need C help, passing char buffer[] by-value....

2009-10-19 Thread Erik Trulsson
On Mon, Oct 19, 2009 at 09:03:22AM -0500, David Kelly wrote:
 On Sun, Oct 18, 2009 at 11:30:49PM -0400, Robert Huff wrote:
  
  Glen Barber writes:

// comments are recognized by both C and C++.
  
  How about ... are recognized by both C++ and more recent versions
  of C.?
 
 I think gcc++ and gcc use the same preprocessor? Comments are stripped
 in the preprocessor.
 
 The only thing we can really say is that gcc accepts // as a comment. Is
 becoming an accepted convention in other C's but I doubt one can
 universally state that its accepted in all recent versions.

It is accepted in recent versions of C, but not necessarily by all C
compilers, depending on which version of C they support.  // comments were
added to C in the 1999 revision of the C standard, and was already then a
very common extension that was supported by many compilers.

If gcc supports // comments or not depends on which mode it is running in.
If you run it in strict C89 mode, then it will not support // comments,
but if you run it in C99 mode (or as a C++ compiler), it will support them.



-- 
Insert your favourite quote here.
Erik Trulsson
ertr1...@student.uu.se
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: glabel clarification

2009-10-19 Thread PJ
Johan Hendriks wrote:
 I understood that labeling a disk with glabel would permit the disk to
 be switched to another system and booting from that disk would not
 require other manupulations than adjusting network configuration,
 
 samba,
   
 rc.conf and a few others..
 But what if there is already a disk on the system with the identical
 labels in /dev/label/ ?
 I understood that whatever the actual disk might be (ad4, ad12,
 ad1...)would be irrelevant?
 It would appear that the actual booting goes according to the label;
 
 so,
   
 if there are duplicate labels the boot will not necessarily be from the
 newly installed disk if there is another disk with duplicate glabel
 
 labels?
   
 So doing a glabel seems superfluous...
 What then is the real purpose of glabel, since the boot process seems
 
 to
   
 need a unique identifier?
 

 Switching between machines is not what labels are for.(enlighten me if
 it is)
 As far as understand, it makes switching the drive in the same machine
 easier.
 It does not matter if labels are used, that the device is seen as
 /dev/ad0 or /dev/ad{x}.
 This makes adding and replacing disk much easier.
 Sometimes the disk numbers change when removing raid controllers or
 other hardware.
   
Yes, this is true and that is why I thought that glabel would work; I am
trying to set up my computers with identical clones that I can update
with changes on the master machine from time to time and thus prevent
data loss in case of problems. So I use ad12 as the main system; if it
were to crash I would then boot from ad6 which is identical. But the
/etc/fstab is identical in both machines. So if I boot from ad6, I will
get booted from ad12 ... so that doesn't work. It looks like we need an
unique identifier for each disk.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: glabel clarification

2009-10-19 Thread Adam Vande More
On Mon, Oct 19, 2009 at 9:26 AM, PJ af.gour...@videotron.ca wrote:

 Yes, this is true and that is why I thought that glabel would work; I am
 trying to set up my computers with identical clones that I can update
 with changes on the master machine from time to time and thus prevent
 data loss in case of problems. So I use ad12 as the main system; if it
 were to crash I would then boot from ad6 which is identical. But the
 /etc/fstab is identical in both machines. So if I boot from ad6, I will
 get booted from ad12 ... so that doesn't work. It looks like we need an
 unique identifier for each disk.


Why not use gmirror?


-- 
Adam Vande More
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: glabel clarification

2009-10-19 Thread PJ
Adam Vande More wrote:
 On Mon, Oct 19, 2009 at 9:26 AM, PJ af.gour...@videotron.ca
 mailto:af.gour...@videotron.ca wrote:

 Yes, this is true and that is why I thought that glabel would
 work; I am
 trying to set up my computers with identical clones that I can update
 with changes on the master machine from time to time and thus prevent
 data loss in case of problems. So I use ad12 as the main system; if it
 were to crash I would then boot from ad6 which is identical. But the
 /etc/fstab is identical in both machines. So if I boot from ad6, I
 will
 get booted from ad12 ... so that doesn't work. It looks like we
 need an
 unique identifier for each disk.


 Why not use gmirror?


 -- 
 Adam Vande More
I've been having such headaches with glabel, I didn't want to get a
migraine. ;-)
Actually, I don't know gmirror but will look it up and see whatit can do
for me.
Thanks.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: glabel clarification

2009-10-19 Thread PJ
Adam Vande More wrote:
 On Mon, Oct 19, 2009 at 9:26 AM, PJ af.gour...@videotron.ca
 mailto:af.gour...@videotron.ca wrote:

 Yes, this is true and that is why I thought that glabel would
 work; I am
 trying to set up my computers with identical clones that I can update
 with changes on the master machine from time to time and thus prevent
 data loss in case of problems. So I use ad12 as the main system; if it
 were to crash I would then boot from ad6 which is identical. But the
 /etc/fstab is identical in both machines. So if I boot from ad6, I
 will
 get booted from ad12 ... so that doesn't work. It looks like we
 need an
 unique identifier for each disk.


 Why not use gmirror?


 -- 
 Adam Vande More
because I am not using RAID. :-(
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: glabel clarification

2009-10-19 Thread Adam Vande More
On Mon, Oct 19, 2009 at 9:35 AM, PJ af.gour...@videotron.ca wrote:

 Adam Vande More wrote:
  On Mon, Oct 19, 2009 at 9:26 AM, PJ af.gour...@videotron.ca
  mailto:af.gour...@videotron.ca wrote:
 
  Yes, this is true and that is why I thought that glabel would
  work; I am
  trying to set up my computers with identical clones that I can update
  with changes on the master machine from time to time and thus prevent
  data loss in case of problems. So I use ad12 as the main system; if
 it
  were to crash I would then boot from ad6 which is identical. But the
  /etc/fstab is identical in both machines. So if I boot from ad6, I
  will
  get booted from ad12 ... so that doesn't work. It looks like we
  need an
  unique identifier for each disk.
 
 
  Why not use gmirror?
 
 
  --
  Adam Vande More
 because I am not using RAID. :-(


gmirror + ggated = disk or slice replicated to remote system

-- 
Adam Vande More
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: glabel clarification

2009-10-19 Thread Adam Vande More
On Mon, Oct 19, 2009 at 9:37 AM, Adam Vande More amvandem...@gmail.comwrote:

 On Mon, Oct 19, 2009 at 9:35 AM, PJ af.gour...@videotron.ca wrote:

 Adam Vande More wrote:
  On Mon, Oct 19, 2009 at 9:26 AM, PJ af.gour...@videotron.ca
  mailto:af.gour...@videotron.ca wrote:
 
  Yes, this is true and that is why I thought that glabel would
  work; I am
  trying to set up my computers with identical clones that I can
 update
  with changes on the master machine from time to time and thus
 prevent
  data loss in case of problems. So I use ad12 as the main system; if
 it
  were to crash I would then boot from ad6 which is identical. But the
  /etc/fstab is identical in both machines. So if I boot from ad6, I
  will
  get booted from ad12 ... so that doesn't work. It looks like we
  need an
  unique identifier for each disk.
 
 
  Why not use gmirror?
 
 
  --
  Adam Vande More
 because I am not using RAID. :-(


 gmirror + ggated = disk or slice replicated to remote system


 gmirror + ggated = disk or partition replicated to remote system


-- 
Adam Vande More
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: glabel clarification

2009-10-19 Thread PJ
Adam Vande More wrote:
 On Mon, Oct 19, 2009 at 9:35 AM, PJ af.gour...@videotron.ca
 mailto:af.gour...@videotron.ca wrote:

 Adam Vande More wrote:
  On Mon, Oct 19, 2009 at 9:26 AM, PJ af.gour...@videotron.ca
 mailto:af.gour...@videotron.ca
  mailto:af.gour...@videotron.ca
 mailto:af.gour...@videotron.ca wrote:
 
  Yes, this is true and that is why I thought that glabel would
  work; I am
  trying to set up my computers with identical clones that I
 can update
  with changes on the master machine from time to time and
 thus prevent
  data loss in case of problems. So I use ad12 as the main
 system; if it
  were to crash I would then boot from ad6 which is identical.
 But the
  /etc/fstab is identical in both machines. So if I boot from
 ad6, I
  will
  get booted from ad12 ... so that doesn't work. It looks like we
  need an
  unique identifier for each disk.
 
 
  Why not use gmirror?
 
 
  --
  Adam Vande More
 because I am not using RAID. :-(


 gmirror + ggated = disk or slice replicated to remote system

 -- 
 Adam Vande More
You ae trying to give me a migraine. :-)
But what happens if the disks are not identical in size? Dump/restore
allows for that; dump/restore will copy only the used date and not the
entire partition or slice.
 
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: glabel clarification

2009-10-19 Thread Adam Vande More
On Mon, Oct 19, 2009 at 9:46 AM, PJ af.gour...@videotron.ca wrote:

 Adam Vande More wrote:
  On Mon, Oct 19, 2009 at 9:35 AM, PJ af.gour...@videotron.ca
  mailto:af.gour...@videotron.ca wrote:
 
  Adam Vande More wrote:
   On Mon, Oct 19, 2009 at 9:26 AM, PJ af.gour...@videotron.ca
  mailto:af.gour...@videotron.ca
   mailto:af.gour...@videotron.ca
  mailto:af.gour...@videotron.ca wrote:
  
   Yes, this is true and that is why I thought that glabel would
   work; I am
   trying to set up my computers with identical clones that I
  can update
   with changes on the master machine from time to time and
  thus prevent
   data loss in case of problems. So I use ad12 as the main
  system; if it
   were to crash I would then boot from ad6 which is identical.
  But the
   /etc/fstab is identical in both machines. So if I boot from
  ad6, I
   will
   get booted from ad12 ... so that doesn't work. It looks like we
   need an
   unique identifier for each disk.
  
  
   Why not use gmirror?
  
  
   --
   Adam Vande More
  because I am not using RAID. :-(
 
 
  gmirror + ggated = disk or slice replicated to remote system
 
  --
  Adam Vande More
 You ae trying to give me a migraine. :-)
 But what happens if the disks are not identical in size? Dump/restore
 allows for that; dump/restore will copy only the used date and not the
 entire partition or slice.


It depends on what your end goals is which is still not entirely clear.  Do
you want a disk that can be unplugged from a machine and used to boot
immediately in your orginal system in case of hd failure.  If yes then
gmirror + ggated is the way to go.  If you simply want data to be backed up
on regular basis, something like rsync is easier.


-- 
Adam Vande More
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: need C help, passing char buffer[] by-value....

2009-10-19 Thread Gary Kline
On Mon, Oct 19, 2009 at 04:19:11PM +0200, Erik Trulsson wrote:
 On Mon, Oct 19, 2009 at 09:03:22AM -0500, David Kelly wrote:
  On Sun, Oct 18, 2009 at 11:30:49PM -0400, Robert Huff wrote:
   
   Glen Barber writes:
 
 // comments are recognized by both C and C++.
   
 How about ... are recognized by both C++ and more recent versions
   of C.?
  
  I think gcc++ and gcc use the same preprocessor? Comments are stripped
  in the preprocessor.
  
  The only thing we can really say is that gcc accepts // as a comment. Is
  becoming an accepted convention in other C's but I doubt one can
  universally state that its accepted in all recent versions.
 
 It is accepted in recent versions of C, but not necessarily by all C
 compilers, depending on which version of C they support.  // comments were
 added to C in the 1999 revision of the C standard, and was already then a
 very common extension that was supported by many compilers.
 
 If gcc supports // comments or not depends on which mode it is running in.
 If you run it in strict C89 mode, then it will not support // comments,
 but if you run it in C99 mode (or as a C++ compiler), it will support them.
 

This is my FWIW, but I use the std /* and */ in C programs and
often in C++ also.  It's only when I'm [1] lazy, or [2] have severe 
shoulder 
pains that I'll use the // for comments -- anywhere.  

This is a bit quirky, but even in my prose I'll use #ifdef/#endif and 
the
std C comments.  Very handy for sidebar comments, thoughts, 
work-arounds or
write-around in early drafts.

just my $0.02-worth,

gary


 
 
 -- 
 Insert your favourite quote here.
 Erik Trulsson
 ertr1...@student.uu.se
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org

-- 
 Gary Kline  kl...@thought.org  http://www.thought.org  Public Service Unix
http://jottings.thought.org   http://transfinite.thought.org
The 7.31a release of Jottings: http://jottings.thought.org/index.php

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: glabel clarification

2009-10-19 Thread Adam Vande More
On Mon, Oct 19, 2009 at 10:58 AM, PJ af.gour...@videotron.ca wrote:

 Actually, I have been trying to clone a disk and then install the disk
 in another machine or same clone in several machines. That's why I
 thought that once the clone is make it would boot on any machine. This
 in presuming that each clone is identical including the fstab file; I
 understood that this would allow immediate bootup regardless of what the
 disk may be ad4, ad1, ad12 or whatever. This would permit changing the
 necessary configurations of samba, network, etc. Now I see that it
 doesn't work that way. I can still clone the disk but then just have to
 find what disk is the clone.


Are all the systems identical?  If so, make sure cabling is identical as
well then gmirror clone would work as well.

Also my understanding of glabel is different than mentioned above.  As long
as fstab mounts the glabel location eg /dev/ufs/label it should be
portable across systems since that info is stored as meta data on the drive.

What does your fstab look like?

-- 
Adam Vande More
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: glabel clarification

2009-10-19 Thread PJ
Adam Vande More wrote:
 On Mon, Oct 19, 2009 at 9:46 AM, PJ af.gour...@videotron.ca
 mailto:af.gour...@videotron.ca wrote:

 Adam Vande More wrote:
  On Mon, Oct 19, 2009 at 9:35 AM, PJ af.gour...@videotron.ca
 mailto:af.gour...@videotron.ca
  mailto:af.gour...@videotron.ca
 mailto:af.gour...@videotron.ca wrote:
 
  Adam Vande More wrote:
   On Mon, Oct 19, 2009 at 9:26 AM, PJ
 af.gour...@videotron.ca mailto:af.gour...@videotron.ca
  mailto:af.gour...@videotron.ca
 mailto:af.gour...@videotron.ca
   mailto:af.gour...@videotron.ca
 mailto:af.gour...@videotron.ca
  mailto:af.gour...@videotron.ca
 mailto:af.gour...@videotron.ca wrote:
  
   Yes, this is true and that is why I thought that
 glabel would
   work; I am
   trying to set up my computers with identical clones that I
  can update
   with changes on the master machine from time to time and
  thus prevent
   data loss in case of problems. So I use ad12 as the main
  system; if it
   were to crash I would then boot from ad6 which is
 identical.
  But the
   /etc/fstab is identical in both machines. So if I boot
 from
  ad6, I
   will
   get booted from ad12 ... so that doesn't work. It
 looks like we
   need an
   unique identifier for each disk.
  
  
   Why not use gmirror?
  
  
   --
   Adam Vande More
  because I am not using RAID. :-(
 
 
  gmirror + ggated = disk or slice replicated to remote system
 
  --
  Adam Vande More
 You ae trying to give me a migraine. :-)
 But what happens if the disks are not identical in size? Dump/restore
 allows for that; dump/restore will copy only the used date and not the
 entire partition or slice.


 It depends on what your end goals is which is still not entirely
 clear.  Do you want a disk that can be unplugged from a machine and
 used to boot immediately in your orginal system in case of hd
 failure.  If yes then gmirror + ggated is the way to go.  If you
 simply want data to be backed up on regular basis, something like
 rsync is easier.


 -- 
 Adam Vande More
Actually, I have been trying to clone a disk and then install the disk
in another machine or same clone in several machines. That's why I
thought that once the clone is make it would boot on any machine. This
in presuming that each clone is identical including the fstab file; I
understood that this would allow immediate bootup regardless of what the
disk may be ad4, ad1, ad12 or whatever. This would permit changing the
necessary configurations of samba, network, etc. Now I see that it
doesn't work that way. I can still clone the disk but then just have to
find what disk is the clone.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: usb key problem

2009-10-19 Thread Christopher Sean Hilton
On Thu, Oct 15, 2009 at 08:06:08PM -0400, PJ wrote:
 Polytropon wrote:
  On Thu, 15 Oct 2009 18:19:16 -0400, PJ af.gour...@videotron.ca wrote:


[snip...]

 
 Anyway, I found the solution on the web... couldn't belive it was that
 simple: just ignore the crap spewed out on the screen and just mount iit
 as you would any other disk.
 # mount  -t msdosfs /dev/da0s1 /mnt
 and that's it
 I don't know if it makes any difference, but I did delete everything on
 the key and formatted with Fat32. That got rid of everything and only
 took up 4k instead of 32 when not formatted and I could put my own label
 on the disk.
 Yea!
 Now to see how I can use it to restore stuff. :-D

The SanDisk keys include two devices, a umass disk device and and usb
psuedo CD-ROM drive. The CD-ROM drive only works properly in windows. It
doesn't work in FreeBSD and throws errors at key-insertion time.

Downthread a poster suggested putting a FreeBSD filesystem on this drive:

 # newfs /dev/da0
 # mount /dev/da0 /mnt

The advantage to this is that you get full FreeBSD filesystem sematics
from the drive. The disadvantage is that you have to make sure to
umount it before unplugging it in. If you don't umount it you will be
asked to fsck it on next insert. I don't find the disadvantage that
heinous so I keep a few sticks around with UFS filesystems on them. If
you choose to use UFS here's two things that are really helpful: 

Use a label so your drive doesn't appear in different places. When you
make your filesystem ensure that you put a unique (to you) label on
it:

 # newfs -L my_usb_stick /dev/da0
 # mount /dev/ufs/my_usb_stick /mnt

Use amd to mount the stick rather than doing it manually. Amd is
designed to automatically mount and dismount transient filesystems. It
was originally built with NFS filesystems involved but it adapts well
to UFS filesystems on transient devices with a workaround. I use the
following configuration spread through three files:

 $ cat /etc/amd/amd.conf
 [ global ]
 search_path = /etc/amd
 auto_dir = /.amd
 cache_duration = 30
 ## log_file = syslog:daemon
 ## log_options = fatal,error
 print_pid = yes
 pid_file = /var/run/amd.pid
 restart_mounts = yes

 [ /media ]
 map_name = /etc/amd/media.map


 $ cat /etc/amd/media.map 
 ## --
 ## Create a map that will allow mounts of appropriately labeled
 ## UFS filesystems.  We have to use the 'program' mount type
 ## because amd predates hot-pluggable removable storage. Thus amd
 ## will never timeout a volume that it knows is UFS.

 /default   type:=program

 *  rfs:=/dev/ufs/${key};fs:=${autodir}/${key};\
mount:=/sbin/mount mount -o nodev,noexec ${rfs} ${fs};\
unmount:=/sbin/umount umount ${rfs}

 $ grep ^amd /etc/rc.conf
 amd_enable=YES# Run amd service with $amd_flags (or NO).
 amd_flags=-F /etc/amd/amd.conf 

Those three config snippets pretty much do it for me. The first sets
some parameters on how amd runs. The second tells amd how to manage
the /media directory which is where you usb stick(s) will show up. It
also has the workaround. As noted above amd knows about UFS mounts but
for some reason it never times them out. Using the 'program'
filesystem gets around that. The third is the portion of /etc/rc.conf
that automatically starts amd using the config above. I created a
directory in /etc: /etc/amd to manage everything in one place. The
mount is done without exec and without devices for security
reasons. 

The technique works for any transient filesystem. USB, Firewire,
eSata. With this configuration users can force a mount an attached the
above filesystem, my_usb_stick, by doing the following:

 $ ls -l /media/my_usb_stick

Note well that you can do this as a normal user. The filesystem will
be automatically unmounted in 30 seconds. If you want to unmount the
filesystem forcefully you can do:

 $ amq -u /media/my_usb_stick

Again note that you don't have to transistion to root to do the
unmount. 

This works well for me. Your mileage may vary.

-- Chris

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Building Ghostscript from source on FreeBSD

2009-10-19 Thread Brent Bloxam
I'm having trouble building Ghostscript 8.70 from source on FreeBSD 7.0. 
I cannot use the version in the ports tree for various reasons. I've 
looked at the .mak patches in ./files/ for the ports tree however to try 
to suss out any differences but they elude me.


My configure line:
./configure --prefix=/usr/local/imagemagick-6.5.6 --disable-cups 
--disable-gtk --disable-cairo --disable-fontconfig --without-libpaper 
--without-pdftoraster --without-ijs --without-jbig2dec --without-jasper 
--without-omni --without-x --with-drivers=BMP,FAX,JPEG,PNG,PS,TIFF


The error I receive building:

gcc -Wall -Wstrict-prototypes -Wundef -Wmissing-declarations 
-Wmissing-prototypes -Wwrite-strings -Wno-strict-aliasing 
-Wdeclaration-after-statement -fno-builtin -fno-common -DHAVE_STDINT_H 
-DGX_COLOR_INDEX_TYPE=unsigned long long -I./base -o ./obj/genconf 
./base/genconf.c

gcc: ./base/genconf.c: No such file or directory
gcc: No input files specified

./base/genconf.c exists. Executing the gcc command on its own is 
successful, yet the build can't continue even with ./obj/genconf 
existing. `make -d A` reaches the failure with:


Examining ./base/stdpn.h...modified 18:23:38 Jun 05, 2007...up-to-date.
Examining ./obj/genconf...non-existent...modified before source 
(/home/build/ghostscript-8.70/./base/genconf.c)...out-of-date.

./obj/genconf: = /home/build/ghostscript-8.70/./base/genconf.c
./obj/genconf:? = /home/build/ghostscript-8.70/./base/genconf.c
./obj/genconf: = /home/build/ghostscript-8.70/./base/genconf.c 
/home/build/ghostscript-8.70/./base/stdpre.h
./obj/genconf:? = /home/build/ghostscript-8.70/./base/genconf.c 
/home/build/ghostscript-8.70/./base/stdpre.h
./obj/genconf: = /home/build/ghostscript-8.70/./base/genconf.c 
/home/build/ghostscript-8.70/./base/stdpre.h 
/home/build/ghostscript-8.70/./base/stdpn.h
./obj/genconf:? = /home/build/ghostscript-8.70/./base/genconf.c 
/home/build/ghostscript-8.70/./base/stdpre.h 
/home/build/ghostscript-8.70/./base/stdpn.h
cc -Wall -Wstrict-prototypes -Wundef -Wmissing-declarations 
-Wmissing-prototypes -Wwrite-strings -Wno-strict-aliasing 
-Wdeclaration-after-statement -fno-builtin -fno-common -DHAVE_STDINT_H 
-DGX_COLOR_INDEX_TYPE=unsigned long long -I./base -o ./obj/genconf 
./base/genconf.c

cc: ./base/genconf.c: No such file or directory
cc: No input files specified

Why is it that it believes ./obj/genconf is nonexistent, and then 
proceeds to fail while it has no problems with anything else up to that 
point?

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: need C help, passing char buffer[] by-value....

2009-10-19 Thread Gary Kline
On Mon, Oct 19, 2009 at 01:48:42AM -0400, Brad Mettee wrote:
 Gary Kline wrote:
 Guys,
 
 maybe this can't be done reading in a file with fgets(buffer[128], fp),
 then calling skiptags(), conditionally, to while () past ',' and ''.
 
 I know I need to calll skipTags with its address, skipTags(buffer);, but 
 then how to i
 handle the variable s in skipTags?  Anybody?
 
 
 
 
 // redo, skip TAGS
 skipTags((char *)s)
 {
 if (*s == '')
 {
 while (*s != '')
 {
 s++;
 }
 s++;
 }
 }
   
 Your function may not work exactly as you think it will. Your basic idea 
 runs on the assumption that the tag will never be broken during the file 
 read. It's possible that you'll read some dataTag begin and the next 
 read will have more data heretag ends, or some variation thereof. 
 If you know for a fact that the string you read in will always be 
 complete, then what's below should work fine:
 
 // where *s is the address of a string to be parsed
 // maxlen represents the maximum number of chars potentially in the string 
 and is not zero based (ie: maxlen 256 = char positions 0-255)
 // *curpos is the current position of the pointer (this prevents bounds 
 errors)
 skipTags(char *s, long maxlen, long *curpos)
 {
if (*s == '')
{
while (*s != ''   *s  *curpos  maxlen)
{
s++;
   (*curpos)++;
}
   if (*curpos  maxlen)
   {
   s++;
   (*curpos)++;
   }
}
 }
 
 When you read in the next line of the file, reset curpos to zero, set 
 maxlen to number of bytes read. As you process each char after the 
 function is called, you'll need to increment curpos as well.
 
 Depending on the size of the files you are reading, you may be able to 
 read the entire file into memory at once and avoid any possible TAG 
 splitting.
 
 If you explain exactly what you're trying to accomplish, we may be able 
 to come up with an easier/cleaner solution.
 
 (warning: none of the above code is tested, but in concept it should 
 work ok)
 

It didn't core dump, but neither work.  Basically, I'm doing a read via 
fgets:

while(fgets(buf, sizeof buf, fp_in)) {

an HTML or other file with TAGS.  Optionally, say, given the switch 
-N,
the program would NOT progress any of the HTML tags; It would only 
touch other
stuff in the file.  Simply put, I have a fixed buffer, buf[1024], that 
I want to
change --i think by-reference-not certain-by calling 

skiptags(*buf); and skiptags() would read past the WHATEVER=7 
FOO=6 BAR=Times
and return the buffer to the place after fgets() where skiptags(buf) 
is called
missing all markup TAGS.

I'm better at by-refernce with ints that chars, so I don't know how far 
off I am
here.  That's why I;'m asking you guys.

gary



-- 
 Gary Kline  kl...@thought.org  http://www.thought.org  Public Service Unix
http://jottings.thought.org   http://transfinite.thought.org
The 7.31a release of Jottings: http://jottings.thought.org/index.php

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: glabel clarification

2009-10-19 Thread PJ
Adam Vande More wrote:
 On Mon, Oct 19, 2009 at 10:58 AM, PJ af.gour...@videotron.ca
 mailto:af.gour...@videotron.ca wrote:

 Actually, I have been trying to clone a disk and then install the disk
 in another machine or same clone in several machines. That's why I
 thought that once the clone is make it would boot on any machine. This
 in presuming that each clone is identical including the fstab file; I
 understood that this would allow immediate bootup regardless of
 what the
 disk may be ad4, ad1, ad12 or whatever. This would permit changing the
 necessary configurations of samba, network, etc. Now I see that it
 doesn't work that way. I can still clone the disk but then just
 have to
 find what disk is the clone.


 Are all the systems identical?� If so, make sure cabling is identical
 as well then gmirror clone would work as well.

 Also my understanding of glabel is different than mentioned above.� As
 long as fstab mounts the glabel location eg /dev/ufs/label it should
 be portable across systems since that info is stored as meta data on
 the drive.

 What does your fstab look like?
# DeviceMountpointFStypeOptionsDumpPass#
/dev/label/swapnoneswapsw00
/dev/label/rootfs/ufsrw11
/dev/label/backups/backupsufsrw22
/dev/label/home/homeufsrw22
/dev/label/tmp/tmpufsrw22
/dev/label/usr/usrufsrw22
/dev/label/var/varufsrw22
/dev/acd0/cdromcd9660ro,noauto00
linproc  /usr/compat/linux/proc linprocfs rw 0 0

this is ad12; ad6 is the same - I guess I hae to get rid of those labels
in ad6 but am not sure if I need to use glabel to remove them or if just
editing fstab will do it?
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


pf+time stamp

2009-10-19 Thread Dánielisz László
Hello,

Do you have any idea how to add and read time stamp of pf/pf.log?

Thank you!
Laci




___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: pf+time stamp

2009-10-19 Thread Matthew Seaman

Dánielisz László wrote:

Hello,

Do you have any idea how to add and read time stamp of pf/pf.log?

Thank you!
Laci


Do you mean /var/log/pflog ?  Which is the default location where a
record of logged packets ends up if you run pflogd(8).

That's actually a pcap (packet capture) file, and you can read it
using tcpdump:

  # tcpdump -r /var/log/pflog

Each packet is recorded with a high resolution timestamp that tcpdump
will display for you -- like this naughty chap suffering the consequences
of trying to brute-force my ssh daemon just before 1:00pm today:

12:52:44.891373 IP customer-201-134-103-165.uninet-ide.com.mx.2316  
happy-idiot-talk.infracaninophile.co.uk.ssh: . ack 2991958242 win 1460 
nop,nop,timestamp 2 9319378 1107347817,[|tcp]
12:52:45.516283 IP customer-201-134-103-165.uninet-ide.com.mx.2316  
happy-idiot-talk.infracaninophile.co.uk.ssh: F 0:0(0) ack 1 win 1460 
nop,nop,timestamp 209319535 1107347817
12:52:48.387822 IP customer-201-134-103-165.uninet-ide.com.mx.2316  
happy-idiot-talk.infracaninophile.co.uk.ssh: F 0:0(0) ack 1 win 1460 
nop,nop,timestamp 209320253 1107347817
12:52:54.131863 IP customer-201-134-103-165.uninet-ide.com.mx.2316  
happy-idiot-talk.infracaninophile.co.uk.ssh: F 0:0(0) ack 1 win 1460 
nop,nop,timestamp 209321689 1107347817
12:52:57.113810 IP customer-201-134-103-165.uninet-ide.com.mx.2316  
happy-idiot-talk.infracaninophile.co.uk.ssh: . ack 1 win 1460 nop,nop,timestamp 
209322434 1107347817,[|tcp]
12:53:05.620251 IP customer-201-134-103-165.uninet-ide.com.mx.2316  
happy-idiot-talk.infracaninophile.co.uk.ssh: F 0:0(0) ack 1 win 1460 
nop,nop,timestamp 209324561 1107347817
12:53:28.597524 IP customer-201-134-103-165.uninet-ide.com.mx.2316  
happy-idiot-talk.infracaninophile.co.uk.ssh: F 0:0(0) ack 1 win 1460 
nop,nop,timestamp 209330305 1107347817
12:54:14.550822 IP customer-201-134-103-165.uninet-ide.com.mx.2316  
happy-idiot-talk.infracaninophile.co.uk.ssh: F 0:0(0) ack 1 win 1460 
nop,nop,timestamp 209341793 1107347817
12:55:46.457353 IP customer-201-134-103-165.uninet-ide.com.mx.2316  
happy-idiot-talk.infracaninophile.co.uk.ssh: F 0:0(0) ack 1 win 1460 
nop,nop,timestamp 209364769 1107347817
13:00:15.032146 IP customer-201-134-103-165.uninet-ide.com.mx.2316  
happy-idiot-talk.infracaninophile.co.uk.ssh: R 1230911050:1230911050(0) win 1460

Cheers,

Matthew

--
Dr Matthew J Seaman MA, D.Phil.   7 Priory Courtyard
 Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
 Kent, CT11 9PW



signature.asc
Description: OpenPGP digital signature


Re: need C help, passing char buffer[] by-value....

2009-10-19 Thread Patrick Mahan

See comments interspaced below -

Gary Kline wrote:

On Mon, Oct 19, 2009 at 01:48:42AM -0400, Brad Mettee wrote:

Gary Kline wrote:

Guys,

maybe this can't be done reading in a file with fgets(buffer[128], fp),
then calling skiptags(), conditionally, to while () past ',' and ''.


[snipped]


It didn't core dump, but neither work.  Basically, I'm doing a read via 
fgets:

while(fgets(buf, sizeof buf, fp_in)) {

an HTML or other file with TAGS.  Optionally, say, given the switch 
-N,
the program would NOT progress any of the HTML tags; It would only 
touch other
stuff in the file.  Simply put, I have a fixed buffer, buf[1024], that 
I want to
	change --i think by-reference-not certain-by calling 


skiptags(*buf); and skiptags() would read past the WHATEVER=7 FOO=6 
BAR=Times
and return the buffer to the place after fgets() where skiptags(buf) 
is called
missing all markup TAGS.

I'm better at by-refernce with ints that chars, so I don't know how far 
off I am
here.  That's why I;'m asking you guys.



Gary,

Let me restate your problem: You want to read through a file containing tags
delimited by  and to skip these tags if the user has run your command with
the -N flag.

In C any thing passed by address is by reference.  For a your static buffer
of 1024 characters: you can pass it by reference as:

   skiptags(buf); /* passes in the starting address of the buffer */
   skiptags(buf[0]); /* passes in the starting address of the buffer */
   skiptags(buf[10]); /* passes int the starting address of the buffer
  at the 11th character position. */

Arrays and pointers are always by reference.  Individual data types int,
char, etc are by value unless passed in as a pointer.  I think this is where
your confusion is around.

A couple of things to keep in mind:

   1. Remember how fgets() works.  It is entirely possible that you might have
  tags that span multiple lines.  You will need to take that into account.

   2. You can manipulate the fixed buffer two different ways:

  A. You can use pointer arithemtic, eg.

 char buf[1024];
 char *cp;

 while ((cp = fgets(buf, sizeof(buf), fp_in))) {

   if (skiptags) cp = skiptag(buf);

   /* If NULL, end of line reached */
   if (!cp) continue;

 }

 char *skiptags(char *buf)
 {
  char *tp = buf;

  /* find the start of a tag */
  while (*tp != '\0'  *tp++ != '');

  /* if no tag is found return start of buffer */
  if (*tp == '\0')
 return buf;

  /* Start of tag, find the end of tag */
  while (*tp != '\0'  *tp != '\n'  *tp++ != '');

  /* if end of line reached return NULL */
  if (*tp == '\0' || *tp == '\n')
 return NULL;

  /* return the next character start after the end tag */
  return ++tp;
 }

   B. Using indexing, eg.

 char buf[1024];
 int  i, bsize;

 while (fgets(buf, sizeof(buf), fp_in)) {
   i = 0;
   bsize = strlen(buf);

   if (skiptags) i = skiptag(buf);

   /* If NULL, end of line reached */
   if (i = bsize) continue;

 }

 int skiptags(char *buf)
 {
  int c = 0;

  /* find the start of a tag */
  while (buf[c] != '\0'  buf[c] != '')
 c++;

  /* if no tag is found return start of buffer */
  if (buf[c] == '\0')
 return 0;

  /* Start of tag, find the end of tag */
  while (buf[c] != '\0'  buf[c] != '\n'  buf[c] != '')
 c++;

  /* if end of line reached return NULL */
  if (buf[c] == '\0' || buf[c] == '\n')
 return strlen(buf);

  /* return the next character start after the end tag */
  return ++c;
 }

Both methods should allow you to skip past any tags found in the file (provided
you handle the case of a tag spanning more than one line).


Hope this clears up your confusion and gets you on your way.

Patrick
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: glabel clarification

2009-10-19 Thread Adam Vande More
On Mon, Oct 19, 2009 at 12:12 PM, PJ af.gour...@videotron.ca wrote:

 # DeviceMountpointFStypeOptionsDumpPass#
 /dev/label/swapnoneswapsw00
 /dev/label/rootfs/ufsrw11
 /dev/label/backups/backupsufsrw22
 /dev/label/home/homeufsrw22
 /dev/label/tmp/tmpufsrw22
 /dev/label/usr/usrufsrw22
 /dev/label/var/varufsrw22
 /dev/acd0/cdromcd9660ro,noauto00
 linproc  /usr/compat/linux/proc linprocfs rw 0 0

 this is ad12; ad6 is the same - I guess I hae to get rid of those labels
 in ad6 but am not sure if I need to use glabel to remove them or if just
 editing fstab will do it?


You need to use gmirror.  If you get it to clone a disk following these
instructions

http://www.freebsd.org/doc/en/books/handbook/geom-mirror.html

the disk will boot up on the new machine no problem provided hardware
compatibility.  Get rid of any label/fstab work you've done so far and
follow that page.

-- 
Adam Vande More
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Mouse and keyboard don't work in Xorg 7.4

2009-10-19 Thread Andrey Zhidenkov
I've installed FreeBSD 7.2 with Xorg 7.4 server, but mouse (usb)
and keyboard don't work. when I start X server the only way to exit
is Ctrl-Alt-F* and kill the process.

I've find out that Xorg now uses hal and dbus to configure mouse and
maybe this is a problem.

#tail /var/log/messages

Oct 19 22:10:14 freebsd kernel: info: [drm] writeback test succeeded in 1 usecs
Oct 19 22:10:14 freebsd kernel: drm0: [ITHREAD]
Oct 19 22:10:34 freebsd kernel: info: [drm] Num pipes: 1
Oct 19 22:35:02 freebsd hald[48486]: 22:35:02.636 [E] hald_dbus.c:5747: 
dbus_bus_get(): Failed to connect to socket /var/run/dbus/system_bus_socket: No 
such file or directory
Oct 19 22:36:03 freebsd kernel: info: [drm] Setting GART location based on new 
memory map
Oct 19 22:36:03 freebsd kernel: info: [drm] Loading R500 Microcode
Oct 19 22:36:03 freebsd kernel: info: [drm] Num pipes: 1
Oct 19 22:36:03 freebsd kernel: info: [drm] writeback test succeeded in 1 usecs
Oct 19 22:36:03 freebsd kernel: drm0: [ITHREAD]
Oct 19 22:36:09 freebsd kernel: info: [drm] Num pipes: 1

When I start hald (/usr/local/etc/rc.d/hald start) it don't tell anything, even 
in
verbose mode, except of:

#/usr/local/sbin/hald --verbose=yes
22:48:16.400 [I] hald.c:669: hal 0.5.11
22:48:16.400 [I] hald.c:678: Will daemonize
22:48:16.400 [I] hald.c:679: Becoming a daemon

But:

#ps aux | grep hal
mutex 68396  0.0  0.1  1660  1060  p0  D+   10:48PM   0:00.00 grep hal

So I think it doesn't starts.

This is my xorg.conf (generated by `Xorg -configure):

---

Section ServerLayout
Identifier X.org Configured
Screen  0  Screen0 0 0
InputDeviceMouse0 CorePointer
InputDeviceKeyboard0 CoreKeyboard
EndSection

Section ServerFlags
Option AutoAddDevises off
EndSection

Section Files
ModulePath   /usr/local/lib/xorg/modules
FontPath /usr/local/lib/X11/fonts/misc/
FontPath /usr/local/lib/X11/fonts/TTF/
FontPath /usr/local/lib/X11/fonts/OTF
FontPath /usr/local/lib/X11/fonts/Type1/
FontPath /usr/local/lib/X11/fonts/100dpi/
FontPath /usr/local/lib/X11/fonts/75dpi/
EndSection

Section Module
#   Load  dbe
#   Load  dri
#   Load  dri2
#   Load  extmod
Load  glx
#   Load  record
EndSection

Section InputDevice
Identifier  Keyboard0
Driver  kbd
EndSection

Section InputDevice
Identifier  Mouse0
Driver  mouse
Option  Protocol auto
Option  Device /dev/sysmouse
Option  ZAxisMapping 4 5 6 7
EndSection

Section Monitor
Identifier   Monitor0
VendorName   Monitor Vendor
ModelNameMonitor Model
EndSection

Section Device
Identifier  Card0
Driver  radeon
VendorName  ATI Technologies Inc
BoardName   RV515 [Radeon X1300]
BusID   PCI:4:0:0
EndSection

Section Screen
Identifier Screen0
Device Card0
MonitorMonitor0
SubSection Display
Viewport   0 0
Depth 1
EndSubSection
SubSection Display
Viewport   0 0
Depth 4
EndSubSection
SubSection Display
Viewport   0 0
Depth 8
EndSubSection
SubSection Display
Viewport   0 0
Depth 15
EndSubSection
SubSection Display
Viewport   0 0
Depth 16
EndSubSection
SubSection Display
Viewport   0 0
Depth 24
EndSubSection
EndSection
-

Any help will be greatly appreciated ...
 

-- 
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Mouse and keyboard don't work in Xorg 7.4

2009-10-19 Thread Manolis Kiagias
Andrey Zhidenkov wrote:
 I've installed FreeBSD 7.2 with Xorg 7.4 server, but mouse (usb)
 and keyboard don't work. when I start X server the only way to exit
 is Ctrl-Alt-F* and kill the process.

 I've find out that Xorg now uses hal and dbus to configure mouse and
 maybe this is a problem.
   

It will probably work fine if you add the following two lines into
/etc/rc.conf and reboot:

dbus_enable=YES
hald_enable=YES

Have  a look at the updated Handbook section that describes this
procedure in more detail:

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/x-config.html
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


sendmail domain configuration

2009-10-19 Thread stan
I am trying to work around some design issues. Some of out FreeBSD macines
must live in a made up domain. As a result from these machines gtes
discarded by an sensible mail handling system. 

I have solved this problem on some Soalris machines that also si`uffer from
this same design by settting the doamin macro in thier sendmail.cf as
follows:

Dj$w.realdomain.com

OI know that in FreeBSD I should not edit sendmail.cf directly, but instead
should edit the appropriate .mc file, and remake the .cf file. But I cannot
find the documentation as to how to set this particular sendmail macro from
the .mc file

Can anyou give me some guidance here? 

-- 
One of the main causes of the fall of the roman empire was that, lacking
zero, they had no way to indicate successful termination of their C
programs.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Mouse and keyboard don't work in Xorg 7.4

2009-10-19 Thread Andrey Zhidenkov
On Mon, Oct 19, 2009 at 10:30:27PM +0300, Manolis Kiagias wrote:
 Andrey Zhidenkov wrote:
  I've installed FreeBSD 7.2 with Xorg 7.4 server, but mouse (usb)
  and keyboard don't work. when I start X server the only way to exit
  is Ctrl-Alt-F* and kill the process.
 
  I've find out that Xorg now uses hal and dbus to configure mouse and
  maybe this is a problem.

 
 It will probably work fine if you add the following two lines into
 /etc/rc.conf and reboot:
 
 dbus_enable=YES
 hald_enable=YES
I've added yet, but it doesn't helps ;(. And when I reboot I can't found any
hald or dbus messages in dmesg.

 Have  a look at the updated Handbook section that describes this
 procedure in more detail:
 
 http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/x-config.html
Thank you, I've readed.
-- 
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Mouse and keyboard don't work in Xorg 7.4

2009-10-19 Thread Manolis Kiagias
Andrey Zhidenkov wrote:
 On Mon, Oct 19, 2009 at 10:30:27PM +0300, Manolis Kiagias wrote:
   
 Andrey Zhidenkov wrote:
 
 I've installed FreeBSD 7.2 with Xorg 7.4 server, but mouse (usb)
 and keyboard don't work. when I start X server the only way to exit
 is Ctrl-Alt-F* and kill the process.

 I've find out that Xorg now uses hal and dbus to configure mouse and
 maybe this is a problem.
   
   
 It will probably work fine if you add the following two lines into
 /etc/rc.conf and reboot:

 dbus_enable=YES
 hald_enable=YES
 
 I've added yet, but it doesn't helps ;(. And when I reboot I can't found any
 hald or dbus messages in dmesg.

   
 Have  a look at the updated Handbook section that describes this
 procedure in more detail:

 http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/x-config.html
 
 Thank you, I've readed.
   

I also noticed you have a ServerFlags section with AutoAddDevices off
Could you try removing this and see if it works?
You may in fact try running X without an xorg.conf at all.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: sendmail domain configuration

2009-10-19 Thread Matthew Seaman

stan wrote:

I am trying to work around some design issues. Some of out FreeBSD macines
must live in a made up domain. As a result from these machines gtes
discarded by an sensible mail handling system. 


I have solved this problem on some Soalris machines that also si`uffer from
this same design by settting the doamin macro in thier sendmail.cf as
follows:

Dj$w.realdomain.com

OI know that in FreeBSD I should not edit sendmail.cf directly, but instead
should edit the appropriate .mc file, and remake the .cf file. But I cannot
find the documentation as to how to set this particular sendmail macro from
the .mc file

Can anyou give me some guidance here? 



/usr/share/sendmail/cf/README documents what you can put into a sendmail .mc
file.  The specific thing you want is:

define(`confDOMAIN_NAME', `$w.realdomain.com')dnl

Add this to the `hostname`.mc file, and then just type 'make' in /etc/mail to 
generate a .cf file from it.  To generate and install that .cf file and restart 
sendmail to use it all in one, just do:

  # make all install restart 


Cheers,

Matthew

--
Dr Matthew J Seaman MA, D.Phil.   7 Priory Courtyard
 Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
 Kent, CT11 9PW



signature.asc
Description: OpenPGP digital signature


Re: Building Ghostscript from source on FreeBSD

2009-10-19 Thread Brent Bloxam

Brent Bloxam wrote:
I'm having trouble building Ghostscript 8.70 from source on FreeBSD 7.0. 
I cannot use the version in the ports tree for various reasons. I've 
looked at the .mak patches in ./files/ for the ports tree however to try 
to suss out any differences but they elude me.


My configure line:
./configure --prefix=/usr/local/imagemagick-6.5.6 --disable-cups 
--disable-gtk --disable-cairo --disable-fontconfig --without-libpaper 
--without-pdftoraster --without-ijs --without-jbig2dec --without-jasper 
--without-omni --without-x --with-drivers=BMP,FAX,JPEG,PNG,PS,TIFF


The error I receive building:

gcc -Wall -Wstrict-prototypes -Wundef -Wmissing-declarations 
-Wmissing-prototypes -Wwrite-strings -Wno-strict-aliasing 
-Wdeclaration-after-statement -fno-builtin -fno-common -DHAVE_STDINT_H 
-DGX_COLOR_INDEX_TYPE=unsigned long long -I./base -o ./obj/genconf 
./base/genconf.c

gcc: ./base/genconf.c: No such file or directory
gcc: No input files specified

./base/genconf.c exists. Executing the gcc command on its own is 
successful, yet the build can't continue even with ./obj/genconf 
existing. `make -d A` reaches the failure with:


Examining ./base/stdpn.h...modified 18:23:38 Jun 05, 2007...up-to-date.
Examining ./obj/genconf...non-existent...modified before source 
(/home/build/ghostscript-8.70/./base/genconf.c)...out-of-date.

./obj/genconf: = /home/build/ghostscript-8.70/./base/genconf.c
./obj/genconf:? = /home/build/ghostscript-8.70/./base/genconf.c
./obj/genconf: = /home/build/ghostscript-8.70/./base/genconf.c 
/home/build/ghostscript-8.70/./base/stdpre.h
./obj/genconf:? = /home/build/ghostscript-8.70/./base/genconf.c 
/home/build/ghostscript-8.70/./base/stdpre.h
./obj/genconf: = /home/build/ghostscript-8.70/./base/genconf.c 
/home/build/ghostscript-8.70/./base/stdpre.h 
/home/build/ghostscript-8.70/./base/stdpn.h
./obj/genconf:? = /home/build/ghostscript-8.70/./base/genconf.c 
/home/build/ghostscript-8.70/./base/stdpre.h 
/home/build/ghostscript-8.70/./base/stdpn.h
cc -Wall -Wstrict-prototypes -Wundef -Wmissing-declarations 
-Wmissing-prototypes -Wwrite-strings -Wno-strict-aliasing 
-Wdeclaration-after-statement -fno-builtin -fno-common -DHAVE_STDINT_H 
-DGX_COLOR_INDEX_TYPE=unsigned long long -I./base -o ./obj/genconf 
./base/genconf.c

cc: ./base/genconf.c: No such file or directory
cc: No input files specified

Why is it that it believes ./obj/genconf is nonexistent, and then 
proceeds to fail while it has no problems with anything else up to that 
point?


Solved. Looks like building Ghostscript explicitly requires gmake
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


mailx folder-hook

2009-10-19 Thread David Collins
Hi,

First off I know this isn't the place for this question and it is
totally off topic, but I have been searching the internet for ages and
have read the relevant section of the man page a number of times and
tried a number of combination and I still can't figure this out. I am
asking here because of all the forum/mailing lists that I see this one
is one of the most knowledgable so someone here will probably know the
answer.

I have been using heirloom mailx to get some work based imap email,
and I want to use it to read the questions here too, since it is
easier. However there is quite a lot of traffic and I would like to
filter mail but I can't get it to work.

in my .mailrc I have the following:

## gmail imap account
account ml {
## open inbox
set folder=imaps://u...@imapserver/Inbox
}

## set up mail filters
## move freebsd questions mail the the freebsd_questions folder
define freebsd_questions {
move (text freebsd-questions@freebsd.org) @freebsd_questions
}
set folder-hook-imap://davidcollins00...@imap.gmail.com/Inbox=freebsd_questions

All mail gets delivered and if I type 'call freebsd_questions' all the
mail gets moved, but it won't do it when I login. Does anyone have any
ideas about what I am doing wrong?

David
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Fwd: upgrading remote server

2009-10-19 Thread John Almberg
Okay! After a lot of googling/reading I successfully upgraded to 7.2, 
now I'm trying to upgrade ports...


I ran portmaster -L and got a long list of ports that need upgrading... 
From my reading, it seems like the only way to do this is to go through 
the list, one by one, and either (1) delete unused ports or (2) upgrade 
ports that seem to need it.


This is going to take quite a bit of time... am I missing something 
(other than the fact that I should have been doing this all along?)


-- John
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Fwd: upgrading remote server

2009-10-19 Thread Adam Vande More
On Mon, Oct 19, 2009 at 4:29 PM, John Almberg jalmb...@identry.com wrote:

 Okay! After a lot of googling/reading I successfully upgraded to 7.2, now
 I'm trying to upgrade ports...

 I ran portmaster -L and got a long list of ports that need upgrading...
 From my reading, it seems like the only way to do this is to go through the
 list, one by one, and either (1) delete unused ports or (2) upgrade ports
 that seem to need it.

 This is going to take quite a bit of time... am I missing something (other
 than the fact that I should have been doing this all along?)


man portmaster




 -- John




-- 
Adam Vande More
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


scalable FreeBSD based LNS (with L2TPv2)

2009-10-19 Thread Rogelio
Has anyone created/used/found/seen a FreeBSD based LNS that supports
thousands L2TPv2 tunnels?  Right now, the only solution I see that scales to
this level is Redback, and if not a Redback box, then lots of Cisco 7200
boxes.

-- 
Also on LinkedIn?  Feel free to add me as a friend: scubac...@gmail.com
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: scalable FreeBSD based LNS (with L2TPv2)

2009-10-19 Thread Vincent Hoffman
Rogelio wrote:
 Has anyone created/used/found/seen a FreeBSD based LNS that supports
 thousands L2TPv2 tunnels?  Right now, the only solution I see that scales to
 this level is Redback, and if not a Redback box, then lots of Cisco 7200
 boxes.

   
I understand MPD (ports/net/mpd5) is used in large scale deployments.
I've only ever used it as a proof of concept though, (for which it
worked great, sadly they went for a pair of 7200s instead.)

Vince

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Mouse and keyboard don't work in Xorg 7.4

2009-10-19 Thread Warren Block

On Mon, 19 Oct 2009, Andrey Zhidenkov wrote:


I've installed FreeBSD 7.2 with Xorg 7.4 server, but mouse (usb)
and keyboard don't work. when I start X server the only way to exit
is Ctrl-Alt-F* and kill the process.

I've find out that Xorg now uses hal and dbus to configure mouse and
maybe this is a problem.


xorg-server uses if configured to use hal.


When I start hald (/usr/local/etc/rc.d/hald start) it don't tell anything, even 
in
verbose mode, except of:

#/usr/local/sbin/hald --verbose=yes
22:48:16.400 [I] hald.c:669: hal 0.5.11
22:48:16.400 [I] hald.c:678: Will daemonize
22:48:16.400 [I] hald.c:679: Becoming a daemon

But:

#ps aux | grep hal
mutex 68396  0.0  0.1  1660  1060  p0  D+   10:48PM   0:00.00 grep hal

So I think it doesn't starts.


dbus_enable=YES and hald_enable=YES in /etc/rc.conf?


This is my xorg.conf (generated by `Xorg -configure):

---

Section ServerLayout
Identifier X.org Configured
Screen  0  Screen0 0 0
InputDeviceMouse0 CorePointer
InputDeviceKeyboard0 CoreKeyboard
EndSection

Section ServerFlags
   Option AutoAddDevises off
EndSection


That's spelled wrong.  (AutoAddDevices)

By turning that off, you are telling xorg-server to ignore hal detection 
of devices.  So even if hal was running, it would be ignored.


If you let xorg use hal, you can remove the InputDevice sections above 
and below.


The Handbook section on xorg configuration is pretty thorough:

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/x-config.html

-Warren Block * Rapid City, South Dakota USA
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


FreeBSD 7.2 savecore panic

2009-10-19 Thread Bogdan Webb
Hello.
I've got a small issue with my bsd box... I'm a new BSD user and please
accept my deepest apologies if i have rushed to use the mailing lists to
shout, what may be a silly issue. During the 3 moths the server that i
manage had 2 unexpected reboots after some ports were about to be installed.
The first time i wasn't paying much attention to the process and can't tell
exactly what caused the panic (it was certainly a port install related) but
i've paid close attention to this 2nd time. The server runs FreeBSD
7.2-RELEASE #0 on a amd64 arch and it cracked when i tried to install
portmanager from the /usr/ports/ports-mgmt/portmanager tree and using the
basic 'make install clean' command. Previously i've made the steps of
updating the portsnap collection in order to keep my box up2date. Out of
nowhere bsd crashed and using google i've managed to get some info about
crash logs:
./messages:Oct 20 00:13:25 pgn savecore: reboot after panic: page fault

/var/crash/info.0
Dump header from device /dev/ad10s1b
  Architecture: amd64
  Architecture Version: 2
  Dump Length: 426561536B (406 MB)
  Blocksize: 512
  Dumptime: Thu Sep 10 18:36:20 2009
  Hostname: pvp.ro
  Magic: FreeBSD Kernel Dump
  Version String: FreeBSD 7.2-RELEASE #0: Fri May  1 07:18:07 UTC 2009
r...@driscoll.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC
  Panic String: page fault
  Dump Parity: 2499253002
  Bounds: 0
  Dump Status: good


pgn# uname -a
FreeBSD pgn.ro 7.2-RELEASE FreeBSD 7.2-RELEASE #0: Fri May  1 07:18:07 UTC
2009 r...@driscoll.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64

saw some other topic related to issues like this and they pointed out
tinkering the
rc.conf:dumpdev=AUTO
rc.conf:savecore_flags=
But if i would prolly knew what i'm to do i wouldn't write this long dumb
help request :)

What's wrong with my bsd box (witch i'm in love so much now) and how can i
prevent it from panicking
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: need C help, passing char buffer[] by-value....

2009-10-19 Thread Gary Kline
On Mon, Oct 19, 2009 at 11:09:19AM -0700, Patrick Mahan wrote:
 See comments interspaced below -
 
 Gary,
 
 Let me restate your problem: You want to read through a file containing tags
 delimited by  and to skip these tags if the user has run your command 
 with
 the -N flag.
 
 In C any thing passed by address is by reference.  For a your static 
 buffer
 of 1024 characters: you can pass it by reference as:
 
skiptags(buf); /* passes in the starting address of the buffer */
skiptags(buf[0]); /* passes in the starting address of the 
buffer */
skiptags(buf[10]); /* passes int the starting address of the 
buffer
   at the 11th character position. */
 
 Arrays and pointers are always by reference.  Individual data types int,
 char, etc are by value unless passed in as a pointer.  I think this is 
 where
 your confusion is around.


You've got it exactly right, Patrick.  There were no C classes in 
1978--I 
taught myself.  Obviously, not that well because I have already dreaded 
pointers.  ---Well, usually.
 
 A couple of things to keep in mind:
 
1. Remember how fgets() works.  It is entirely possible that you might 
have
   tags that span multiple lines.  You will need to take that into 
   account.
 
2. You can manipulate the fixed buffer two different ways:
 
   A. You can use pointer arithemtic, eg.
 
  char buf[1024];
  char *cp;
 
  while ((cp = fgets(buf, sizeof(buf), fp_in))) {
 
if (skiptags) cp = skiptag(buf);
 
/* If NULL, end of line reached */
if (!cp) continue;
 
  }
 
  char *skiptags(char *buf)
  {
 char *tp = buf;
 
   /* find the start of a tag */
   while (*tp != '\0'  *tp++ != '');
 
   /* if no tag is found return start of buffer */
   if (*tp == '\0')
  return buf;
 
   /* Start of tag, find the end of tag */
   while (*tp != '\0'  *tp != '\n'  *tp++ != '');
 
   /* if end of line reached return NULL */
   if (*tp == '\0' || *tp == '\n')
  return NULL;
 
   /* return the next character start after the end tag */
   return ++tp;
  }
 
B. Using indexing, eg.
 
  char buf[1024];
  int  i, bsize;
 
  while (fgets(buf, sizeof(buf), fp_in)) {
i = 0;
bsize = strlen(buf);
 
if (skiptags) i = skiptag(buf);
 
/* If NULL, end of line reached */
if (i = bsize) continue;
 
  }
 
  int skiptags(char *buf)
  {
 int c = 0;
 
   /* find the start of a tag */
   while (buf[c] != '\0'  buf[c] != '')
  c++;
 
   /* if no tag is found return start of buffer */
   if (buf[c] == '\0')
  return 0;
 
   /* Start of tag, find the end of tag */
   while (buf[c] != '\0'  buf[c] != '\n'  buf[c] != '')
  c++;
 
   /* if end of line reached return NULL */
   if (buf[c] == '\0' || buf[c] == '\n')
  return strlen(buf);
 
   /* return the next character start after the end tag */
   return ++c;
  }
 
 Both methods should allow you to skip past any tags found in the file 
 (provided
 you handle the case of a tag spanning more than one line).
 
 
 Hope this clears up your confusion and gets you on your way.


Your examples help a lot!   Everything works except when there are two 
or more 
tags on one line such as:

BODY BGCOLOR=#FF LINK=#00 VLINK=#006633FONT SIZE=4


I think I see where is your skiptags--pointer arithematic 
function--this can be
caught.  Thanks much!

:-)

gary



 
 Patrick
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org

-- 
 Gary Kline  kl...@thought.org  http://www.thought.org  Public Service Unix
http://jottings.thought.org   http://transfinite.thought.org
The 7.31a release of Jottings: http://jottings.thought.org/index.php

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: glabel clarification

2009-10-19 Thread PJ
Adam Vande More wrote:
 On Mon, Oct 19, 2009 at 12:12 PM, PJ af.gour...@videotron.ca wrote:

   
 # DeviceMountpointFStypeOptionsDumpPass#
 /dev/label/swapnoneswapsw00
 /dev/label/rootfs/ufsrw11
 /dev/label/backups/backupsufsrw22
 /dev/label/home/homeufsrw22
 /dev/label/tmp/tmpufsrw22
 /dev/label/usr/usrufsrw22
 /dev/label/var/varufsrw22
 /dev/acd0/cdromcd9660ro,noauto00
 linproc  /usr/compat/linux/proc linprocfs rw 0 0

 this is ad12; ad6 is the same - I guess I hae to get rid of those labels
 in ad6 but am not sure if I need to use glabel to remove them or if just
 editing fstab will do it?

 

 You need to use gmirror.  If you get it to clone a disk following these
 instructions

 http://www.freebsd.org/doc/en/books/handbook/geom-mirror.html

 the disk will boot up on the new machine no problem provided hardware
 compatibility.  Get rid of any label/fstab work you've done so far and
 follow that page.
   
I am trying to digest the procedure.
Forgive me if I am a little slow, but I want to be sure to do it right.
1. this procedure requres that both diisks be identical... ?? This is
not always possible... I'm not sure I have that possibility at the
moment and I don't want to empty other disks from other machines.
2. I am trying to under stand if the procedure is to be done from the
active disk, say ad4 and the idea is to copy ad4 to say ad6? Or should I
be running on a third disk, say ad12 and be copying ad4 to ad6?
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Error when changin from -ro to rw on /etc/exports, FREEBSD STABLE 7.2

2009-10-19 Thread Jeronimo Calvo
Hi folks,

Today I decide to change the settings from my server, allowing RW
access to 2 currently mapped NFS partions on my Freebsd box.
The used to be RO only.

What i notice is when I change it as follows:

[root@ /DATA1]# cat /etc/exports
/DATA1  -rw 192.168.11.6
/DATA2  -rw 192.168.11.6


I am not able to map them anymore from my opensolaris client.
When changing back to RO, it maps correctly.

All permissions are set un as 755 -R on /DATA1 and /DATA2

When on RO, it maps when requested via AutoFS perfectly:

/net/192.168.11.5/DATA1 on 192.168.11.5:/DATA1
remote/read/write/nosetuid/nodevices/xattr/dev=4ec0007 on Mon Oct 19
23:09:45 2009
/net/192.168.11.5/DATA2 on 192.168.11.5:/DATA2
remote/read/write/nosetuid/nodevices/xattr/dev=4ec0008 on Mon Oct 19
23:09:46 2009

Any ideas? im sure im mistaking somewhere... :S

-- 
() ASCII Ribbon Campaign | Against HTML e-mail
/\  www.asciiribbon.org  | Against proprietary extensions
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


PHP5 + fastcgi + apache2.2 ... how to for FreeBSD?

2009-10-19 Thread Marc G. Fournier


Is there one somewhere?  I'm finding *alot* of Debian ones dealing with 
their whole apget stuff, but would like to find something that speaks 
normally :)


Thx ...


Marc G. FournierHub.Org Hosting Solutions S.A.
scra...@hub.org http://www.hub.org

Yahoo:yscrappySkype: hub.orgICQ:7615664MSN:scra...@hub.org
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: glabel clarification

2009-10-19 Thread Adam Vande More
On Mon, Oct 19, 2009 at 4:58 PM, PJ af.gour...@videotron.ca wrote:

 Adam Vande More wrote:
  On Mon, Oct 19, 2009 at 12:12 PM, PJ af.gour...@videotron.ca wrote:
 
 
  # DeviceMountpointFStypeOptionsDumpPass#
  /dev/label/swapnoneswapsw00
  /dev/label/rootfs/ufsrw11
  /dev/label/backups/backupsufsrw22
  /dev/label/home/homeufsrw22
  /dev/label/tmp/tmpufsrw22
  /dev/label/usr/usrufsrw22
  /dev/label/var/varufsrw22
  /dev/acd0/cdromcd9660ro,noauto00
  linproc  /usr/compat/linux/proc linprocfs rw 0 0
 
  this is ad12; ad6 is the same - I guess I hae to get rid of those labels
  in ad6 but am not sure if I need to use glabel to remove them or if just
  editing fstab will do it?
 
 
 
  You need to use gmirror.  If you get it to clone a disk following these
  instructions
 
  http://www.freebsd.org/doc/en/books/handbook/geom-mirror.html
 
  the disk will boot up on the new machine no problem provided hardware
  compatibility.  Get rid of any label/fstab work you've done so far and
  follow that page.
 
 I am trying to digest the procedure.
 Forgive me if I am a little slow, but I want to be sure to do it right.
 1. this procedure requres that both diisks be identical... ?? This is
 not always possible... I'm not sure I have that possibility at the
 moment and I don't want to empty other disks from other machines.


No if you have one smaller disk you should use that as the base mirror disk,
then add the larger to the mirror.  Of course there would be some unused
space on the larger drive, but that usually not a problem.


 2. I am trying to under stand if the procedure is to be done from the
 active disk, say ad4 and the idea is to copy ad4 to say ad6? Or should I
 be running on a third disk, say ad12 and be copying ad4 to ad6?


From your example assuming ad4 is the smallest of disk sizes you use.

sysctl kern.geom.debugflags=17
gmirror label -vb round-robin gm0 /dev/ad4
echo 'geom_mirror_load=YES'  /boot/loader.conf
Edit the /etc/fstab file
shutdown -r now
gmirror insert gm0 /dev/ad6

wait until drives are synced. verify by gmirror status. power down.
pull ad6 and insert into new system. Power it on. you are done. repeat
as necessary.






-- 
Adam Vande More
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Continued hassles trying to compile qt4-designer

2009-10-19 Thread Warren Liddell
Running FreeBSD 7.2-STABLE AMD64 machine ports src an kernel are as 
updated as can be .. below is the error when trying to compile...




: undefined reference to 
`qdesigner_internal::QDesignerSharedSettings::formTemplatePaths() const'
.obj/release-shared/newform.o(.text+0x5): In function 
`NewForm::grabForm(QDesignerFormEditorInterface*, QIODevice, QString 
const, qdesigner_internal::DeviceProfile const)':
: undefined reference to 
`qdesigner_internal::NewFormWidget::grabForm(QDesignerFormEditorInterface*, 
QIODevice, QString const, qdesigner_internal::DeviceProfile const)'
.obj/release-shared/newform.o(.text+0xcfc): In function 
`NewForm::NewForm(QDesignerWorkbench*, QWidget*, QString const)':
: undefined reference to 
`QDesignerNewFormWidgetInterface::createNewFormWidget(QDesignerFormEditorInterface*, 
QWidget*)'
.obj/release-shared/newform.o(.text+0x112c): In function 
`NewForm::NewForm(QDesignerWorkbench*, QWidget*, QString const)':
: undefined reference to 
`QDesignerNewFormWidgetInterface::createNewFormWidget(QDesignerFormEditorInterface*, 
QWidget*)'
.obj/release-shared/preferencesdialog.o(.text+0x245): In function 
`PreferencesDialog::PreferencesDialog(QDesignerFormEditorInterface*, 
QWidget*)':
: undefined reference to `QDesignerFormEditorInterface::optionsPages() 
const'
.obj/release-shared/preferencesdialog.o(.text+0x625): In function 
`PreferencesDialog::PreferencesDialog(QDesignerFormEditorInterface*, 
QWidget*)':
: undefined reference to `QDesignerFormEditorInterface::optionsPages() 
const'
/usr/local/lib/qt4/libQtDesigner.so: undefined reference to 
`QCss::Parser::parse(QCss::StyleSheet*)'

*** Error code 1
1 error
*** Error code 2
1 error
*** Error code 2
1 error
*** Error code 2
1 error
*** Error code 1

Stop in /usr/ports/devel/qt4-designer.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: ZFS: Strange performance issues

2009-10-19 Thread Carl Chave
Chris,

Don't know, but, I will paste in a portion of the ZFS admin guide from SUN:

Because these statistics are cumulative since boot, bandwidth might
appear low if the pool is
relatively idle. You can request a more accurate view of current
bandwidth usage by specifying
an interval. For example:

# zpool iostat tank 2

Later it says about the -v option:

You can use the same set of options (interval and count) when
examining virtual device
statistics.

http://dlc.sun.com/pdf/819-5461/819-5461.pdf

Page 95
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Mouse and keyboard don't work in Xorg 7.4

2009-10-19 Thread herbert langhans
If you dont need it for another reason, you can compile xorg-server without hal 
(#make config). Mouse and keyboard works without it too. This solved all such 
problems on my laptop.

Cheers
herb langhans

On Mon, Oct 19, 2009 at 10:52:24PM +0400, Andrey Zhidenkov wrote:
 I've installed FreeBSD 7.2 with Xorg 7.4 server, but mouse (usb)
 and keyboard don't work. when I start X server the only way to exit
 is Ctrl-Alt-F* and kill the process.
 
 I've find out that Xorg now uses hal and dbus to configure mouse and
 maybe this is a problem.
 
 #tail /var/log/messages
 
 Oct 19 22:10:14 freebsd kernel: info: [drm] writeback test succeeded in 1 
 usecs
 Oct 19 22:10:14 freebsd kernel: drm0: [ITHREAD]
 Oct 19 22:10:34 freebsd kernel: info: [drm] Num pipes: 1
 Oct 19 22:35:02 freebsd hald[48486]: 22:35:02.636 [E] hald_dbus.c:5747: 
 dbus_bus_get(): Failed to connect to socket /var/run/dbus/system_bus_socket: 
 No such file or directory
 Oct 19 22:36:03 freebsd kernel: info: [drm] Setting GART location based on 
 new memory map
 Oct 19 22:36:03 freebsd kernel: info: [drm] Loading R500 Microcode
 Oct 19 22:36:03 freebsd kernel: info: [drm] Num pipes: 1
 Oct 19 22:36:03 freebsd kernel: info: [drm] writeback test succeeded in 1 
 usecs
 Oct 19 22:36:03 freebsd kernel: drm0: [ITHREAD]
 Oct 19 22:36:09 freebsd kernel: info: [drm] Num pipes: 1
 
 When I start hald (/usr/local/etc/rc.d/hald start) it don't tell anything, 
 even in
 verbose mode, except of:
 
 #/usr/local/sbin/hald --verbose=yes
 22:48:16.400 [I] hald.c:669: hal 0.5.11
 22:48:16.400 [I] hald.c:678: Will daemonize
 22:48:16.400 [I] hald.c:679: Becoming a daemon
 
 But:
 
 #ps aux | grep hal
 mutex 68396  0.0  0.1  1660  1060  p0  D+   10:48PM   0:00.00 grep hal
 
 So I think it doesn't starts.
 
 This is my xorg.conf (generated by `Xorg -configure):
 
 ---
 
 Section ServerLayout
   Identifier X.org Configured
   Screen  0  Screen0 0 0
   InputDeviceMouse0 CorePointer
   InputDeviceKeyboard0 CoreKeyboard
 EndSection
 
 Section ServerFlags
 Option AutoAddDevises off
 EndSection
 
 Section Files
   ModulePath   /usr/local/lib/xorg/modules
   FontPath /usr/local/lib/X11/fonts/misc/
   FontPath /usr/local/lib/X11/fonts/TTF/
   FontPath /usr/local/lib/X11/fonts/OTF
   FontPath /usr/local/lib/X11/fonts/Type1/
   FontPath /usr/local/lib/X11/fonts/100dpi/
   FontPath /usr/local/lib/X11/fonts/75dpi/
 EndSection
 
 Section Module
 # Load  dbe
 # Load  dri
 # Load  dri2
 # Load  extmod
   Load  glx
 # Load  record
 EndSection
 
 Section InputDevice
   Identifier  Keyboard0
   Driver  kbd
 EndSection
 
 Section InputDevice
   Identifier  Mouse0
   Driver  mouse
   Option  Protocol auto
   Option  Device /dev/sysmouse
   Option  ZAxisMapping 4 5 6 7
 EndSection
 
 Section Monitor
   Identifier   Monitor0
   VendorName   Monitor Vendor
   ModelNameMonitor Model
 EndSection
 
 Section Device
   Identifier  Card0
   Driver  radeon
   VendorName  ATI Technologies Inc
   BoardName   RV515 [Radeon X1300]
   BusID   PCI:4:0:0
 EndSection
 
 Section Screen
   Identifier Screen0
   Device Card0
   MonitorMonitor0
   SubSection Display
   Viewport   0 0
   Depth 1
   EndSubSection
   SubSection Display
   Viewport   0 0
   Depth 4
   EndSubSection
   SubSection Display
   Viewport   0 0
   Depth 8
   EndSubSection
   SubSection Display
   Viewport   0 0
   Depth 15
   EndSubSection
   SubSection Display
   Viewport   0 0
   Depth 16
   EndSubSection
   SubSection Display
   Viewport   0 0
   Depth 24
   EndSubSection
 EndSection
 -
 
 Any help will be greatly appreciated ...
  
 
 -- 
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org

-- 
sprachtraining langhans
herbert langhans, warschau
http://www.langhans.com.pl
herbert dot raimund at gmx dot net
+0048 603 341 441

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: I hate to bitch but bitch I must

2009-10-19 Thread Bob Hall
On Sun, Oct 18, 2009 at 11:48:55AM -0400, PJ wrote:
 Bob Hall wrote:
  On Sat, Oct 17, 2009 at 05:36:43PM -0400, PJ wrote:

  Bob Hall wrote:
  
  On Sat, Oct 17, 2009 at 02:34:40AM +, Mark wrote:


  Actually, this has got very little to do with being a native English
  speaker or not. It's ere a matter of intonation (which, in writing, can
  only be conveyed to a certain degree, of course). 'Should' can certainly
  mean Don't try that. As in:
 
  Will the ice hold me?
  Well, technically it should.
 
  (Meaning: it probably will, but I'm not overly confident.)
  
  
  Actually, what's happening here is dropping part of a sentence. It's
  common in English to shorten
Yea, it should work, but it doesn't.


  Absolutely not! There is nothing to suggest either statement above. If
  one says it should work, it can mean (of course, it changes within
  different contexts) that all is ok and normal conditions (whatever they
  may be) will allow things to function correctly. There is certainly no
  implication about confidence... where do you get that? 
  
 
  From common English usage. Specifically, where? Australia, England, 
  Russia, France, USA, Canada... Again, that is your personal interpretation 
  and certainly not common English usage. Or better yet, try common sense. 
  Or, better yet, you *should* go back to school.

The third edition of Fowler's Modern English Usage gives British and
American usage.  Merriam-Webster's Dictionary of English Usage
concentrates more on American usage. I don't have access to any
specifically Australian or Canadian reference books.  Anyone interested
in the topic can look up the use of should as a modal verb and see
what is common usage.

My compliments to the authors of the man page for their clear and
concise use of English. My complements to Polytropan for spotting the
fact that should was being used as a modal verb, even if he didn't
call it that. My compliments to Warren Block for submitting the PR.  I
believe that's my cue to exit the thread.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: need C help, passing char buffer[] by-value....

2009-10-19 Thread Polytropon
On Mon, 19 Oct 2009 08:58:05 -0500, David Kelly dke...@hiwaay.net wrote:
 On Mon, Oct 19, 2009 at 05:43:44AM +0200, Polytropon wrote:
  to make sure s is not NULL, or testing for it explicitely like
  
  if(!s)
  ... error handling here ...
 
 You are missing my point that *s == 0 is not a good out of bounds range
 check.

That's correct. Test != NULL just ensures that it is not a
NULL pointer. Range checking should always be applied
additionally.



 strlen() knows nothing about the buffer allocation. As I originally
 said, testing for null (and my example tested) is not foolproof but its
 better than nothing. One should *also* test for the known end of the
 allocated buffer.

Yes. That's why an additional length parameter is a good
choice, as well as maybe checing every individual character,
e. g. checking for validity BEFORE doing something with it.



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: glabel clarification

2009-10-19 Thread Polytropon
On Mon, 19 Oct 2009 15:59:43 +0200, Johan Hendriks jo...@double-l.nl wrote:
 Switching between machines is not what labels are for.(enlighten me if
 it is)

It CAN. If /etc/fstab content matches the labels of the
partitions, it matches them regardless of the disk they
are on (da[0123...] or ad[0123...]), so the disk can be
placed on any controller in any computer.



 As far as understand, it makes switching the drive in the same machine
 easier.

It does, which is obvious according to the explaination
given before. But it is not restricted to one machine.



 It does not matter if labels are used, that the device is seen as
 /dev/ad0 or /dev/ad{x}.
 This makes adding and replacing disk much easier.

Furthermore, it gives you the chance do change the name
for a device to something human readable, e. g. the
descriptive name usrfs for ad0s1e. In different
settngs, functional file system entry points may refer
to different device nodes, depending on the current disk
layout.



 Sometimes the disk numbers change when removing raid controllers or
 other hardware.

That's true.



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: need C help, passing char buffer[] by-value....

2009-10-19 Thread Patrick Mahan



Gary Kline wrote:

On Mon, Oct 19, 2009 at 11:09:19AM -0700, Patrick Mahan wrote:

See comments interspaced below -

Gary,

Let me restate your problem: You want to read through a file containing tags
delimited by  and to skip these tags if the user has run your command 
with

the -N flag.

In C any thing passed by address is by reference.  For a your static 
buffer

of 1024 characters: you can pass it by reference as:

   skiptags(buf); /* passes in the starting address of the buffer */
   skiptags(buf[0]); /* passes in the starting address of the 
   buffer */
   skiptags(buf[10]); /* passes int the starting address of the 
   buffer

  at the 11th character position. */

Arrays and pointers are always by reference.  Individual data types int,
char, etc are by value unless passed in as a pointer.  I think this is 
where

your confusion is around.



	You've got it exactly right, Patrick.  There were no C classes in 1978--I 
	taught myself.  Obviously, not that well because I have already dreaded 
	pointers.  ---Well, usually.


You are welcome, glad to help.

[examples snipped]




	Your examples help a lot!   Everything works except when there are two or more 
	tags on one line such as:


BODY BGCOLOR=#FF LINK=#00 VLINK=#006633FONT SIZE=4


I think I see where is your skiptags--pointer arithematic 
function--this can be
caught.  Thanks much!



If I might make a suggestion.  Make use of a case (switch) statement:

switch(buf[c]) {
case '': /* start of tag, skip it if requested */
 if (skiptags) c = skiptag(buf[c]);
 ...

default: /* handle normal stuff */
  ...
}

Inside your while() statement.

Good luck,

Patrick

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: glabel clarification

2009-10-19 Thread Polytropon
On Mon, 19 Oct 2009 11:58:18 -0400, PJ af.gour...@videotron.ca wrote:
 Actually, I have been trying to clone a disk and then install the disk
 in another machine or same clone in several machines. That's why I
 thought that once the clone is make it would boot on any machine. This
 in presuming that each clone is identical including the fstab file; I
 understood that this would allow immediate bootup regardless of what the
 disk may be ad4, ad1, ad12 or whatever.

I think that's a possible explaination. I'm guessing: If the
labels of both disks have the same names, and both disks are
present at booting time, and /etc/fstab contains those labels,
then maybe if both disks have identical labels, then instead
from the booting disk ad6, the ad12 disk labels are used for
file system mounting?

The easiest way REALLY is to extract one disk from the system
and use only one disk for booting tests. Let's say you've
already transfered data from ad6 (source) to ad12 (target)
successfully. Now unplug ad6 and let the system boot from
ad12. It should work. Then, put ad12's disk to ad6's controller.
So now the former ad12 is ad6. Because you're using labels,
it shouldn't matter. Try to boot. Should work as well.

This really is the easiest way to check.



 I can still clone the disk but then just have to
 find what disk is the clone.

Clones are identical. :-)

Seriously: There is a way to determine it definitely: Have a
look at the UFSID class labels. They should be unique, even
if glabel labels are identical.



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: glabel clarification

2009-10-19 Thread Polytropon
On Mon, 19 Oct 2009 13:12:06 -0400, PJ af.gour...@videotron.ca wrote:
 this is ad12; ad6 is the same - I guess I hae to get rid of those labels
 in ad6 but am not sure if I need to use glabel to remove them or if just
 editing fstab will do it?

You could indicate if a given disk is your working disk (w)
or your backup disk (b). A possible fstab would look like
this:

The working disk:
/dev/label/w-swap none  swap  sw  0  0
/dev/label/w-rootfs   / ufs   rw  1  1
/dev/label/w-tmp  /tmp  ufs   rw  2  2
/dev/label/w-var  /var  ufs   rw  2  2
/dev/label/w-usr  /usr  ufs   rw  2  2
/dev/label/w-home /home ufs   rw  2  2
/dev/label/w-backups  /backups  ufs   rw  2  2

The backup disk:
/dev/label/b-swap none  swap  sw  0  0
/dev/label/b-rootfs   / ufs   rw  1  1
/dev/label/b-tmp  /tmp  ufs   rw  2  2
/dev/label/b-var  /var  ufs   rw  2  2
/dev/label/b-usr  /usr  ufs   rw  2  2
/dev/label/b-home /home ufs   rw  2  2
/dev/label/b-backups  /backups  ufs   rw  2  2

(Note that I sorted the partitions by usage priority.)

The downside is that you would have to keep a difference
between /etc/fstab(w) and /etc/fstab(b). On its own, each
disk will work on any controller (because of proper labels).

Funny question: What happens if a system has access to
two disks with labelled partitions where the labels are
identical?


-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: need C help, passing char buffer[] by-value....

2009-10-19 Thread Polytropon
Just a little and quite formal side note:

On Mon, 19 Oct 2009 11:09:19 -0700, Patrick Mahan ma...@mahan.org wrote:
while (*tp != '\0'  *tp++ != '');

It's often a good choice, especially for increasing readability
of code, to code the empty statement on a line on its own (as
you usually put any statements on an own line for clarity), so
the reader doesn't accidentally take it as and end of command
notification, e. g.

while(1)
;

instead of

while(1);

which could be confused with the syntactical meaning of

whatsthis(1);

I'm just mentioning this because I saw this in a programming
project when I was at university. A young programmer who was
given the task to look at code a very skilled programmer gave
him. Somewhere in the code, an endless loop caused the program
not to work properly. The student could not find this endless
loop because it was coded in the manner as given above. It was
not the polite form of for(;;); :-)




-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Mouse and keyboard don't work in Xorg 7.4

2009-10-19 Thread Polytropon
On Mon, 19 Oct 2009 22:52:24 +0400, Andrey Zhidenkov 
andrey.zhiden...@gmail.com wrote:
 Section ServerFlags
 Option AutoAddDevises off
 ^
AutoAddDevices? :-)




-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: need C help, passing char buffer[] by-value....

2009-10-19 Thread Polytropon
On Mon, 19 Oct 2009 15:21:26 -0700, Gary Kline kl...@thought.org wrote:
 There were no C classes in 1978--I 
   taught myself.  Obviously, not that well because I have already dreaded 
   pointers.  ---Well, usually.

Don't mind. Just imagine my fun when trying to understand how
character string operations work in C - coming from a Turbo Pascal
background where you could compare strings with = and ! :-)
(And this is from me who programmed Assembler before, what
a shame...)



   Your examples help a lot!   Everything works except when there are two 
 or more 
   tags on one line such as:
 
   BODY BGCOLOR=#FF LINK=#00 VLINK=#006633FONT SIZE=4

A solution could be to move artsy HTML stuff (e. g. colors,
font parameters and margins) to CSS in an external file, which
would not be taken into context when investigating markup.




-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Mouse and keyboard don't work in Xorg 7.4

2009-10-19 Thread Polytropon
Allthough X is not an urgent topic to me at the moment
(because I'm still running old X without all the HAL
and DBUS magic), I always interestedly read such threads
in order to keep up to date. On my testing system I just
had the same problem. XFCE 4 started, but mouse didn't
move, no keyboard input. And starting X (startx command)
lasts 20 seconds, that's annoying. :-(


On Tue, 20 Oct 2009 04:13:24 +0200, herbert langhans herbert.raim...@gmx.net 
wrote:
 If you dont need it for another reason, you can compile
 xorg-server without hal (#make config).

The packages of X.org seem to require DBUS and HAL. I am
currently running a testing environment with 8.0-RC1 and
everything from packages (1,7 GHz AMD with 512 MB RAM, so
no compiling joy). 



 Mouse and keyboard works without it too.

I just re-read the chapters on X in the handbook. Setting
a specific keyboard language (german in my case) now involves
messing with XML in the HAL configuration.

I'm just keen to know where I now have to set my mouse in
order to work properly. It's a three-button mouse from Sun.

In the past, all X settings (resolution, mouse, keyboard,
fonts etc.) could be controlled via one centralized file.
Sadly, this seems to be scattered among many subsystems
now...

Another question, especially when running without a xorg.conf
file: Where is the functionality of Option DontZap false
represented? Or is it possible to run X with a partial
xorg.conf file?


 This solved all such problems on my laptop.

I hope it will solve them for me, too, when I revive my
laptop. Seems that I have to do much compiling, bit I will
do that on a different machine (laptop is AMD 500 MHt with
256 MB RAM).



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: IBM Thinkpad 755C and FreeBSD's minimal hardware requirements - still usable?

2009-10-19 Thread Polytropon
On Mon, 19 Oct 2009 13:12:19 +0200, herbert langhans herbert.raim...@gmx.net 
wrote:
 Not a long time ago I got an old Thinkpad 600. With 300MHz and 165MB Ram.
 
 Also the same challenge - small and fast ports for daily work.
 I run X11 with fluxbox (installed without! hal support). 

Of course. Fluxbox is a very lightweight and still appealing
window manager with very usable keyboard functionality. Other
solutions that I would have considered lightweight (but I have
to re-check the facts of today) include WindowMaker and XFCE 3.



 Recommendable ports are: Opera (smaller then Firefox) [...]

Even on my fast machine the preferred browser.



 [...] vim (also gvim) is my text editor - it replaces word
 processing software.

That's what I mostly use LaTeX for.



 Centerim for instant messaging (instead of pidgin).

This seems to be something like CenterICQ (just judging by name).



 Generally all the motif-programs are small and fast.

I'm using things like xpdf (uses OpenMotif) whenever I can.



 Maybe you go for a bigger harddisk? Costs a few bucks and will
 have enough space for BSD 7.2 (what I use) and some of the ports?

I'm not sure if the system will accept it. Recently, I had to buy
a 20 GB disk for my Siemens-Fujitsu Travelmate, because it did not
accept the 40 GB disk I still had (extracted from a dead laptop).



 Compiling your own kernel and cleaning out the kernel source and
 the distfiles of the ports is also a good idea..

But I think it has to be done on a separate machine.

I would imagine that I can at least prepare the hard disk for the
Thinkpad in another machine (e. g. the S-F Travelmate I mentioned).
But I managed to get FreeBSD installed via parallel cable in the
past (plip).

I'm just curious if the audio capabilites of the Thinkpad can be
made working...



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org