Fwd: how access inside from outside when nat is done from inside to outside

2013-04-04 Thread s m
hello guys

i am newbie in nat and have some problem with it.

  i want to nat inside traffic to outside and when i ping outside from
inside, every thing is ok and nat is done perfectly. but when i ping inside
from outside, request packets are sent without any nat translation while
reply packets are nated and therefore outside system can not recognize
reply packets and do not accept them. this is example of packets which are
received in a outside system when pings an inside system.

request packets:   src:192.168.2.1> dst: 192.168.1.1
reply packets:   src: 192.168.2.50> dst:192.168.2.1

is it a correct behavior or not? and if it is correct, it means that when i
configure to nat traffic from inside to outside, i can not access from
outside to inside systems? (in cisco router packets are exactly as mention
above, but outside system identifies reply packets and therefore accepts
them).

please let me know if i am misunderstanding.
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: Fwd: how access inside from outside when nat is done from inside to outside

2013-04-04 Thread Daniel O'Callaghan

On 4/04/2013 6:41 PM, s m wrote:

request packets:   src:192.168.2.1> dst: 192.168.1.1
reply packets:   src: 192.168.2.50> dst:192.168.2.1
This sort of thing tends to happen when the the packets are not being  
sent via divert socket properly.

Look carefully, step by step, at your ipfw rules which send packets to natd.
Also, run natd -v in a separate window instead of running it as a 
daemon, and it will show you the packets which go through natd, and what 
is done with them.


regards,

Danny
___
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"


9.1 panics on a daily basis

2013-04-04 Thread Volodymyr Kostyrko

Hi all.

I have one machine with problems. I changed memory, motherboard, 
interface card with no luck. Yesterday it panics twice.


Apr  3 12:16:50 kohrah kernel: interrupt   total
Apr  3 12:16:50 kohrah kernel: irq1: atkbd0 534
Apr  3 12:16:52 kohrah kernel: irq18: ehci0 uhci5+  324
Apr  3 12:16:52 kohrah kernel: irq19: uhci2 uhci428
Apr  3 12:16:52 kohrah kernel: irq23: ehci1 uhci3   440
Apr  3 12:16:52 kohrah kernel: cpu0:timer  34856866
Apr  3 12:16:52 kohrah kernel: irq256: mpt043020270
Apr  3 12:16:52 kohrah kernel: cpu1:timer  31869627
Apr  3 12:16:52 kohrah kernel: cpu14:timer 29801107
Apr  3 12:16:52 kohrah kernel: cpu15:timer 30408045
Apr  3 12:16:52 kohrah kernel: cpu4:timer  30991098
Apr  3 12:16:52 kohrah kernel: cpu9:timer  30327632
Apr  3 12:16:52 kohrah kernel: cpu5:timer  31701233
Apr  3 12:16:52 kohrah kernel: cpu13:timer 30256850
Apr  3 12:16:52 kohrah kernel: cpu6:timer  41117749
Apr  3 12:16:52 kohrah kernel: cpu8:timer  29618508
Apr  3 12:16:52 kohrah kernel: cpu7:timer  30929776
Apr  3 12:16:52 kohrah kernel: cpu10:timer 29777448
Apr  3 12:16:52 kohrah kernel: cpu2:timer  31031445
Apr  3 12:16:52 kohrah kernel: cpu3:timer  31696197
Apr  3 12:16:52 kohrah kernel: cpu11:timer 30242224
Apr  3 12:16:52 kohrah kernel: cpu12:timer 29757770
Apr  3 12:16:52 kohrah kernel: irq257: igb0:que 0   7307099
Apr  3 12:16:52 kohrah kernel: irq258: igb0:que 1   7062641
Apr  3 12:16:52 kohrah kernel: irq259: igb0:que 2   7051219
Apr  3 12:16:52 kohrah kernel: irq260: igb0:que 3   8521491
Apr  3 12:16:52 kohrah kernel: irq261: igb0:que 4   6945489
Apr  3 12:16:52 kohrah kernel: irq262: igb0:que 5   7006342
Apr  3 12:16:52 kohrah kernel: irq263: igb0:que 6   7005444
Apr  3 12:16:52 kohrah kernel: irq264: igb0:que 7   6983277
Apr  3 12:16:52 kohrah kernel: irq265: igb0:link  6
Apr  3 12:16:52 kohrah kernel: irq266: igb1:que 0 79225
Apr  3 12:16:52 kohrah kernel: irq267: igb1:que 1 79225
Apr  3 12:16:52 kohrah kernel: irq268: igb1:que 2 79225
Apr  3 12:16:52 kohrah kernel: irq269: igb1:que 3 79225
Apr  3 12:16:52 kohrah kernel: irq270: igb1:que 4 79225
Apr  3 12:16:52 kohrah kernel: irq271: igb1:que 5 79224
Apr  3 12:16:52 kohrah kernel: irq272: igb1:que 6 79225
Apr  3 12:16:52 kohrah kernel: irq273: igb1:que 7 79225
Apr  3 12:16:52 kohrah kernel: irq274: igb1:link  1
Apr  3 12:16:52 kohrah kernel: Total   605922398
Apr  3 12:16:52 kohrah kernel: KDB: stack backtrace:
Apr  3 12:16:52 kohrah kernel: #0 0x803944f0 at kdb_backtrace+0x60
Apr  3 12:16:52 kohrah kernel: #1 0x8031821b at watchdog_fire+0x8b
Apr  3 12:16:52 kohrah kernel: #2 0x80318526 at hardclock_cnt+0x2e6
Apr  3 12:16:52 kohrah kernel: #3 0x80596079 at handleevents+0x129
Apr  3 12:16:52 kohrah kernel: #4 0x80596c00 at timercb+0x2a0
Apr  3 12:16:52 kohrah kernel: #5 0x805c3bac at 
lapic_handle_timer+0x9c

Apr  3 12:16:52 kohrah kernel: #6 0x8056aaec at Xtimerint+0x8c
Apr  3 12:16:52 kohrah kernel: #7 0x80eb5ef7 at 
kcs_wait_for_obf+0x87

Apr  3 12:16:52 kohrah kernel: #8 0x80eb6455 at kcs_read_byte+0x45
Apr  3 12:16:52 kohrah kernel: #9 0x80eb5fab at kcs_loop+0x7b
Apr  3 12:16:52 kohrah kernel: #10 0x803355f5 at fork_exit+0x75
Apr  3 12:16:52 kohrah kernel: #11 0x8056a4ce at fork_trampoline+0xe

Apr  3 18:30:54 kohrah kernel: interrupt   total
Apr  3 18:30:54 kohrah kernel: irq18: ehci0 uhci5+  324
Apr  3 18:30:56 kohrah kernel: irq19: uhci2 uhci426
Apr  3 18:30:56 kohrah kernel: irq23: ehci1 uhci3   440
Apr  3 18:30:56 kohrah kernel: cpu0:timer   6820267
Apr  3 18:30:56 kohrah kernel: irq256: mpt0 4610726
Apr  3 18:30:56 kohrah kernel: cpu1:timer   5915601
Apr  3 18:30:56 kohrah kernel: cpu9:timer   5549735
Apr  3 18:30:56 kohrah kernel: cpu6:timer   6674702
Apr  3 18:30:56 kohrah kernel: cpu15:timer  5569165
Apr  3 18:30:56 kohrah kernel: cpu7:timer   5798112
Apr  3 18:30:56 kohrah kernel: cpu11:timer  5550018
Apr  3 18:30:56 kohrah kernel: cpu3:timer   5800384
Apr  3 18:30:56 kohrah kernel: cpu13:timer

OT: posix sh problem

2013-04-04 Thread Mark Felder

Hi all,

Hopefully someone here is much more clever than I am. I've run out of  
ideas on how to cleanly convert this chunk of ksh to posix sh. This is  
from a BB/Hobbit/Xymon monitoring script for ZFS. I'd really like to have  
this working cleanly on FreeBSD without requiring any funky shells or  
using any temporary files.


The following is supposed to be able to loop through the output of  
multiple zpools reading one line at a time and each line item is set as a  
variable:



/sbin/zpool list -H | while read name size used avail cap dedup health  
altroot

do
  # do interesting things here
done

Unfortunately you can't pipe through read in posix sh. You also can't use  
process substitution: while read var1 var1 < <(/sbin/zpool list -H)



Any ideas are greatly appreciated. I know there's a python-based script  
floating on github but I cant guarantee every server will have python on  
it...





Source of script is here:  
http://en.wikibooks.org/wiki/System_Monitoring_with_Xymon/Other_Docs/HOWTO#Hobbit_Client_and_ZFS_monitoring

___
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: OT: posix sh problem

2013-04-04 Thread Quartz

I'd really like to
have this working cleanly on FreeBSD without requiring any funky shells


Define "funky shell". Does it have to be straight up plain sh? Can it 
use csh or tcsh syntax? Does bash count as 'funky'?




or using any temporary files.


Do you mean "manually created temp files"? because some of the different 
ways of doing process substitution and redirection will automatically 
create temp files for you in the background and fail on an unwritable 
filesystem.


__
it has a certain smooth-brained appeal
___
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: OT: posix sh problem

2013-04-04 Thread Mark Felder

On Thu, 04 Apr 2013 07:47:09 -0500, Quartz  wrote:


I'd really like to
have this working cleanly on FreeBSD without requiring any funky shells


Define "funky shell". Does it have to be straight up plain sh? Can it  
use csh or tcsh syntax? Does bash count as 'funky'?




Any shells not in the FreeBSD base system, basically. I don't want this  
script to stop working because someone somehow broke bash or zsh and  
nobody noticed because nobody ever uses it.





or using any temporary files.


Do you mean "manually created temp files"? because some of the different  
ways of doing process substitution and redirection will automatically  
create temp files for you in the background and fail on an unwritable  
filesystem.




Yes, I mean manually created temp files. It looks pretty ugly to >  
/tmp/foo and read from it a line later :)

___
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: OT: posix sh problem

2013-04-04 Thread Quartz



fail on an unwritable
filesystem.


...By which I mean you can't create new files because your disk is 
completely full or you're booting from a ramdisk that's messed up, etc.


__
it has a certain smooth-brained appeal
___
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: OT: posix sh problem

2013-04-04 Thread Nikos Vassiliadis

On 4/4/2013 3:32 μμ, Mark Felder wrote:

Hi all,

Hopefully someone here is much more clever than I am. I've run out of
ideas on how to cleanly convert this chunk of ksh to posix sh. This is
from a BB/Hobbit/Xymon monitoring script for ZFS. I'd really like to
have this working cleanly on FreeBSD without requiring any funky shells
or using any temporary files.

The following is supposed to be able to loop through the output of
multiple zpools reading one line at a time and each line item is set as
a variable:


/sbin/zpool list -H | while read name size used avail cap dedup health
altroot
do
   # do interesting things here
done

Unfortunately you can't pipe through read in posix sh.


I am not sure about posix compliance but I haven't seen a bourne-like
shell not supporting the "prog | while read a b c ..." syntax.
FreeBSD's /bin/sh supports this.

Did you mean something else, did I
misunderstand your question?

Nikos

___
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: OT: posix sh problem

2013-04-04 Thread Teske, Devin

On Apr 4, 2013, at 5:32 AM, Mark Felder wrote:

> Hi all,
> 
> Hopefully someone here is much more clever than I am. I've run out of ideas 
> on how to cleanly convert this chunk of ksh to posix sh.

/me takes the challenge (and shame on some of the current responses; this is 
trivial in sh and there's actually nothing wrong with the OPs code -- it works)


> This is from a BB/Hobbit/Xymon monitoring script for ZFS. I'd really like to 
> have this working cleanly on FreeBSD without requiring any funky shells or 
> using any temporary files.
> 

Cool! After I help you fix whatever the issue is, I'd be interested in this a 
little more. ZFS monitoring would be nice.


> The following is supposed to be able to loop through the output of multiple 
> zpools reading one line at a time and each line item is set as a variable:
> 
> 
> /sbin/zpool list -H | while read name size used avail cap dedup health altroot
> do
>  # do interesting things here
> done
> 
> Unfortunately you can't pipe through read in posix sh.

Wait, you can't? Then I've been doing something wrong all these years…

#!/bin/sh
printf "line1\nline2\n" | while read line
do
echo "line=[$line]"
done

===

dte...@scribe9.vicor.com ~ $ sh bar
line=[line1]
line=[line2]

===

Just a side note, on my "zpool list -H" on my 8.1-R system doesn't provide the 
"dedup" column, so your mileage may vary (you may have to adjust the script to 
account for that on systems like mine).

Aside from that, I took your script as-is, copy/paste and it worked fine on 
8.1-RELEASE-p6:

dte...@oos0a.lbxrich.vicor.com ~ $ cat bar
#!/bin/sh
/sbin/zpool list -H | while read name size used avail cap dedup health altroot
do
 echo $name
done
dte...@oos0a.lbxrich.vicor.com ~ $ sh bar
NEC1-RAID6-ARRAY1
NEC1-RAID6-ARRAY2
NEC1-RAID6-ARRAY3



> You also can't use process substitution: while read var1 var1 < <(/sbin/zpool 
> list -H)
> 

I'll admit that one's unsupported.


> Any ideas are greatly appreciated. I know there's a python-based script 
> floating on github but I cant guarantee every server will have python on it…
> 

Stick to /bin/sh if you can (like you say, portability and potability in using 
base utilities).



> Source of script is here: 
> http://en.wikibooks.org/wiki/System_Monitoring_with_Xymon/Other_Docs/HOWTO#Hobbit_Client_and_ZFS_monitoring

The only things I saw that needed changing to go from ksh to /bin/sh were:

if [ … == … ]; then

Needs to be

if [ … = … ]; then

And optionally, a style nit would be to convert back-tick pairs into nestable 
$(…) syntax. For example, change:

cap=`…`

to instead:

cap=$(…)

Oh and of course, the HTML should go away since you're making a command-line 
tool and not a BB/Hobbit/Xymon module.
-- 
Devin

_
The information contained in this message is proprietary and/or confidential. 
If you are not the intended recipient, please: (i) delete the message and all 
copies; (ii) do not disclose, distribute or use the message in any manner; and 
(iii) notify the sender immediately. In addition, please be aware that any 
message addressed to our domain is subject to archiving and review by persons 
other than the intended recipient. Thank you.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: OT: posix sh problem

2013-04-04 Thread Mark Felder
On Thu, 04 Apr 2013 08:54:30 -0500, Teske, Devin  
 wrote:



Wait, you can't? Then I've been doing something wrong all these years…
#!/bin/sh
printf "line1\nline2\n" | while read line
do
echo "line=[$line]"
done


You sort-of can, but it's not portable at all. As detailed here:  
http://www.etalabs.net/sh_tricks.html


One common pitfall is trying to read output piped from commands, such  
as:

foo | IFS= read var
POSIX allows any or all commands in a pipeline to be run in subshells, 
and which command (if any) runs in the main shell varies greatly between 
implementations — in particular Bash and ksh differ here. The standard 
idiom for overcoming this problem is to use a here document:


IFS= read var << EOF
$(foo)
EOF



I was having problems with the variables magically becoming empty,  
remembered I had Rich's site bookmarked, checked to see if it mentioned  
and it was. I'll admit there's a high chance that due to lack of sleep  
user error was the culprit.

___
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] recover destroyed zpool - what are the available options?

2013-04-04 Thread Mark

 
 Original Message 
From: Beeblebrox 
To: freebsd-questions@freebsd.org
Sent: Wed, April 3, 2013 10:50:55 AM
Subject: Re: [ZFS] recover destroyed zpool - what are the available options?

Volodymyr, thank you very much for answering.

A strange problem is that ZFS thinks the pool is on-line:
# zpool list
NAMESIZE  ALLOC   FREECAP  DEDUP  HEALTH  ALTROOT
bsdr   -  -  -  -  -  FAULTED  -

So when I try to import, it objects. I can think of 2 things to do:
a- export the pool first, then re-import
b- Disconnect the original hdd / create pool bsdr on another hdd@s small gpt
partition / re-connect the original hdd / somehow force the import or add
the original pool to the newly created bsdr pool, and maybe the original
data will come back on line??

What would you suggest?  Thanks again.


What does "gpart show" return?

Are all the pool members there and working?

My guess is that one member is missing or a mbr is bad.

I have used the zfs import function with good results.


--
View this message in context: 
http://freebsd.1045724.n5.nabble.com/ZFS-recover-destroyed-zpool-what-are-the-available-options-tp5800299p5801356.html

Sent from the freebsd-questions mailing list archive at Nabble.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"

___
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: OT: posix sh problem

2013-04-04 Thread Teske, Devin

On Apr 4, 2013, at 7:42 AM, Mark Felder wrote:

> On Thu, 04 Apr 2013 08:54:30 -0500, Teske, Devin  
> wrote:
> 
>> Wait, you can't? Then I've been doing something wrong all these years…
>> #!/bin/sh
>> printf "line1\nline2\n" | while read line
>> do
>>  echo "line=[$line]"
>> done
> 
> You sort-of can, but it's not portable at all. As detailed here: 
> http://www.etalabs.net/sh_tricks.html
> 
>>> One common pitfall is trying to read output piped from commands, such as:
>>> foo | IFS= read var
>>> POSIX allows any or all commands in a pipeline to be run in subshells,

And for most purposes that's fine. Read-on…


>>> and which command (if any) runs in the main shell varies greatly 
>>> betweenimplementations

… that is only if you truly need the variables to be read into the main shell. 
This is most always not what you want.

The page you linked about doesn't talk about the special case of "while", in 
example:

foo | IFS= while read var

On the back-end nothing changes (the same caveat applies -- variables set on 
the right side of the pipe may not be available to the main shell; as-per the 
quoted text). However, the high-level task changes from:

I want to read some text from a pipe into some variables

to instead:

I want to read some text from a pipe and process it word-by-word (in 
your case) and act on the words in a loop

So in other words… the only reason for wanting the variables in the main shell 
is if you want to act on the last set of variables for the last line after the 
loop has run (and presumably already processed the last line). This is what I 
am saying anyone will rarely ever want. In other words, once the loop 
(potentially running in a sub-shell) has completed, you likely don't care about 
the variable contents and are willing to throw them away anyhow.



>>> — in particular Bash and ksh differ here. The standardidiom for overcoming 
>>> this problem is to use a here document:
>>> 
>>> IFS= read var << EOF
>>> $(foo)
>>> EOF
> 

But you're not processing a single line; you're processing the entire input 
at-once and performing an action (writing to the screen) that also doesn't care 
whether it's in a sub-shell or not.

SO…

I say rock-on with the original syntax. It's portable. You don't need those 
vars when the loop ends.

> 
> I was having problems with the variables magically becoming empty, remembered 
> I had Rich's site bookmarked, checked to see if it mentioned and it was. I'll 
> admit there's a high chance that due to lack of sleep user error was the 
> culprit.

I'm interested in why you need the variables after the loop has completed. Put 
your code in the loop where the variables are defined and have values.
-- 
Devin

_
The information contained in this message is proprietary and/or confidential. 
If you are not the intended recipient, please: (i) delete the message and all 
copies; (ii) do not disclose, distribute or use the message in any manner; and 
(iii) notify the sender immediately. In addition, please be aware that any 
message addressed to our domain is subject to archiving and review by persons 
other than the intended recipient. Thank you.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: OT: posix sh problem

2013-04-04 Thread Teske, Devin
Oh, and just to cover all bases…

If you suspect you have sub-shells in the loop, use "export" to export the vars 
so that the sub-shells get the vars in the loop.
-- 
Devin


On Apr 4, 2013, at 8:04 AM, Teske, Devin wrote:

> 
> On Apr 4, 2013, at 7:42 AM, Mark Felder wrote:
> 
>> On Thu, 04 Apr 2013 08:54:30 -0500, Teske, Devin  
>> wrote:
>> 
>>> Wait, you can't? Then I've been doing something wrong all these years…
>>> #!/bin/sh
>>> printf "line1\nline2\n" | while read line
>>> do
>>> echo "line=[$line]"
>>> done
>> 
>> You sort-of can, but it's not portable at all. As detailed here: 
>> http://www.etalabs.net/sh_tricks.html
>> 
 One common pitfall is trying to read output piped from commands, such as:
 foo | IFS= read var
 POSIX allows any or all commands in a pipeline to be run in subshells,
> 
> And for most purposes that's fine. Read-on…
> 
> 
 and which command (if any) runs in the main shell varies greatly 
 betweenimplementations
> 
> … that is only if you truly need the variables to be read into the main 
> shell. This is most always not what you want.
> 
> The page you linked about doesn't talk about the special case of "while", in 
> example:
> 
>   foo | IFS= while read var
> 
> On the back-end nothing changes (the same caveat applies -- variables set on 
> the right side of the pipe may not be available to the main shell; as-per the 
> quoted text). However, the high-level task changes from:
> 
>   I want to read some text from a pipe into some variables
> 
> to instead:
> 
>   I want to read some text from a pipe and process it word-by-word (in 
> your case) and act on the words in a loop
> 
> So in other words… the only reason for wanting the variables in the main 
> shell is if you want to act on the last set of variables for the last line 
> after the loop has run (and presumably already processed the last line). This 
> is what I am saying anyone will rarely ever want. In other words, once the 
> loop (potentially running in a sub-shell) has completed, you likely don't 
> care about the variable contents and are willing to throw them away anyhow.
> 
> 
> 
 — in particular Bash and ksh differ here. The standardidiom for overcoming 
 this problem is to use a here document:
 
 IFS= read var << EOF
 $(foo)
 EOF
>> 
> 
> But you're not processing a single line; you're processing the entire input 
> at-once and performing an action (writing to the screen) that also doesn't 
> care whether it's in a sub-shell or not.
> 
> SO…
> 
> I say rock-on with the original syntax. It's portable. You don't need those 
> vars when the loop ends.
> 
>> 
>> I was having problems with the variables magically becoming empty, 
>> remembered I had Rich's site bookmarked, checked to see if it mentioned and 
>> it was. I'll admit there's a high chance that due to lack of sleep user 
>> error was the culprit.
> 
> I'm interested in why you need the variables after the loop has completed. 
> Put your code in the loop where the variables are defined and have values.
> -- 
> Devin
> 
> _
> The information contained in this message is proprietary and/or confidential. 
> If you are not the intended recipient, please: (i) delete the message and all 
> copies; (ii) do not disclose, distribute or use the message in any manner; 
> and (iii) notify the sender immediately. In addition, please be aware that 
> any message addressed to our domain is subject to archiving and review by 
> persons other than the intended recipient. Thank you.

_
The information contained in this message is proprietary and/or confidential. 
If you are not the intended recipient, please: (i) delete the message and all 
copies; (ii) do not disclose, distribute or use the message in any manner; and 
(iii) notify the sender immediately. In addition, please be aware that any 
message addressed to our domain is subject to archiving and review by persons 
other than the intended recipient. Thank you.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: OT: posix sh problem

2013-04-04 Thread Mark Felder
Sorry, my email client did something weird with collapsing and I didn't  
see you mention that it appeared to be working for you.


On Thu, 04 Apr 2013 08:54:30 -0500, Teske, Devin  
 wrote:


The only things I saw that needed changing to go from ksh to /bin/sh  
were:

if [ … == … ]; then
Needs to be
if [ … = … ]; then
And optionally, a style nit would be to convert back-tick pairs into  
nestable $(…) syntax. For example, change:

cap=`…`
to instead:
cap=$(…)
Oh and of course, the HTML should go away since you're making a  
command-line tool and not a BB/Hobbit/Xymon module.


I actually will be using this with Xymon at work. I did fix the == and  
style nit when I went over this script I'm still having a problem. When I  
started debugging this last night $STRING led me to believe the pipe into  
read wasn't working right. At the bottom of the script I added echo in  
front of the "$BB $BBDISP" line. My output is this:


# sh zfs_xymon.sh
status .zfs green Thu Apr  4 09:59:36 CDT 2013 zfs - health: okay -  
capacity: okay Zpool  
NameStatusCapacity all pools  
are healthy


Where are the other parts of the table showing each zpool? Those are just  
the headers. If you sh -x you'll see it flow like this:


+ read name size used avail cap depup health altroot
+ STRING='Zpool  
NameStatusCapacity '

+ /sbin/zpool status -xv

It's like everything between do ... done never happened? If you put echo  
in front of line 60 you DO get output:


# sh zfs_xymon.sh
STRING=Zpool  
NameStatusCapacity  
&greentankONLINE48
status .zfs green Thu Apr  4 10:07:30 CDT 2013 zfs - health: okay -  
capacity: okay Zpool  
NameStatusCapacity all pools  
are healthy


But as you can see, everything in that do ... done is disappearing.  
According to Rich's Posix sh tricks site it explains that the things to  
the right of that pipe are completed in a subprocess. The updates it makes  
to STRING never make it out so it can be used in the rest of the script.


Do you see what I mean now? :(
___
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] recover destroyed zpool - what are the available options?

2013-04-04 Thread Volodymyr Kostyrko

04.04.2013 08:08, Beeblebrox пишет:

I had a second pool on another partition of the same HDD, which was in the
same degraded state as the bsdr pool. The data on that pool had been
backed-up previously. I decided to try the export & re-import method on that
pool (-Z gives message: invalid option 'Z'). Result:


Sorry, that was -X aka extreme_rewind.


# zpool export oldpool
# zpool import -D -f -R /mnt -N -F -n  oldpool
Now the pool just disappears.
# zpool list -> does not show oldpool
# zpool import ->  no pools available to import

So the export & re-import method is NOT the way to do this.


Option -D was intended only for deleted pools, not exported ones.

Try `zpool list -D` or `zpool import -D`.

--
Sphinx of black quartz, judge my vow.
___
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] recover destroyed zpool - what are the available options?

2013-04-04 Thread Beeblebrox
Hi Mark.

>>What does "gpart show" return?
=>   34  625142381  ada0  GPT  (298G)
34   62914560 1  freebsd-zfs  (30G)
62914594  562227821 2  freebsd-zfs  (268G)

>>Are all the pool members there and working?
Yes - ada0p2 is the ONLY pool member.

>>My guess is that one member is missing or a mbr is bad.
After 'zpool destroy', I also deleted the partition before realising my
mistake, I tried to recover the partition table with testdisk, but this was
not successful. Next I created a new GPT table and the 2 partitions at the
original size as I recalled them - so ada0p1 and ada0p2 have been
re-created.

I just realized a problem: gpart show -r =>
62914594  562227821 2  516e7cba-6ecf-11d6-8ff8-00022d09712b  (268G)
The guid (?) that ZFS is looking for is most likely wrong. I need to find
the ID that ZFS is looking for and change the ID of ada0p2 to that number -
am I correct?

Thanks.




--
View this message in context: 
http://freebsd.1045724.n5.nabble.com/ZFS-recover-destroyed-zpool-what-are-the-available-options-tp5800299p5801568.html
Sent from the freebsd-questions mailing list archive at Nabble.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: [ZFS] recover destroyed zpool - what are the available options?

2013-04-04 Thread Volodymyr Kostyrko

2013-04-04 18:50, Beeblebrox wrote:

Hi Mark.


What does "gpart show" return?

=>   34  625142381  ada0  GPT  (298G)
34   62914560 1  freebsd-zfs  (30G)
62914594  562227821 2  freebsd-zfs  (268G)


Are all the pool members there and working?

Yes - ada0p2 is the ONLY pool member.


My guess is that one member is missing or a mbr is bad.

After 'zpool destroy', I also deleted the partition before realising my
mistake, I tried to recover the partition table with testdisk, but this was
not successful. Next I created a new GPT table and the 2 partitions at the
original size as I recalled them - so ada0p1 and ada0p2 have been
re-created.

I just realized a problem: gpart show -r =>
62914594  562227821 2  516e7cba-6ecf-11d6-8ff8-00022d09712b  (268G)
The guid (?) that ZFS is looking for is most likely wrong. I need to find
the ID that ZFS is looking for and change the ID of ada0p2 to that number -
am I correct?


ZFS operates on metadata. If ZFS can clearly see one side of the 
partition it would see it all, you can try reconstruct partitions taking 
in account data obtained from zdb. And again - when you obtained correct 
zdb data ZFS was available. Maybe or maybe the slice was too small...


Oh hey, you uzed `zdb -C`, testing what local machine knows about the 
pool. When recreating partitions test them with `zdb -l device`. When 
the output would be correct - you guessed your slice!


--
Sphinx of black quartz, judge my vow.
___
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] recover destroyed zpool - what are the available options?

2013-04-04 Thread Beeblebrox
Thanks Volodymyr.

The pools do not show up as deleted.
# zpool list (the pool that had disappeared has returned)
NAME   SIZE  ALLOC   FREECAP  DEDUP  HEALTH  ALTROOT
asp   -  -  -  -  -  FAULTED  -
bsdr  -  -  -  -  -  FAULTED  -
bsds  48.8G  12.9G  35.8G26%  1.25x  ONLINE  -

# zpool import
no pools available to import

# zpool import -D
   pool: bsdr
 id: 12018916494219117471
  state: UNAVAIL (DESTROYED)
 status: One or more devices are missing from the system.
 action: The pool cannot be imported. Attach the missing
devices and try again.
config:   bsdrUNAVAIL  insufficient replicas
  *17860002997423999070*  UNAVAIL  cannot open

   pool: bsdr
 id: 16018525702691588432
  state: UNAVAIL (DESTROYED)
 status: One or more devices are missing from the system.
 action: The pool cannot be imported. Attach the missing
devices and try again.
 config:   bsdr   UNAVAIL  insufficient replicas
  5853256800575798014  UNAVAIL  cannot open

# zpool status -v bsdr
  pool: bsdr
 state: UNAVAIL
status: One or more devices could not be opened.  There are insufficient
replicas for the pool to continue functioning.
action: Attach the missing device and online it using 'zpool online'.
config: NAMESTATE READ WRITE CKSUM
bsdrUNAVAIL  0 0 0
  *12606749387939346898*  UNAVAIL  0 0 0  was /dev/ada0p2

Form my post #2 you can check that ZDB record has 2 GUIDs:
guid: *17852168552651762162*  and  guid: *12606749387939346898* 

Thank You.



--
View this message in context: 
http://freebsd.1045724.n5.nabble.com/ZFS-recover-destroyed-zpool-what-are-the-available-options-tp5800299p5801581.html
Sent from the freebsd-questions mailing list archive at Nabble.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: OT: posix sh problem

2013-04-04 Thread Teske, Devin

On Apr 4, 2013, at 8:11 AM, Mark Felder wrote:

> Sorry, my email client did something weird with collapsing and I didn't see 
> you mention that it appeared to be working for you.
> 
> On Thu, 04 Apr 2013 08:54:30 -0500, Teske, Devin  
> wrote:
> 
>> The only things I saw that needed changing to go from ksh to /bin/sh were:
>>  if [ … == … ]; then
>> Needs to be
>>  if [ … = … ]; then
>> And optionally, a style nit would be to convert back-tick pairs into 
>> nestable $(…) syntax. For example, change:
>>  cap=`…`
>> to instead:
>>  cap=$(…)
>> Oh and of course, the HTML should go away since you're making a command-line 
>> tool and not a BB/Hobbit/Xymon module.
> 
> I actually will be using this with Xymon at work. I did fix the == and style 
> nit when I went over this script I'm still having a problem.

No worries…


> When I started debugging this last night $STRING led me to believe the pipe 
> into read wasn't working right. At the bottom of the script I added echo in 
> front of the "$BB $BBDISP" line.

Ok, going back to the original script, I see the error.

Yes… you're right, you can't modify a string from the rvalue of a pipe; simply 
put.


[snip]

> Do you see what I mean now? :(

Yes, I do.

Here's what I suggest (the following works for me -- lists all my pools and 
shows healthy):

--- bar.orig2013-04-04 09:05:27.0 -0700
+++ bar 2013-04-04 09:14:37.0 -0700
@@ -1,4 +1,5 @@
-#!/bin/ksh
+#!/bin/sh
+BB=echo MACHINE=$(hostname)
 # Revision History: 
 # 1. Mike Rowell , original
 # 2. Uwe Kirbach 
@@ -22,19 +23,20 @@ STRING="<
 # mypool  33.8G   84.5K   33.7G   0%  ONLINE  -
 # bash-3.00#
  
-/usr/sbin/zpool list -H | while read name size used avail cap health altroot
+STRING="$STRING$(
+/sbin/zpool list -H | while read name size used avail cap health altroot
 do
   LINE_COLOR="green"
  
-  if [ "${health}" == "ONLINE" ]; then
+  if [ "${health}" = "ONLINE" ]; then
 HEALTH_COLOR="green"
-  elif [ "${health}" == "DEGRADED" ]; then
+  elif [ "${health}" = "DEGRADED" ]; then
 HEALTH_COLOR="yellow"
-  elif [ "${health}" == "FAULTED" ]; then
+  elif [ "${health}" = "FAULTED" ]; then
 HEALTH_COLOR="red"
   fi 
  
-  cap=`echo ${cap} | cut -d% -f1` 
+  cap=$(echo ${cap} | cut -d% -f1) 
   if [ ${cap} -lt $DISKYELL ]; then
 CAP_COLOR="green" 
   elif [ ${cap} -gt $DISKYELL ]; then 
@@ -43,7 +45,7 @@ do
 CAP_COLOR="red"
   fi
  
-  if [ "$HEALTH_COLOR" == "red" -o "$HEALTH_COLOR" == "yellow" -o "$CAP_COLOR" 
== "red" -o "$CAP_COLOR" == "yellow" ]; then
+  if [ "$HEALTH_COLOR" = "red" -o "$HEALTH_COLOR" = "yellow" -o "$CAP_COLOR" = 
"red" -o "$CAP_COLOR" = "yellow" ]; then
 DISPCOLOR=$COLOR
 LINE_COLOR=$COLOR
   fi
@@ -58,13 +60,14 @@ do
 yellow) FIRST_LINE_CAP="nearly full" ;;
   esac
  
-  STRING="$STRING 
&${LINE_COLOR}${name}${health}${cap}"
+  echo 
"&${LINE_COLOR}${name}${health}${cap}"
 done
+)"
  
 # What: accumulate the bb message strings.
 STRING="$STRING "
-STRING="$STRING`/usr/sbin/zpool status -xv`"
+STRING="$STRING$(/sbin/zpool status -xv)"
 FIRST_LINE="zfs - health: $FIRST_LINE_HEALTH - capacity: $FIRST_LINE_CAP"
  
 # What: Sent out the final bb message to hobbit server.
-$BB $BBDISP "status $MACHINE.$TEST $DISPCOLOR `date` $FIRST_LINE $STRING"
+$BB $BBDISP "status $MACHINE.$TEST $DISPCOLOR $(date) $FIRST_LINE $STRING"

-- 
Devin

_
The information contained in this message is proprietary and/or confidential. 
If you are not the intended recipient, please: (i) delete the message and all 
copies; (ii) do not disclose, distribute or use the message in any manner; and 
(iii) notify the sender immediately. In addition, please be aware that any 
message addressed to our domain is subject to archiving and review by persons 
other than the intended recipient. Thank you.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


[ZFS] recover destroyed zpool - what are the available options?

2013-04-04 Thread Beeblebrox
>>test them with `zdb -l device`. When the output would be correct - you
guessed your slice! 

LABEL 1

version: 28
name: 'bsdr'
state: 2
txg: 10
pool_guid: 12018916494219117471
hostid: 2193536600
hostname: 'mfsbsd'
top_guid: 17860002997423999070
guid: 17860002997423999070
vdev_children: 1
vdev_tree:
type: 'disk'
id: 0
guid: 17860002997423999070
path: '/dev/ad6p2'
phys_path: '/dev/ad6p2'
whole_disk: 1
metaslab_array: 30
metaslab_shift: 31
ashift: 9
asize: 287855869952
is_log: 0
create_txg: 4

Do you mean that in this case 'asize 287855869952' is what I should look at?
But 287855869952 /1024 /1024 /2 => 137.260GB is far smaller than I recall
the geom part to be...



--
View this message in context: 
http://freebsd.1045724.n5.nabble.com/ZFS-recover-destroyed-zpool-what-are-the-available-options-tp5800299p5801588.html
Sent from the freebsd-questions mailing list archive at Nabble.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: OT: posix sh problem

2013-04-04 Thread Mark Felder
On Thu, 04 Apr 2013 11:16:11 -0500, Teske, Devin  
 wrote:


Here's what I suggest (the following works for me -- lists all my pools  
and shows healthy):


Fantastic! I'd have never considered wrapping the entire thing into  
STRING="$STRING$()".


I can't tell you how much I appreciate your assistance with making this  
functional.


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


Re: Recipie for CPU souffle'

2013-04-04 Thread Ian Smith
In freebsd-questions Digest, Vol 461, Issue 6, Message: 1
(sorry about the threading)
On Wed, 3 Apr 2013 15:12:17 +0200 Polytropon  wrote:
 > On Tue, 02 Apr 2013 19:10:59 -0700, Ronald F. Guilmette wrote:
 > > See how the entire ioctl() interface for these device types is completely
 > > documented IN THE MAN PAGE?  That's the way it should be... None of this
 > > rooting around in the sources for something that should have been 
 > > documented
 > > properly, external to the kernel sources.
 > 
 > I agree that especially to developers, that sounds logical
 > and very helpful. Seems that manpages do not aim for that
 > goal anymore...

Well I can't help but feel this is being taken a tad more seriously than 
speaker(4) deserves - but it was first committed to FreeBSD 1.0 in '93, 
19 years and 9 months ago in what is now SVN revision 4 (!), originally 
written by Eric Raymond in '90 then modified by ache(@) from "386bsd 
only clean version, all SYSV stuff removed", suggesting more ancient 
origins.  So I'm not sure this doesn't rather predate 'anymore' :)

One's referred to the source in /sys/dev/speaker/speaker.h (a few lines) 
and it's not a long jump to peek at /sys/dev/speaker/spkr.c

http://svnweb.freebsd.org/base/head/sys/dev/speaker/spkr.c?annotate=4

This original one is easier to follow at the bare metal level, with 
direct inb() and outb() to the PIT (i8254) timer #2, functions later 
moved into clock.c, making one have to refer to all of 4 source files 
for the 'machine independent' modern version, though I wonder if anyone 
not on x86/pc98 is/was actually using spkr(4)?

With r177648 5 years ago, phk@ said "If somebody cleaned this code up to 
proper style(9), it could become a great educational starting point for 
aspiring kernel hackers."  2 months later: "Move speaker a lot closer to 
style(9)".  It was one of the first devices I could follow, at any rate.

 > > It doesn't have to cover "everything".  But it _should_ completely describe
 > > the programatic interface.
 > 
 > At least is leaves questions, like stating "use the syscalls
 > in order to...", and the reader is left with the most obvious
 > question: _which_ syscalls?

Sometimes examples are the best teachers.  spkrtest(8) is just a sh 
script that writes to the device.  For more sophisticated use (!) spkr.c 
is overcommented, if anything, and it's only ~550 well-spaced lines.

 > > But like I said, somewher along the line, a lot of man page writers
 > > apparently got lazy... VERY lazy.

Mmm, and a few man page readers too?  It's really not rocket science ..

 > But keep in mind they're still alive! Judging from the manpages
 > of... *cough* can I say this? YOu know, more prominent open
 > source operating systems for desktops... they're usually much
 > worse _if_ there is a manpage. In most cases, there's none.

True.  And I can usually get little more sense out of info(1) than from 
windows 'troubleshooter' :)

 > > >> Second order question:  Why can't I just pipe a .wav file to the
 > > >> /dev/speaker device file and have it play?  Wouldn't that make quite
 > > >> a lot of sense?
 > > >
 > > >No, that does not work.
 > > 
 > > Apparently not.
 > > 
 > > Why it doesn't work (or couldn't work) is less clear.
 > 
 > The speaker interface to the _PC speaker_ is not a DSP. It's
 > programming is much simpler. The "note language" that it
 > uses on FreeBSD is much more than other interfaces offer.
 > Better ones have stuff like pitch, duration, turn off.

Not to mention staccato, legato, dotted notes - sophisticated stuff!

[..]

 > > >  % echo "c" > /dev/speaker
 > > 
 > > Humm... now _that_ is both interesting and enlightening.
 > 
 > I actually remember having used something comparable on
 > BASIC, when my brain wasn't fully developed yet. :-)

The note language is _from_ BASIC .. do read the source, Luke(s)!

 >  echo "cdefgab>c" > /dev/speaker
 > 
 > It's still a nice interface to "generate attention sounds"
 > in case you want to make an audible alarm or signal for
 > some specific action, like a program which has aborted,
 > an unverified backup or the successful completition of
 > a task.

Indeed it is.  On an old laptop using APM I used to play little tunes as 
the battery got down to 30, 20, 10%, noiser just before forced suspend,
which saved me not a few times.  A nice little chirp when fully charged.

[..]

 > > >> I wonder if whoever write and distributed this realized that he/she 
 > > >> could
 > > >> be sued for copyright infringement for about 5 of the simple tunes that 
 > > >> are
 > > >> embedded in that thing.  Sad but true.
 > > >> :-(

I hope noone's losing too much sleep, after ~20 uneventful years :)

cheers, Ian
___
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"


State of Packages

2013-04-04 Thread doug

Its seems certain that pkg_add is not [going to] be[ing] restored.

Index of ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/9.1-RELEASE/

NameSizeLast Modified
File:MANIFEST   1 KB12/04/12 10:10:00
File:base.txz   58452 KB12/04/12 10:09:00
File:doc.txz1410 KB 12/04/12 10:10:00
File:games.txz  1092 KB 12/04/12 10:10:00
File:kernel.txz 56686 KB12/04/12 10:10:00
File:lib32.txz  9516 KB 12/04/12 10:10:00
File:ports.txz  85867 KB12/04/12 10:10:00
File:src.txz94190 KB12/04/12 10:10:00

This pretty much invalidates 5.4 of the handbook.

My questions: Does/will pkgng work? Are 9.1 packages on the ISO images? I am in 
the progess of answering that one for myself but had some time on my hands 
during the download :)


_
Douglas Denault
http://www.safeport.com
d...@safeport.com
Voice: 301-217-9220
  Fax: 301-217-9277
___
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: Recipie for CPU souffle'

2013-04-04 Thread Polytropon
On Fri, 5 Apr 2013 05:23:31 +1100 (EST), Ian Smith wrote:
> In freebsd-questions Digest, Vol 461, Issue 6, Message: 1
> (sorry about the threading)
> On Wed, 3 Apr 2013 15:12:17 +0200 Polytropon  wrote:
>  > On Tue, 02 Apr 2013 19:10:59 -0700, Ronald F. Guilmette wrote:
>  > > It doesn't have to cover "everything".  But it _should_ completely 
> describe
>  > > the programatic interface.
>  > 
>  > At least is leaves questions, like stating "use the syscalls
>  > in order to...", and the reader is left with the most obvious
>  > question: _which_ syscalls?
> 
> Sometimes examples are the best teachers. 

Somethimes even manpages contain EXAMPLES. :-)



>  > > But like I said, somewher along the line, a lot of man page writers
>  > > apparently got lazy... VERY lazy.
> 
> Mmm, and a few man page readers too?  It's really not rocket science ..

No, it's just reading the letters which form words and sentences,
expressing things. But that can already be considered hard work
if you're not used to that "intellectual" stuff. :-)



>  > But keep in mind they're still alive! Judging from the manpages
>  > of... *cough* can I say this? YOu know, more prominent open
>  > source operating systems for desktops... they're usually much
>  > worse _if_ there is a manpage. In most cases, there's none.
> 
> True.  And I can usually get little more sense out of info(1) than from 
> windows 'troubleshooter' :)

You can shoot trouble as much as you like. It doesn't work.
It always comes back. To eliminate the source, you need to
understand the initial problem, then kill it with fire. :-)



>  > > >> Second order question:  Why can't I just pipe a .wav file to the
>  > > >> /dev/speaker device file and have it play?  Wouldn't that make quite
>  > > >> a lot of sense?
>  > > >
>  > > >No, that does not work.
>  > > 
>  > > Apparently not.
>  > > 
>  > > Why it doesn't work (or couldn't work) is less clear.
>  > 
>  > The speaker interface to the _PC speaker_ is not a DSP. It's
>  > programming is much simpler. The "note language" that it
>  > uses on FreeBSD is much more than other interfaces offer.
>  > Better ones have stuff like pitch, duration, turn off.
> 
> Not to mention staccato, legato, dotted notes - sophisticated stuff!

Plus interpretation of UTF-8 strings that contain note language,
I assume those "characters" are in there... :-)



>  > > >% echo "c" > /dev/speaker
>  > > 
>  > > Humm... now _that_ is both interesting and enlightening.
>  > 
>  > I actually remember having used something comparable on
>  > BASIC, when my brain wasn't fully developed yet. :-)
> 
> The note language is _from_ BASIC .. do read the source, Luke(s)!

That's why I could remember it. I think it was QBasic
(on a PC platform, no idea if other platforms also supported
it, but I assume more "sophisticated" BASICs could have
contained that functionality).



>  >echo "cdefgab>c" > /dev/speaker
>  > 
>  > It's still a nice interface to "generate attention sounds"
>  > in case you want to make an audible alarm or signal for
>  > some specific action, like a program which has aborted,
>  > an unverified backup or the successful completition of
>  > a task.
> 
> Indeed it is.  On an old laptop using APM I used to play little tunes as 
> the battery got down to 30, 20, 10%, noiser just before forced suspend,
> which saved me not a few times.  A nice little chirp when fully charged.

You can still find it in /etc/apmd.conf:

echo T250L16B+BA+AG+GF+FED+DC+CC >/dev/speaker

echo T250L8CE-GE-C >/dev/speaker

Sadly, when APM was working properly, it has been abolished. :-(





-- 
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: State of Packages

2013-04-04 Thread Bryan Drewery
On 4/4/2013 1:57 PM, d...@safeport.com wrote:
> Its seems certain that pkg_add is not [going to] be[ing] restored.

Progress is being made on providing pkg_add and pkgng packages again.
They will come back.

> 
> Index of ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/9.1-RELEASE/
> 
> Name Size Last Modified
> File:MANIFEST 1 KB 12/04/12 10:10:00
> File:base.txz 58452 KB 12/04/12 10:09:00
> File:doc.txz 1410 KB 12/04/12 10:10:00
> File:games.txz 1092 KB 12/04/12 10:10:00
> File:kernel.txz 56686 KB 12/04/12 10:10:00
> File:lib32.txz 9516 KB 12/04/12 10:10:00
> File:ports.txz 85867 KB 12/04/12 10:10:00
> File:src.txz 94190 KB 12/04/12 10:10:00
> 
> This pretty much invalidates 5.4 of the handbook.
> 
> My questions: Does/will pkgng work? Are 9.1 packages on the ISO images?
> I am in the progess of answering that one for myself but had some time
> on my hands during the download :)
> 
> _
> Douglas Denault
> http://www.safeport.com
> d...@safeport.com
> Voice: 301-217-9220
>   Fax: 301-217-9277
> ___
> 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"


-- 
Regards,
Bryan Drewery
bdrewery@freenode/EFNet



signature.asc
Description: OpenPGP digital signature


Re: State of Packages

2013-04-04 Thread Mark Blackman

On 4 Apr 2013, at 21:21, Bryan Drewery  wrote:

> On 4/4/2013 1:57 PM, d...@safeport.com wrote:
>> Its seems certain that pkg_add is not [going to] be[ing] restored.
> 
> Progress is being made on providing pkg_add and pkgng packages again.
> They will come back.


For those who might be interested in an interim solution, we've set up 
an unofficial but public pkgng format repository at

http://mirror.exonetric.net/pub/pkgng

To use these packages, just set your PACKAGESITE variable in
/usr/local/etc/pkg.conf like so,

PACKAGESITE  : http://mirror.exonetric.net/pub/pkgng/${ABI}/latest

These have FreeBSD 8, 9 and 10, i386 and amd64 kernel pkgng format packages
for the whole ports tree, build failures notwithstanding.

You'll have to explicitly make the decision to trust or not these
builds, of course, but all are welcome to use them until the official
ones are available.

- Mark
___
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: Regarding zfs send / receive

2013-04-04 Thread Joar Jegleim
Hi Terje !
sorry for late reply, I've been checking my mail, forgetting that all my
mailing list mail are sorted into their own folders skipping inbox :p

the zfs sync setup is a huge advantage over rsync simply because
incremental rsync of the volume takes ~12 hours, while the zfs differential
snapshot's usually take less than a minute . Though it's only ~1TB of data,
it's  more than 2 million jpegs which rsync have to stat ...
I'm guessing my predecessor who chose this setup, over for instance HAST,
didn't feel confident enough regarding HAST in production ( I'm looking
into that for a future solution) .

There's no legacy stuff on the receiving end, old pools are deleted for
every sync. I haven't got my script here but google pointed me too
https://github.com/hoopty/zfs-sync/blob/master/zfs-sync which look like a
script very similar to the one I'm using .
In fact, I'm gonna take a closer look at that script and see what differs
from my script (apart from it being much prettier :p )
I didn't know about zpool.cache, gonna check that tomorrow, thanks.



-- 
--
Joar
Jegleim
Homepage: http://cosmicb.no
Linkedin: http://no.linkedin.com/in/joarjegleim
fb: http://www.facebook.com/joar.jegleim
AKA: CosmicB @Freenode

--

On 2 April 2013 14:40, Terje Elde  wrote:

> On 2. apr. 2013, at 13.44, Joar Jegleim wrote:
> > So my question(s) to the list would be:
> > In my setup have I taken the use case for zfs send / receive too far
> > (?) as in, it's not meant for this kind of syncing and this often, so
> > there's actually nothing 'wrong'.
>
> I'm not sure if you've taken it too far, but I'm not entirely sure if
> you're getting any advantage over using rsync or similar for this kind of
> thing.
>
> First two things that spring to mind:
>
> Do you have any legacy stuff on the receiving machine?  Things like
> physically removed old zpools, that are still in zpool.cache, seems to slow
> down various operations, including creation of new stuffs (such as the
> snapshots you receive).
>
> Also, you don't mention if you're deleting old snapshots on the receiving
> end?  If you're doing an incremental run every 15 minutes, that's something
> like 3000 snapshots pr. month, pr. filesystem.
>
> Terje
>
>
___
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"


NFSv4 questions and possible bugs

2013-04-04 Thread b w
I set up NFSv4, did some performance tests, setup looks like this:

Server rc.conf:
nfs_server_enable="YES"
nfsv4_server_enable="YES"
nfsuserd_enable="YES"

exports:
/share -mapall=nobody  10.10.14.2 10.10.14.3
V4: /   -sec=sys

Client(s) fstab mount:
srv:/share /mnt nfs nfsv4,rsize=32768,wsize=32768,rw   0   0

Server is in a different vlan than the clients, there's a Juniper SRX
between them.

As far as I understand this means a NFSv4 only setup.

1. I had to use rsize and wsize mount options, without them performance
is horrible, 1 MBps from the same vlan, when in different vlans it would
start fast than drop to a standstill, compared to around 100MBps with sizes. Not
sure why. 32K is the best I found, 16K and 64K were slightly worse, but
I assume this is due to our network setup.

2. Only port 2049 is open in the firewall, as it should be enough for
NFSv4, but umount tries to send 3 UDP packets to port 111. This causes
it to hang for some time while waiting for the packets to time out and
exit with an error. The unmount is executed correctly, but the exit
status could cause problems in scripts, see 4.

3. bonnie++ exits uncleanly,
http://lists.freebsd.org/pipermail/freebsd-current/2010-September/019820.html
I guess this is a known bug, but I just wanted to point out that it's
still there in up to date 9.1-RELEASE. Since it's been around for a
long time, I suppose it's not likely to cause problems in production,
is it?

4. After bonnie++'s failure I tried iozone, but iozone wants to
unmount before each test and hits #2.

Performance is excellent as far as I can see, after setting raise and
wsize, transfers hit the network cap, so I guess my main question is
if #2 is likely to cause issues down the road. It will have mostly
perl scripts reading and moving files around and syslog, "rm -rf"
seemed to do the job without problems.
___
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"


Debian/kFreeBSD vs linux jail?

2013-04-04 Thread Joshua Isom
Considering Debian's ported the "standard Linux userland" to the FreeBSD 
kernel, I'm wondering if it's possible/practical to use Debian inside of 
a jail instead of a Linux CentOS jail, which has been documented.  I 
know some applications are linux specific, but are they really linux 
specific or gnu specific?  I'm going to retry getting a printer driver 
working with cups that had issues with FreeBSD in the past, but I don't 
know if it's FreeBSD userland or FreeBSD kernel that caused the quirks. 
 Has anyone tried using Debian's kFreeBSD userland inside a jail?  Is 
it just pointless on a FreeBSD system?

___
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: Regarding zfs send / receive

2013-04-04 Thread Waitman Gobble
Waitman Gobble
San Jose California USA
On Apr 4, 2013 2:07 PM, "Joar Jegleim"  wrote:
>
> Hi Terje !
> sorry for late reply, I've been checking my mail, forgetting that all my
> mailing list mail are sorted into their own folders skipping inbox :p
>
> the zfs sync setup is a huge advantage over rsync simply because
> incremental rsync of the volume takes ~12 hours, while the zfs
differential
> snapshot's usually take less than a minute . Though it's only ~1TB of
data,
> it's  more than 2 million jpegs which rsync have to stat ...
> I'm guessing my predecessor who chose this setup, over for instance HAST,
> didn't feel confident enough regarding HAST in production ( I'm looking
> into that for a future solution) .
>
> There's no legacy stuff on the receiving end, old pools are deleted for
> every sync. I haven't got my script here but google pointed me too
> https://github.com/hoopty/zfs-sync/blob/master/zfs-sync which look like a
> script very similar to the one I'm using .
> In fact, I'm gonna take a closer look at that script and see what differs
> from my script (apart from it being much prettier :p )
> I didn't know about zpool.cache, gonna check that tomorrow, thanks.
>
>
>
> --
> --
> Joar
> Jegleim
> Homepage: http://cosmicb.no
> Linkedin: http://no.linkedin.com/in/joarjegleim
> fb: http://www.facebook.com/joar.jegleim
> AKA: CosmicB @Freenode
>
> --
>
> On 2 April 2013 14:40, Terje Elde  wrote:
>
> > On 2. apr. 2013, at 13.44, Joar Jegleim wrote:
> > > So my question(s) to the list would be:
> > > In my setup have I taken the use case for zfs send / receive too far
> > > (?) as in, it's not meant for this kind of syncing and this often, so
> > > there's actually nothing 'wrong'.
> >
> > I'm not sure if you've taken it too far, but I'm not entirely sure if
> > you're getting any advantage over using rsync or similar for this kind
of
> > thing.
> >
> > First two things that spring to mind:
> >
> > Do you have any legacy stuff on the receiving machine?  Things like
> > physically removed old zpools, that are still in zpool.cache, seems to
slow
> > down various operations, including creation of new stuffs (such as the
> > snapshots you receive).
> >
> > Also, you don't mention if you're deleting old snapshots on the
receiving
> > end?  If you're doing an incremental run every 15 minutes, that's
something
> > like 3000 snapshots pr. month, pr. filesystem.
> >
> > Terje
> >
> >
>

hi,
i have a similar situation. its better to only rsync new stuff in this
case, because you should know when somebody ads something new.

for example, a user uploads 200 new images, these are marked 'to sync' and
are transferred to the other servers. letting rsync figure out what's new
just isnt practical.

an idea, works for me. hope it helps.

Waitman Gobble
San Jose California ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "
freebsd-questions-unsubscr...@freebsd.org"
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: State of Packages

2013-04-04 Thread doug

On Thu, 4 Apr 2013, Mark Blackman wrote:


On 4 Apr 2013, at 21:21, Bryan Drewery  wrote:


On 4/4/2013 1:57 PM, d...@safeport.com wrote:

Its seems certain that pkg_add is not [going to] be[ing] restored.


Progress is being made on providing pkg_add and pkgng packages again.
They will come back.



For those who might be interested in an interim solution, we've set up
an unofficial but public pkgng format repository at

http://mirror.exonetric.net/pub/pkgng

To use these packages, just set your PACKAGESITE variable in
/usr/local/etc/pkg.conf like so,

PACKAGESITE  : http://mirror.exonetric.net/pub/pkgng/${ABI}/latest

These have FreeBSD 8, 9 and 10, i386 and amd64 kernel pkgng format packages
for the whole ports tree, build failures notwithstanding.

You'll have to explicitly make the decision to trust or not these
builds, of course, but all are welcome to use them until the official
ones are available.


Thank you

_
Douglas Denault
http://www.safeport.com
d...@safeport.com
Voice: 301-217-9220
  Fax: 301-217-9277
___
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"


using pax command for archive & restore

2013-04-04 Thread Joe

I archive using the pax command like this

pax -wzXt -x cpio -f ${archive_path_file} ${ip_path_file} ${ip_path_dir}

and restore

pax -rz -pe -f ${archive_path_file}
and it restores the contents back to the same location it came from 
which is what I want.


Now I would like to restore that archive file to a different directory.

Tried different combinations of flags on the pax command and can't 
figure out the correct combination.


pax -rz -pe -f ${archive_path_file} ${temp_dir}
just gives me a syntax error.

This has to be simple, but I can't see the trees because the forest is 
in the way.

What am I missing here?

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"