Re: BCM5719/20 or I350

2014-01-07 Thread mxb
This is a pair of CARP-nodes (2x Dell R620 ). Nodes are connected with 
cross-over, trunk to trunk (trunk of 2x I350 per node).
No vlans.

tcpbench from the base; PF used a lot, but with pass quick on trunk0 keep 
state”:

Conn:   1 Mbps:  926.569 Peak Mbps:  939.483 Avg Mbps:  926.569

On 6 jan 2014, at 22:44, Hrvoje Popovski hrv...@srce.hr wrote:

 On 5.1.2014. 17:10, mxb wrote:
 
 I have I350 on several machines and haven’t seen any problems.
 
 
 
 Do you have vlans or trunk on I350? Could you share some numbers like
 bps or pps?
 
 Tnx for info.



delete-old

2014-01-07 Thread Christian Weisgerber
Sometime last year I wrote:

| Those who also update FreeBSD machines from source may know make
| delete-old, which offers to delete obsolete files and directories.
| 
| Here's the same as a shell script. 

As posted, the script would also offer to delete files that have
been moved between sets, e.g., from base to comp.  Ouch.

Here's a fixed version:

8 
#!/bin/sh

ARCH=$(uname -m)
BASE=-rOPENBSD_5_4_BASE # or -D...

old=$(mktemp /tmp/delete-old-XX) || exit 1
new=$(mktemp /tmp/delete-old-XX) || exit 1
trap rm $old $new 0 1 2 15

list=$(
cd /usr 
lists=$(echo src/distrib/sets/lists/*/mi \
src/distrib/sets/lists/*/md.$ARCH) 
(cd /usr/src  cvs -Rq co $BASE -p $lists $new) 
sort $new $old 
sort $lists $new 
diff -u $old $new | sed -n 's:^-\./:/:p'
)

nl='
'
files=
libs=
dirs=
while read file; do
if [ -f $file -o -h $file ]; then
case $file in
*.so.[0-9].[0-9] | \
*.so.[0-9].[0-9][0-9] | \
*.so.[0-9][0-9].[0-9] | \
*.so.[0-9][0-9].[0-9][0-9] )
libs=${libs:+$libs$nl}$file
;;
*)
files=${files:+$files$nl}$file
;;
esac
elif [ -d $file ]; then
dirs=${dirs:+$dirs$nl}$file
fi
done EOF
$list
EOF

delete-old-files()
{
echo  Removing old files
if [ -n $files ]; then
exec 30
while read file; do
rm -i $file 3
done -EOF
$files
EOF
fi
}

delete-old-libs()
{
echo  Removing old libraries
if [ -n $libs ]; then
exec 30
while read file; do
rm -i $file 3
done -EOF
$libs
EOF
fi
}

delete-old-dirs()
{
echo  Removing old directories
if [ -n $dirs ]; then
while read file; do
rmdir $file  echo $file
done -EOF
$dirs
EOF
fi
}

delete-old-files
delete-old-libs
delete-old-dirs
8

-- 
Christian naddy Weisgerber  na...@mips.inka.de



My CD Set did not arrived.

2014-01-07 Thread Friedrich Locke
Hi folks,

i did order my OpenBSD 5.4 CD Set on 2013/11/02. The people at calgary shop
sent me an email saying my order was shipped on  2013/11/12. Until the
present moment i did not receive any thing yet.

I am writing to the mailing list because none o the email i sent to
shipp...@computershop.ca is answered. I am really desperated about this.

May some one on the list help with the calgary computer shop ?

Thanks a lot for your time and cooperation!

Best regards.

Gustavo.



Re: Barcode Scan OpenBSD Order: 54.02757 2013/11/2-18:29:24-31073:

2014-01-07 Thread Gustavo Coelho
Dear Austin,


i am witing to let you know that up to the present momment, i did not received 
my CD Set.

I have sent email to the computer clagary shop, but no response i get back. May 
you help me ? I would really enjoy to have this OpenBSD CD Set.

Thank you for your time and cooperation.

Best regards,

Gustavo.

On Tue, Nov 12, 2013 at 06:41:21AM -0700, OpenBSD Shipping wrote:
 bsd54.02757  2013/11/2-18:29:24-31073:
 
 Shipment from Canada via small packet AIR is confirmed via:
 CN22  12 Nov 2013 (ship date). 
 
 (NB: More items from your order than are shipped in this one package
 may appear below.  Script is usually not corrected for partial shipments.)
 
 Computer Shop/OpenBSD
 Box 267
 Milk River, AB
 Canada  T0K 1M0   
 
 
 
 Gustavo Rios
 Rua Vinicius de Moraes 145
 Bairro de Fatima
 Vicosa, Minas Geraes
 Brazil 36570-000
 
 
 Software on CDROM  Canada50
   CDN $ TOTAL -- 50
 
 This is the postal mail receipt processing script, letting you know that a
 package with the customs declaration as above has been mailed to you, and
 the proof of mailing is now on file with us.  (Note: shipment may sometimes 
 be a partial shipment, in which case only some of the items above may be
 included and declared.)
 
 Packages shipped by this method are classed Small Packet AIRMAIL, and do
 not have tracking.  However, insurance is included.
 
 For North America transit time is typically  7 to 10 days.
 
 Outside North America, transit times are typically 10 to 14 days.
 
 Insurance claims for AIR parcels may be initiated after 45 days, should loss
 in the mail be suspected, however, claims must be initiated within 3 months
 of shipping or they will be denied.  
 
 However, if one of the rare, but overly long, postal delays interferes with
 an urgent project of yours, or events arise that increase the urgency of
 your requirements, do not hesitate to contact us.  We have solutions for
 most any circumstance.
 
 This message concerns only one package, and there may, or may not, be other
 packages sent out for your order.  
 
 OpenBSD Shipping



Re: 10G with Intel card - GBIC options

2014-01-07 Thread Hrvoje Popovski
On 2.12.2013. 10:05, Andy wrote:
 Hmm surprised by that!
 
 Henning, could you please confirm for us if the 32bit bandwidth limit
 was lifted in the new queuing subsystem, or if it is just still in place
 whilst dual-running the new and the old?
 
 I guess considering Hrvoje's findings the limit is still in place until
 ALTQ is removed completely in 5.5??
 
 Cheers, Andy.
 



Hi,
second ix (82599) card is here and I have directly connected two servers.

With kern.pool_debug=0, net.inet.ip.ifq.maxlen=1024 and mtu 16110 on ix
cards bandwidth is ~7Gbps.
tcpbench runs with -B 262144 -S 262144

pf.conf:
set skip on lo
block
pass


10Gbps queue:
pf.conf
queue queue@ix0 on ix0 bandwidth 10G max 10G
queue bulk@ix0 parent queue@ix0 bandwidth 10G default

pfctl -vsq
queue queue@ix0 on ix0 bandwidth 1G, max 1G qlimit 50
queue bulk@ix0 parent queue@ix0 on ix0 bandwidth 1G default qlimit 50

tcpbench shows 1404Mbps


9Gbps queue:
pf.conf
queue queue@ix0 on ix0 bandwidth 9G max 9G
queue bulk@ix0 parent queue@ix0 default bandwidth 9G

pfctl -vsq
queue queue@ix0 on ix0 bandwidth 410M, max 410M qlimit 50
queue bulk@ix0 parent queue@ix0 on ix0 bandwidth 410M default qlimit 50

tcpbench shows 206Mbps


8Gbps queue:
pf.conf
queue queue@ix0 on ix0 bandwidth 8G max 8G
queue bulk@ix0 parent queue@ix0 default bandwidth 8G

pfctl -vsq
queue queue@ix0 on ix0 bandwidth 3G, max 3G qlimit 50
queue bulk@ix0 parent queue@ix0 on ix0 bandwidth 3G default qlimit 50

tcpbench shows 3690Mbps


7Gbps queue:
pf.conf
queue queue@ix0 on ix0 bandwidth 7G max 7G
queue bulk@ix0 parent queue@ix0 default bandwidth 7G

pfctl -vsq
queue queue@ix0 on ix0 bandwidth 2G, max 2G qlimit 50
queue bulk@ix0 parent queue@ix0 on ix0 bandwidth 2G default qlimit 50

tcpbench shows 2695Mbps


6Gbps queue:
queue queue@ix0 on ix0 bandwidth 6G max 6G
queue bulk@ix0 parent queue@ix0 default bandwidth 6G

pfctl -vsq
queue queue@ix0 on ix0 bandwidth 1G, max 1G qlimit 50
queue bulk@ix0 parent queue@ix0 on ix0 bandwidth 1G default qlimit 50

tcpbench shows 1699Mbps


5Gbps queue
pf.conf
queue queue@ix0 on ix0 bandwidth 5G max 5G
queue bulk@ix0 parent queue@ix0 default bandwidth 5G

pfctl -vsq
queue queue@ix0 on ix0 bandwidth 705M, max 705M qlimit 50
queue bulk@ix0 parent queue@ix0 on ix0 bandwidth 705M default qlimit 50

tcpbench shows 218Mbps


4Gbps queue:
pf.conf
queue queue@ix0 on ix0 bandwidth 4G max 4G
queue bulk@ix0 parent queue@ix0 bandwidth 4G default

pfctl -vsq
queue queue@ix0 on ix0 bandwidth 4G, max 4G qlimit 50
queue bulk@ix0 parent queue@ix0 on ix0 bandwidth 4G default qlimit 50

tcpbench shows 3986Mbps which is 99.65% of 4000Mbps.
Could this 0,35% or 14Mbps bandwidth loss be interpret as queue overhead?
If yes, then this is wonderful :)


3Gbps queue:
pf.conf
queue queue@ix0 on ix0 bandwidth 3G max 3G
queue bulk@ix0 parent queue@ix0 default bandwidth 3G

pfctl -vsq
queue queue@ix0 on ix0 bandwidth 3G, max 3G qlimit 50
queue bulk@ix0 parent queue@ix0 on ix0 bandwidth 3G default qlimit 50

tcpbench shows 2988Mbps which is 0.40% bandwidth loss.


2Gbps queue:
pf.conf
queue queue@ix0 on ix0 bandwidth 2G max 2G
queue bulk@ix0 parent queue@ix0 default bandwidth 2G

pfctl -vsq
queue queue@ix0 on ix0 bandwidth 2G, max 2G qlimit 50
queue bulk@ix0 parent queue@ix0 on ix0 bandwidth 2G default qlimit 50

tcpbench shows 1993Mbps which is 0,35% bandwidth loss


1Gbps queue:
pf.conf
queue queue@ix0 on ix0 bandwidth 1G max 1G
queue bulk@ix0 parent queue@ix0 default bandwidth 1G

pfctl -vsq
queue queue@ix0 on ix0 bandwidth 1G, max 1G qlimit 50
queue bulk@ix0 parent queue@ix0 on ix0 bandwidth 1G default qlimit 50

tcpbench show 996Mbps which is 0.7% bandwidth loss



Re: BCM5719/20 or I350

2014-01-07 Thread Hrvoje Popovski
On 7.1.2014. 13:27, mxb wrote:
 
 This is a pair of CARP-nodes (2x Dell R620 ). Nodes are connected with 
 cross-over, trunk to trunk (trunk of 2x I350 per node).
 No vlans.
 
 tcpbench from the base; PF used a lot, but with pass quick on trunk0 keep 
 state”:
 
 Conn:   1 Mbps:  926.569 Peak Mbps:  939.483 Avg Mbps:  926.569
 



thank you ...



Cannot set stty parameters and read from /dev/ttyU0

2014-01-07 Thread Jurjen Oskam
Hi everybody,

Earlier I had a Linux machine (well, a Raspberry Pi actually) which
I used to read out my energy meter. The energy meter was connected
to a USB port with a custom FTDI cable. The energy meter only
supports reading from it, writing to it is not possible.

On Linux, I set the necessary parameters on the USB tty as follows:

/bin/stty -F /dev/ttyUSB0 9600 sane evenp crtscts cs7 igncr

And after that, issuing cat /dev/ttyUSB0 resulted in the output
I'm interested in: the energy meter outputs its data every ten seconds.

Wrapping this in a Perl script was easy: just set issue the stty
command before invoking the Perl script, and in Perl I could just open
/dev/ttyUSB0 for reading and process the output line by line:

open(METER,/dev/ttyUSB0) or die;
while(METER) {
  # do stuff
done

This worked fine.


I replaced the Raspberry Pi with a more powerful amd64 machine
(full dmesg below). The USB cable shows up as:

uftdi0 at uhub3 port 6 FTDI P1 Converter Cable rev 2.00/6.00 addr 3
ucom0 at uftdi0 portno 1


But now I can't figure out how to read from /dev/ttyU0.

The first problem I'm having is that the stty setting doesn't seem to
stick:

$ stty -f /dev/ttyU0
ispeed 0 baud; ospeed 9600 baud;
lflags: echoe echoke echoctl
cflags: cs8 -parenb

$ stty -f /dev/ttyU0 9600 sane parenb -parodd crtscts cs7 igncr
$

$ stty -f /dev/ttyU0
ispeed 0 baud; ospeed 9600 baud;
lflags: echoe echoke echoctl
cflags: cs8 -parenb

When I do a cat /dev/ttyU0 in one terminal, it just hangs without
displaying anything. If I execute stty -f /dev/ttyU0 in another terminal,
cat suddenly outputs a few lines of garbage and then exits.


When I again do a cat /dev/ttyU0 in one terminal, but then use stty in
another terminal to set the correct settings, the cat command starts
outputting the correct data: several lines of output every ten seconds.
After while, it stops though, and I can't interrupt the cat command
anymore. A stty in another terminal also hangs uninterruptibly. Even a
kill -9 and disconnecting the SSH session doesn't work:

joskam   21226  0.0  0.0   180   152 p0  D+ 3:56PM0:00.00 stty -f
/dev/ttyU0
joskam   22302  0.0  0.0   236   176 p1- IE 3:54PM0:00.00 (cat)

I did read the manual pages, but I probably overlooked something.


How can I set the correct parameters on /dev/ttyU0 and read from it?


Thank you,

Jurjen Oskam



Full dmesg:

OpenBSD 5.4 (GENERIC.MP) #1: Tue Nov 12 10:57:06 CET 2013
   
r...@binpatch-54-amd64.mtier.org:/home/jasper/binpatchng/work-binpatch54-
amd64/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 4204191744 (4009MB)
avail mem = 4084551680 (3895MB)
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.7 @ 0xeb420 (76 entries)
bios0: vendor American Megatrends Inc. version 2.04 date 04/16/2013
bios0: Shuttle Inc. DS61
acpi0 at bios0: rev 2
acpi0: sleep states S0 S1 S3 S4 S5
acpi0: tables DSDT FACP APIC MCFG SLIC HPET SSDT SSDT SSDT
acpi0: wakeup devices P0P1(S4) USB1(S3) USB2(S3) USB3(S3) USB4(S3) USB5(S3)
USB6(S3) USB7(S3) PXSX(S4) RP01(S4) PXSX(S4) RP02(S4) PXSX(S4) RP03(S4)
PXSX(S4) RP04(S4) [...]
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Pentium(R) CPU G2020 @ 2.90GHz, 2893.81 MHz
cpu0:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,
CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,
DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,POPCNT,DEADLINE,
XSAVE,NXE,LONG,LAHF,PERF,ITSC,FSGSBASE,SMEP,ERMS
cpu0: 256KB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
cpu0: apic clock running at 99MHz
cpu1 at mainbus0: apid 2 (application processor)
cpu1: Intel(R) Pentium(R) CPU G2020 @ 2.90GHz, 2893.43 MHz
cpu1:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,
CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,
DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,POPCNT,DEADLINE,
XSAVE,NXE,LONG,LAHF,PERF,ITSC,FSGSBASE,SMEP,ERMS
cpu1: 256KB 64b/line 8-way L2 cache
cpu1: smt 0, core 1, package 0
ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 24 pins
acpimcfg0 at acpi0 addr 0xf800, bus 0-63
acpihpet0 at acpi0: 14318179 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (P0P1)
acpiprt2 at acpi0: bus 2 (RP01)
acpiprt3 at acpi0: bus 3 (RP02)
acpiprt4 at acpi0: bus -1 (RP03)
acpiprt5 at acpi0: bus 4 (RP04)
acpiprt6 at acpi0: bus -1 (RP05)
acpiprt7 at acpi0: bus -1 (RP06)
acpiprt8 at acpi0: bus -1 (RP07)
acpiprt9 at acpi0: bus -1 (RP08)
acpiprt10 at acpi0: bus 1 (PEG0)
acpiec0 at acpi0: Failed to read resource settings
acpicpu0 at acpi0: C3, C2, C1, PSS
acpicpu1 at acpi0: C3, C2, C1, PSS
acpipwrres0 at acpi0: FN00
acpipwrres1 at acpi0: FN01
acpipwrres2 at acpi0: FN02
acpipwrres3 at acpi0: FN03
acpipwrres4 at acpi0: FN04
acpitz0 at acpi0: critical temperature is 106 degC
acpitz1 at acpi0: critical temperature is 106 degC
acpibat0 at acpi0: BAT0 not 

Re: Cannot set stty parameters and read from /dev/ttyU0

2014-01-07 Thread Theo de Raadt
 /bin/stty -F /dev/ttyUSB0 9600 sane evenp crtscts cs7 igncr

^^ --- no a standard stty option
 The first problem I'm having is that the stty setting doesn't seem to
 stick:

 $ stty -f /dev/ttyU0
 ispeed 0 baud; ospeed 9600 baud;
 lflags: echoe echoke echoctl
 cflags: cs8 -parenb
 
 $ stty -f /dev/ttyU0 9600 sane parenb -parodd crtscts cs7 igncr

-f is not -F

When the tty is closed, it reverts to the default configuration.
There is no support for this -F method.

What you need to instead is wrap all this in a way which keeps the
tty open

(
stty 9600 sane parenb -parodd crtscts cs7 igncr
do your IO loop
) /dev/ttyU0 01 02

Something like that.



Re: Cannot set stty parameters and read from /dev/ttyU0

2014-01-07 Thread Philip Guenther
On Tue, Jan 7, 2014 at 8:23 AM, Theo de Raadt dera...@cvs.openbsd.org wrote:
 What you need to instead is wrap all this in a way which keeps the
 tty open

 (
 stty 9600 sane parenb -parodd crtscts cs7 igncr
 do your IO loop
 ) /dev/ttyU0 01 02

 Something like that.

I think the desired redirections on the subshell-close would make that
last line:
) /dev/ttyU0 0

(open /dev/ttyU0 read-write as stdin, and then dup that to stdout)


Philip Guenther



Re: Cannot set stty parameters and read from /dev/ttyU0

2014-01-07 Thread Remco
Jurjen Oskam wrote:

 uftdi0 at uhub3 port 6 FTDI P1 Converter Cable rev 2.00/6.00 addr 3
 ucom0 at uftdi0 portno 1
 
 
 But now I can't figure out how to read from /dev/ttyU0.
 

I usually use /dev/cuaU0 when reading from serial-to-USB converters.

Unless your cable is different in some way I think running cu(1) on a cua(4) 
device (something like cu -l/dev/cuaU0 -s9600) may show you the desired 
information.



Re: Cannot set stty parameters and read from /dev/ttyU0

2014-01-07 Thread Jurjen Oskam
Philip Guenther guenther at gmail.com writes:

 On Tue, Jan 7, 2014 at 8:23 AM, Theo de Raadt deraadt at
cvs.openbsd.org wrote:
  What you need to instead is wrap all this in a way which keeps the
  tty open
 
  (
  stty 9600 sane parenb -parodd crtscts cs7 igncr
  do your IO loop
  ) /dev/ttyU0 01 02
 
  Something like that.
 
 I think the desired redirections on the subshell-close would make that
 last line:
 ) /dev/ttyU0 0
 
 (open /dev/ttyU0 read-write as stdin, and then dup that to stdout)

Thank you for the responses. I sort of figured out that the stty settings
are set to default each time the device is opened, but now that's confirmed
I ran into the problem that open() does not seem to be returning.

I created the following simple shell script:

#!/bin/sh

( stty 9600 sane parenb -parodd crtscts cs7 igncr
while read line
do
echo $line
done
) /dev/ttyU0 0

Running it results in no output at all, without the prompt coming back.
Interrupting the process results in the following ktrace snippet:

   486 sh   1389125130.342774 CALL  
open(0x208ee2c50,0x202O_RDWR|O_CREAT,0x1b6S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP
|S_IROTH|S_IWOTH)
   486 sh   1389125130.342776 NAMI  /dev/ttyU0
   486 sh   1389125151.417307 PSIG  SIGINT caught handler=0x4214f0 
mask=0
   486 sh   1389125151.417312 RET   open -1 errno 4 Interrupted system 
call

Looking at the timestamps, the open() only returns when I Ctrl-C the process.

The same happens with the following trivial Perl script:

#!/usr/bin/perl -w

$|=1;
open(METER,/dev/ttyU0) or die;
print opened terminal\n;
close(METER);


Running it produces no output without the prompt coming back, at least not
until I Ctrl-C the Perl script:

 15860 perl 1389125426.222462 CALL  open(0x12f6694a1d70,0O_RDONLY)
 15860 perl 1389125426.222465 NAMI  /dev/ttyU0
 15860 perl 1389125451.261414 PSIG  SIGINT SIG_DFL

Again, open() doesn't seem to return.

Am I doing something wrong here?

Regards,

Jurjen Oskam



Re: Cannot set stty parameters and read from /dev/ttyU0

2014-01-07 Thread Philip Guenther
On Tue, Jan 7, 2014 at 12:17 PM, Jurjen Oskam jur...@osk.am wrote:
 Thank you for the responses. I sort of figured out that the stty settings
 are set to default each time the device is opened, but now that's confirmed
 I ran into the problem that open() does not seem to be returning.

 I created the following simple shell script:

 #!/bin/sh

 ( stty 9600 sane parenb -parodd crtscts cs7 igncr
 while read line
 do
 echo $line
 done
 ) /dev/ttyU0 0

 Running it results in no output at all, without the prompt coming back.
 Interrupting the process results in the following ktrace snippet:

486 sh   1389125130.342774 CALL
 open(0x208ee2c50,0x202O_RDWR|O_CREAT,0x1b6S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP
 |S_IROTH|S_IWOTH)
486 sh   1389125130.342776 NAMI  /dev/ttyU0
486 sh   1389125151.417307 PSIG  SIGINT caught handler=0x4214f0
 mask=0
486 sh   1389125151.417312 RET   open -1 errno 4 Interrupted system
 call

 Looking at the timestamps, the open() only returns when I Ctrl-C the process.

This is where Remco's response comes into play.  As described on the
tty(4)/cua(4) manpage, /dev/ttyU* blocks on open until the external
device signals that it's active via some hardware signal (DTR, iirc).
If you want to initiate an outgoing connection to a potentially
inactive device, use the matching /dev/cuaU* device.


Philip Guenther



Group access issue

2014-01-07 Thread Jon S
Hi!

I have a situation where I would like to assign one group of people rights
to read a file and a different group of people the right to read and write
the same file (there are actually many files).

A different way to describe it would be: I would like a file to belong to
two groups, one with RW-permissions and one with R--permissions.

The files are accessed using ssh.


I run OpenBSD 4.9. Installing new software and/or upgrading to latest
OpenBSD would be acceptable partial solutions.

Any hints or ideas on how I can accomplish this?

--

Jon Sjöstedt

jonsjost...@hotmail.com



Re: Cannot set stty parameters and read from /dev/ttyU0

2014-01-07 Thread Alexander Hall

On 01/07/14 21:17, Jurjen Oskam wrote:

Philip Guenther guenther at gmail.com writes:


On Tue, Jan 7, 2014 at 8:23 AM, Theo de Raadt deraadt at

cvs.openbsd.org wrote:

What you need to instead is wrap all this in a way which keeps the
tty open

 (
 stty 9600 sane parenb -parodd crtscts cs7 igncr
 do your IO loop
 ) /dev/ttyU0 01 02

Something like that.


I think the desired redirections on the subshell-close would make that
last line:
 ) /dev/ttyU0 0

(open /dev/ttyU0 read-write as stdin, and then dup that to stdout)


Thank you for the responses. I sort of figured out that the stty settings
are set to default each time the device is opened, but now that's confirmed
I ran into the problem that open() does not seem to be returning.

I created the following simple shell script:

#!/bin/sh

( stty 9600 sane parenb -parodd crtscts cs7 igncr
while read line
do
echo $line
done
) /dev/ttyU0 0

Running it results in no output at all, without the prompt coming back.


No surprise, really, as you redireced the printed lines back into the 
tty... :-)


Either print it to stderr (echo $line 2), or I simply suspect you 
don't want the '0' part.


/Alexander


Interrupting the process results in the following ktrace snippet:

486 sh   1389125130.342774 CALL
open(0x208ee2c50,0x202O_RDWR|O_CREAT,0x1b6S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP
|S_IROTH|S_IWOTH)
486 sh   1389125130.342776 NAMI  /dev/ttyU0
486 sh   1389125151.417307 PSIG  SIGINT caught handler=0x4214f0
mask=0
486 sh   1389125151.417312 RET   open -1 errno 4 Interrupted system
call

Looking at the timestamps, the open() only returns when I Ctrl-C the process.

The same happens with the following trivial Perl script:

#!/usr/bin/perl -w

$|=1;
open(METER,/dev/ttyU0) or die;
print opened terminal\n;
close(METER);


Running it produces no output without the prompt coming back, at least not
until I Ctrl-C the Perl script:

  15860 perl 1389125426.222462 CALL  open(0x12f6694a1d70,0O_RDONLY)
  15860 perl 1389125426.222465 NAMI  /dev/ttyU0
  15860 perl 1389125451.261414 PSIG  SIGINT SIG_DFL

Again, open() doesn't seem to return.

Am I doing something wrong here?

Regards,

Jurjen Oskam




Re: Group access issue

2014-01-07 Thread Andy Hayward
Not OpenBSD related, but this can be achieved with standard Unix
permissions. From memory you'll need something like:

Two groups, one for read-only (R), the other for write access (W). Anyone
in the latter group should also be in the former. Then create the following
directory structure:

foo (group = R, owner = nobody, permissions = 0050)
foo/bar (group = W, owner = nobody, permissions =  2075)

The directory foo/ acts as a gate, only members of R can see below. The
foo/bar directory holds your files, readable by anyone (except this is
restricted to the group R by foo/), writable by members of W. The setgid
bit ensures new files are writable by other members of W.



On 7 January 2014 13:57, Jon S jonsjost...@gmail.com wrote:

 Hi!

 I have a situation where I would like to assign one group of people rights
 to read a file and a different group of people the right to read and write
 the same file (there are actually many files).

 A different way to describe it would be: I would like a file to belong to
 two groups, one with RW-permissions and one with R--permissions.

 The files are accessed using ssh.


 I run OpenBSD 4.9. Installing new software and/or upgrading to latest
 OpenBSD would be acceptable partial solutions.

 Any hints or ideas on how I can accomplish this?

 --
 
 Jon Sjöstedt

 jonsjost...@hotmail.com



Re: Cannot set stty parameters and read from /dev/ttyU0

2014-01-07 Thread Daniel Bolgheroni
On Tue, Jan 07, 2014 at 03:05:39PM +, Jurjen Oskam wrote:
 Hi everybody,
 
 Earlier I had a Linux machine (well, a Raspberry Pi actually) which
 I used to read out my energy meter. The energy meter was connected
 to a USB port with a custom FTDI cable. The energy meter only
 supports reading from it, writing to it is not possible.

Some years ago I used a Arduino Duemilanove in a project. This board
uses the FTDI chipset uftdi(4). As Remco, it worked pretty well for me
too, using cu(1) or tip(1) + /dev/cuaUx.

-- 
db



[no subject]

2014-01-07 Thread Hugo Pompougnac
Good morning,

Before all, please forgive my language, I'm french.

As a
student, I'm discovering OpenBSD. I'm trying to automount USB keys with
hotplug, 
but it's quite difficult. That's why I ask to you.


To recap :
- I
downloaded hotplug-diskmount
- I created the directory /vol with
/usr/local/libexec/hotplug-diskmount init
- I added hotplug to rc.conf with
echo hotplugd_flags=\\  /etc/rc.conf.local
- I created
/etc/hotplug/attach following the manual :

DEVCLASS=${1}
DEVNAME=${2}
LOGIN=joeuser
case ${DEVCLASS} in
2)
   
/usr/local/libexec/hotplug-diskmount attach -u ${LOGIN} -m 700 ${DEVNAME}
    ;;
esac

- I launched the daemon with

/etc/rc.d/hotplugd start
However, when I insert an USB stick (FAT16 or FAT32), hotplug doesn't mount
them and /vol/ is empty. Nevertheless I can see them with dmesg, and I can
mount them with mount.


My /var/log/daemon says that :

Jan  8 07:54:47
home hotplugd[32702]: sd0 attached, class 2
Jan  8 07:54:47 home
hotplugd[32702]: scsibus3 attached, class 0
Jan  8 07:54:47 home
hotplugd[32702]: umass0 attached, class 0
Jan  8 07:54:47 home
hotplugd[32702]: child exit status: 1
The last line may be important, but I
don't undersand it ; that's why I ask you. You may know what the problem is ?
Gratefully,
Hugo P.