Impact of having a large number of open file descriptors

2008-05-28 Thread Ivan Voras
Hi,

Im thinking again of the old idea of implementing poor man's file
replication system using kqueue to monitor changes on files. This would
require opening every file that needs to be monitored and using
EVFILT_VNODE to monitor them. I suppose this would work for a small-ish
number of files like for a user's home directory but what about 100,000
files or millions of files?

One other question: do kqueue events "coalesce" in the sense that if N
operations happen (like write()s), there can be < N events passed to the
kqueue (NOTE_WRITE)?

While at it, will EVFILT_VNODE and NOTE_WRITE catch "additional" ways
the file can be modified, meaning mmap()?



signature.asc
Description: OpenPGP digital signature


Re: Impact of having a large number of open file descriptors

2008-05-28 Thread Oliver Fromme
Ivan Voras wrote:
 > Im thinking again of the old idea of implementing poor man's file
 > replication system using kqueue to monitor changes on files.

It would be cool to have a kernel interface so you could
attach to a mountpoint and receive a log of all activity
on that file system.  That's similar to what DragonFly's
journaling feature does.

Unfortunately the kqueue interface isn't capable of doing
something like that ...  So this is not an answer to your
question, I'm afraid.

 > One other question: do kqueue events "coalesce" in the sense that if N
 > operations happen (like write()s), there can be < N events passed to the
 > kqueue (NOTE_WRITE)?

The manpage says:  "Multiple events which trigger the filter
do not result in multiple kevents being placed on the kqueue;
instead, the filter will aggregate the events into a single
struct kevent."

 > While at it, will EVFILT_VNODE and NOTE_WRITE catch "additional" ways
 > the file can be modified, meaning mmap()?

A quick grep for NOTE_WRITE on the sys tree indicates that
it doesn't.  I'm not 100% sure though.

Best regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606,  Geschäftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün-
chen, HRB 125758,  Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart

FreeBSD-Dienstleistungen, -Produkte und mehr:  http://www.secnetix.de/bsd

"Documentation is like sex; when it's good, it's very, very good,
and when it's bad, it's better than nothing."
-- Dick Brandon
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Impact of having a large number of open file descriptors

2008-05-28 Thread Ivan Voras
2008/5/28 Oliver Fromme <[EMAIL PROTECTED]>:
> Ivan Voras wrote:
>  > Im thinking again of the old idea of implementing poor man's file
>  > replication system using kqueue to monitor changes on files.
>
> It would be cool to have a kernel interface so you could
> attach to a mountpoint and receive a log of all activity
> on that file system.  That's similar to what DragonFly's
> journaling feature does.

/me agrees.

> Unfortunately the kqueue interface isn't capable of doing
> something like that ...  So this is not an answer to your
> question, I'm afraid.
>
>  > One other question: do kqueue events "coalesce" in the sense that if N
>  > operations happen (like write()s), there can be < N events passed to the
>  > kqueue (NOTE_WRITE)?
>
> The manpage says:  "Multiple events which trigger the filter
> do not result in multiple kevents being placed on the kqueue;
> instead, the filter will aggregate the events into a single
> struct kevent."

That's mildly unfortunate but I think you're right - it agrees with
the statement from the kqueue paper: "Events will normally considered
to be "level-triggered",
as opposed to "edge-triggered"."

>  > While at it, will EVFILT_VNODE and NOTE_WRITE catch "additional" ways
>  > the file can be modified, meaning mmap()?
>
> A quick grep for NOTE_WRITE on the sys tree indicates that
> it doesn't.  I'm not 100% sure though.

Also bad for some users.
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


FreeBSD + LDAP + SAMBA + WINDOWS

2008-05-28 Thread Israel Lehnen Silva
Friends,

I have the following scenario:

Server FreeBSD 7.0 Stable authenticating in one basis LDAP through of the
PAM (pam_ldap and nss_ldap)
In same server, have running the SAMBA 3.0.28 authenticating too in
basis LDAP and using the scripts smbldap-tools.
Tool LDAPAdmin for administration of basis LDAP.

THE PROBLEM:

When chang the pass of user in basis LDAP trhough of LDAPAdmin,
select th cryptograpy "MD5 Crypt" for the atribuct userPassword
This way, I achieve log in the Windows and FreeBSD by terminal, ssh...
but when chang pass of user by Windows, the cryptograpy of password in
atribuct userPassword
is chanded for SSHA and so not conect in FreeBSD, also just conect in
windows.

FreeBSD and SAMBA authenticating in LDAP,
and changing the password by own user, not interfering in auth of ssh in
FreeBSD...
Someone implemented???

The configuration of Samba:

# Samba config file created using SWAT
# from 0.0.0.0 (0.0.0.0)
# Date: 2008/05/05 16:13:37

[global]
  dos charset = CP850
  unix charset = ISO8859-1
  workgroup = NOVOARQ
  netbios name = NARQ
  server string = LDAP Teste
  # update encrypted = Yes
  # unix password sync = Yes
  passwd program = /usr/local/sbin/smbldap-passwd -u "%u"
  encrypt passwords = Yes
  # obey pam restrictions = Yes
  socket options = TCP_NODELAY IPTOS_LOWDELAY IPTOS_THROUGHPUT
SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192
  log level = 1
  log file = /var/log/samba/samba.log
  max log size = 0
  time server = Yes
  machine password timeout = 0
  logon script = %G.bat
  logon drive = H:
  logon home = \\NARQ\%U

  os level = 255
  preferred master = Yes
  domain master = yes
  domain logons = yes
  local master = yes

  passdb backend = ldapsam:ldap://ldap.dominio.com.br
  ldap passwd sync = Yes
  ldap delete dn = Yes
  ldap ssl = no
  ldap admin dn = cn=admin,dc=unilasalle,dc=edu,dc=br
  ldap suffix = dc=unilasalle,dc=edu,dc=br
  ldap machine suffix = ou=computadores
  ldap user suffix = ou=usuarios
  ldap group suffix = ou=grupos
  ldap idmap suffix = sambaDomainName=NOVOARQ
  idmap backend = ldap:ldap://ldap.dominio.com.br
  idmap uid = 1-65000
  idmap gid = 1-65000
  enable privileges = yes
  add user script = /usr/local/sbin/smbldap-useradd -m "%u"
  # delete user script = /usr/local/sbin/smbldap-userdel "%u"
  add group script = /usr/local/sbin/smbldap-groupadd -p "%g"
  # delete group script = /usr/local/sbin/smbldap-groupdel "%g"
  add user to group script = /usr/local/sbin/smbldap-groupmod -m "%u"
"%g"
  delete user from group script =
/usr/local/sbin/smbldap-groupmod -x "%u" "%g"
  set primary group script = /usr/local/sbin/smbldap-usermod -g "%g"
"%u"
  add machine script = /usr/local/sbin/smbldap-useradd -w "%u"

  utmp = Yes
  smb ports = 445 139
  name resolve order = wins bcast hosts
  time server = Yes
  template shell = /bin/false
  winbind use default domain = no
  map acl inherit = Yes
  strict locking = Yes
  wins support = Yes
  interfaces = bce0
  bind interfaces only = Yes

  dns proxy = No
  create mask = 0770
  force create mode = 0770
  directory mask = 0770
  force directory mode = 0770


Best regards,
Israel Lehnen Silva.
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Why doesn't autoconf like our /bin/sh?

2008-05-28 Thread John Baldwin
On Sunday 25 May 2008 11:45:37 am Stefan Farfeleder wrote:
> On Sun, May 25, 2008 at 09:06:47AM -0600, John E Hein wrote:
> > FWIW, it seems bash and sh report line number differently.
> >
> > # grep -n ^ ~/tmp/ln
> > 1:#!/bin/sh
> > 2:echo f line: $LINENO
> > 3:f()
> > 4:{
> > 5:echo f line: $LINENO
> > 6:}
> > 7:
> > 8:f
> > 9:echo main line: $LINENO
> > 10:f
> >
> >
> > # /bin/sh ~/tmp/ln
> > f line: 2
> > f line: 3
> > main line: 9
> > f line: 3
> >
> >
> > # bash ~/tmp/ln
> > f line: 2
> > f line: 5
> > main line: 9
> > f line: 5
>
> Yes, I know.  I think it is a bug in bash as SUSv3 states:
>
> "Set by the shell to a decimal number representing the current
> sequential line number (numbered starting with 1) within a script or
> function before it executes each command."

Actually, the bash way seems more intuitive.  And it does say "the current 
sequentional line number within a ... function before it executes each 
command"

The "within a function" implies that this property goes inside of functions 
instead of forcing all commands in a function to use the starting line of the 
function which is what you are saying?

-- 
John Baldwin
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"