Re: mercurial working copy of FreeBSD src

2008-08-08 Thread Giorgos Keramidas
On Fri, 8 Aug 2008 11:47:15 -0700, "Navdeep Parhar" <[EMAIL PROTECTED]> wrote:
> Hello everyone,
>
> I'm looking for the fastest way to get a full mercurial repository of
> HEAD.

Do you really want the *FULL* history of head?  It's probably going to
be in the order of a couple of hundred of MB, or even more.

If you can live with an Hg repository that only includes the 2008
history of 'HEAD', then please keep reading, you may like the rest of
this post :)

> I tried using hgsvn and the tree at http://svn.freebsd.org/base/head
> but it looks like the first hgpullsvn operation will take days (literally):

hgpullsvn is slow.  Really really *REALLY* slow...  It's probably a
better idea to get a recent version of the mercurial/crew branch.  This
includes support for the svn-1.5.X bindings, and you can convert parts
of the history of the /base/head branch.

I have a local hg tree with the history of the 'head' branch since
2008-01-01 on my laptop, which I periodically resync from svn with:

[EMAIL PROTECTED]:/home/keramida$ cd /hg/bsd
[EMAIL PROTECTED]:/hg/bsd$ ./pull-head.sh
scanning source...
sorting...
converting...
[lots of output snipped]
[EMAIL PROTECTED]:/hg/bsd/head$ hg shortlog --limit 2
4201:99f1acdec12f | 2008-08-09 04:08 + | imp: Rather than waiting a 
fixed amount of time, which might not be enough
4200:d5553c08bf90 | 2008-08-09 03:54 + | imp: Change -1 to 0xul 
since the interface returns uint32_t.



(1) A bit of background
===

I didn't really want to convert the full history of the 'head' branch
From Subversion, because I have a local Subversion repository for that.
Being able to rebase my local in-progress patches on an Hg clone _did_
seem useful at the time, so that's why I converted only the history of
'head' from the start of 2008.

The initial pull was done by pulling a clean copy of the first commit of
2008 and then importing changesets on top of that with:

% cd /hg/bsd
% \time hg convert --config convert.svn.startrev=175026 \
  --config convert.svn.trunk='head' \
  --config convert.svn.branches='' \
  --config convert.svn.tags='' file:///home/svn/base/ head

The initial pull took a bit of time, but far less than hgimportsvn.
Subsequent pull-head.sh runs take literally seconds to pull from a local
Subversion repository mirror.  The speed is much much better than
hgpullsvn, because the Hg convert extension doesn't parse the output of
shell commands, but it links `natively' (through SWIG) with the
subversion libraries.

The conversion process is interruptible, and if you keep the 'SHA map'
of the initial conversion you can keep pulling changesets into the
conversion clone as many times as necessary with something like:

% cd /hg/bsd
% cat -n pull-head.sh
 1  #!/bin/sh
 2
 3  hg convert \
 4--config convert.svn.trunk='head' \
 5--config convert.svn.branches='' \
 6--config convert.svn.tags='' \
 7file:///home/svn/base/ head
%

You don't need the `convert.svn.startrev=175026' option in the second
and subsequent runs, because the conversion clone already has a file
called `.hg/shamap' and the conversion picks up from the place it
stopped the previous time.



(2) Bootstrapping your own clone


Everything above is of `encyclopedical' nature, because now that I've
done the conversion once, you can just use a bundle file and a matching
copy of my `.hg/shamap' file to bootstrap a conversion clone of your
own.

You can fetch an Hg bundle and a matching shamap with the history of
'head' in 2008 from:

http://people.freebsd.org/~keramida/mercurial/head.hg
http://people.freebsd.org/~keramida/mercurial/head.shamap

The checksums of these files should be:

MD5 (head.hg) = 4978723c560bc48c390be1634c7d36a4
MD5 (head.shamap) = 8e5957657fb499ed3a3575fc921e3029
SHA256 (head.hg) = 
ab073135925fdb54a2820077a5a4d75f4306d44a217b7c30d6b8719a9a5008d4
SHA256 (head.shamap) = 
04c6648bd108d3550ffb126c321b8faf2f5dda9f891787bb57ae178efa271893

The head.hg bundle is around 92 MB and you can pull it directly into an
empty Hg workspace:

% hg init head
% cd head ; hg pull /var/tmp/head.hg

Then copy the `head.shamap' file in `.hg/shamap' and you are ready to
go.  You can start cloning this tree, and you can also run "hg convert"
to incrementally pull the history of the svn/head branch, as many times
as necessary.  The `pull-head.sh' script I included above will make
subsequent pulls less tedious by saving you the typing of all the
--config options to get the svn->hg branch names right.



(3) Important disclaimer


Note that this is *NOT* an official branch of the FreeBSD source tree,
so if you plan to use the head.hg bundle, this email is _not_ really a
promise to keep uploading `bootstrap bundles'.  You are also the sole
person responsible for comp

Re: read with timeout ??

2008-08-08 Thread Peter Jeremy
On 2008-Aug-08 16:30:49 -0400, Chuck Robey <[EMAIL PROTECTED]> wrote:
>such a email, I have to admit my own needs fall more into a plain-jame serial
>line, nothing a socket-oriented thing could help me with.

If this is a normal serial port then termios(4) might help:  Use
non-canonical processing with VMIN = 0 and VTIME = 10 (see the section
"Noncanonical Mode Input Processing").

-- 
Peter Jeremy
Please excuse any delays as the result of my ISP's inability to implement
an MTA that is either RFC2821-compliant or matches their claimed behaviour.


pgpuhtxg3EmOZ.pgp
Description: PGP signature


Re: missing interrupts?

2008-08-08 Thread Ping Mai
Thanks John.
tried it but didn't help.

--- On Fri, 8/8/08, John Baldwin <[EMAIL PROTECTED]> wrote:

> From: John Baldwin <[EMAIL PROTECTED]>
> Subject: Re: missing interrupts?
> To: [EMAIL PROTECTED]
> Cc: "ping" <[EMAIL PROTECTED]>, [EMAIL PROTECTED], freebsd-hackers@freebsd.org
> Date: Friday, August 8, 2008, 1:10 PM
> On Friday 08 August 2008 02:16:20 pm ping wrote:
> > this is an interrupt handler that's attached to
> irq 31 on ioapic1 on a 6.1R 
> kernel, type INTR_TYPE_NET|INTR_MPSAFE.  seems that
> it's missing interrupts.  
> watching the KTR trace, it was running along fine, then it
> just stopped.  
> intr handler stopped getting run.  but the interrupt
> register on chip was 
> high.  is this a case of lost interrupts? or hardware
> problem?
> 
> There is one possible race in the I/O APIC code someone
> pointed me at 
> recently.  You can try expanding the scope of the icu_lock
> to cover all of 
> ioapic_program_intpin() to see if it fixes your issue 
> (sys///io_apic.c)
> 
> -- 
> John Baldwin
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: read with timeout ??

2008-08-08 Thread Nate Eldredge

On Fri, 8 Aug 2008, Chuck Robey wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Pieter de Goeje wrote:


I think poll(2) is also simpler than select for this purpose.



It does look like that, I need to check the implementation a bit, because the
name of this thing makes me really suspicious about how often it checks for an
fd for being ready for a read.  I know select comes right back, I was under the
impression that poll didn't use signals to do this.


AFAIK the effects are identical, just the arguments are set up in a 
different way.  Both of them will block until the fd is ready and then 
return "immediately" (subject to other processes running of course).  The 
name "poll" is a misnomer because it doesn't actually work by polling, 
but you can pretend that it does (and does so "infinitely often"). 
Neither one uses signals per se, though if the underlying hardware device 
is interrupt-driven, that will be what (indirectly) triggers the wake-up.


poll does seem to be more convenient than messing about with fd_set's. 
select is older and so it comes to my mind first, that's all.


--

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


Re: mercurial working copy of FreeBSD src

2008-08-08 Thread Navdeep Parhar
>> Hello everyone,
>>
>> I'm looking for the fastest way to get a full mercurial repository of
>> HEAD.
>>
>> I tried using hgsvn and the tree at http://svn.freebsd.org/base/head
>> but it looks like the first hgpullsvn operation will take days (literally):
>>
>> $ hgimportsvn http://svn.freebsd.org/base/head
>> $ cd head
>> $ hgpullsvn  <=== This will take a long long time
>>
>> Does anyone know of a faster way to do this?  Is there a mercurial
>> repository out there somewhere from where I can simply "hg clone" my
>> copy?
> Try this one: .
>

Thanks, this is exactly what I was looking for.  Can you also tell me
how and how often it is sync'ed with the main SVN repository?

Regards,
Navdeep

>
>
> --
> VH
>


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


Re: mercurial working copy of FreeBSD src

2008-08-08 Thread Xin LI

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Navdeep Parhar wrote:
| Hello everyone,
|
| I'm looking for the fastest way to get a full mercurial repository of
| HEAD.
|
| I tried using hgsvn and the tree at http://svn.freebsd.org/base/head
| but it looks like the first hgpullsvn operation will take days
(literally):
|
| $ hgimportsvn http://svn.freebsd.org/base/head
| $ cd head
| $ hgpullsvn  <=== This will take a long long time
|
| Does anyone know of a faster way to do this?  Is there a mercurial
| repository out there somewhere from where I can simply "hg clone" my
| copy?

Perhaps someone should share a tarball of the hgpullsvn output,
otherwise it would be a nightmare for svn.freebsd.org...

Another thought would be the hg mirror provided by .fr people, which is
http://hg.fr.freebsd.org/.  Note that this seems to be a CVS sourced one.

- --
Xin LI <[EMAIL PROTECTED]>http://www.delphij.net/
FreeBSD - The Power to Serve!
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.9 (FreeBSD)

iEYEARECAAYFAkicuekACgkQi+vbBBjt66AjNgCgqsUqGXUnIqrPgplIvt7X5Sz8
FowAoJRkW/ITN0I2UxalzK+ykYt8RLcY
=fOap
-END PGP SIGNATURE-
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: mercurial working copy of FreeBSD src

2008-08-08 Thread Václav Haisman

Navdeep Parhar wrote, On 8.8.2008 20:47:

Hello everyone,

I'm looking for the fastest way to get a full mercurial repository of
HEAD.

I tried using hgsvn and the tree at http://svn.freebsd.org/base/head
but it looks like the first hgpullsvn operation will take days (literally):

$ hgimportsvn http://svn.freebsd.org/base/head
$ cd head
$ hgpullsvn  <=== This will take a long long time

Does anyone know of a faster way to do this?  Is there a mercurial
repository out there somewhere from where I can simply "hg clone" my
copy?

Try this one: .



Regards,
Navdeep



--
VH



signature.asc
Description: OpenPGP digital signature


Re: missing interrupts?

2008-08-08 Thread John Baldwin
On Friday 08 August 2008 02:16:20 pm ping wrote:
> this is an interrupt handler that's attached to irq 31 on ioapic1 on a 6.1R 
kernel, type INTR_TYPE_NET|INTR_MPSAFE.  seems that it's missing interrupts.  
watching the KTR trace, it was running along fine, then it just stopped.  
intr handler stopped getting run.  but the interrupt register on chip was 
high.  is this a case of lost interrupts? or hardware problem?

There is one possible race in the I/O APIC code someone pointed me at 
recently.  You can try expanding the scope of the icu_lock to cover all of 
ioapic_program_intpin() to see if it fixes your issue 
(sys///io_apic.c)

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


Re: read with timeout ??

2008-08-08 Thread Chuck Robey
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Carlos A. M. dos Santos wrote:
> On Fri, Aug 8, 2008 at 5:09 AM, Pieter de Goeje <[EMAIL PROTECTED]> wrote:
>> On Friday 08 August 2008, Carlos A. M. dos Santos wrote:
>>> On Thu, Aug 7, 2008 at 10:14 PM, Nate Eldredge <[EMAIL PROTECTED]>
>> wrote:
 On Thu, 7 Aug 2008, Chuck Robey wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> I have my head lost in a code problem.  I just hit a point where I need
> to do a
> read from an fd, but I need to associate it with a timeout, on the order
> of 1
> second, something like that.  I had the feeling that there's a function
> in FreeBSD's libc that makes that simple, but I forget the function
> name.  If anyone can remember something like what I'm talking about, I
> sure would appreciate a function name.  I can figure out how it works,
> if I could only
> dredge up that name.
 man 2 select
>>> If the fd is a socket then you can also use setsockopt(2) to set
>>> SO_RCVTIMEO and check for EWOULDBLOCK (same as EAGAIN) upon read(2) or
>>> recv(2) errors. The net effect is the same of using select but the
>>> syntax is simpler, IMO.
>> I think poll(2) is also simpler than select for this purpose.
> 
> BTW, the setsockopt(2) manual page stands that a send or receive
> timeout returns with the error EWOULDBLOCK but read(2) recv(2) send(2)
> and write(2) only list EAGAIN in their ERRORS section. This is
> harmless on BSD and Linux because EAGAIN and EWOULDBLOCK are the same,
> but may sound confusing for people porting from/to System V. On HP-UX,
> for instance, recv(2) lists both EAGAIN and EWOULDBLOCK.
> 
> The setsockopt man page should be improved in order to explain
> standards conformance and porting issues. I volunteer to do it but the
> changes must be reviewed by a native English speaker.
> 

Carlos, lets not go off on the socket trip for me... while I personally enjoy
such a email, I have to admit my own needs fall more into a plain-jame serial
line, nothing a socket-oriented thing could help me with.

However, if you want to discuss this just fo the fun of it, oh please, by all
means do carry on!
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.9 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkicrPkACgkQz62J6PPcoOmJowCfWPt1jHY4Gx0kOAQedVATHYDd
BGYAoJe6JYuskZZe85AA63sgRBG1VGF0
=dNTn
-END PGP SIGNATURE-
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: read with timeout ??

2008-08-08 Thread Chuck Robey
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Pieter de Goeje wrote:
> On Friday 08 August 2008, Carlos A. M. dos Santos wrote:
>> On Thu, Aug 7, 2008 at 10:14 PM, Nate Eldredge <[EMAIL PROTECTED]> 
> wrote:
>>> On Thu, 7 Aug 2008, Chuck Robey wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 I have my head lost in a code problem.  I just hit a point where I need
 to do a
 read from an fd, but I need to associate it with a timeout, on the order
 of 1
 second, something like that.  I had the feeling that there's a function
 in FreeBSD's libc that makes that simple, but I forget the function
 name.  If anyone can remember something like what I'm talking about, I
 sure would appreciate a function name.  I can figure out how it works,
 if I could only
 dredge up that name.
>>> man 2 select
>> If the fd is a socket then you can also use setsockopt(2) to set
>> SO_RCVTIMEO and check for EWOULDBLOCK (same as EAGAIN) upon read(2) or
>> recv(2) errors. The net effect is the same of using select but the
>> syntax is simpler, IMO.
> 
> I think poll(2) is also simpler than select for this purpose. 
> 

It does look like that, I need to check the implementation a bit, because the
name of this thing makes me really suspicious about how often it checks for an
fd for being ready for a read.  I know select comes right back, I was under the
impression that poll didn't use signals to do this.

Anyhow, I sure do appreciate the hint, that's just exactly what I was asking
for.  Spending the time figuring it all out, that'll actually be fun for  me.
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.9 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkicrC8ACgkQz62J6PPcoOmYjACfWP/IGjSvak1hLYSJwWBKkTjb
8qUAoJfSYOZcPJKMqqUb3Y1mltG51sgI
=USHT
-END PGP SIGNATURE-
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Idea for FreeBSD

2008-08-08 Thread Alex Kozlov
On Fri, Aug 08, 2008 at 09:57:07AM +0100, Vincent Hoffman wrote:
> > On Thu, Aug 07, 2008 at 11:25:39AM -0400, Mike Meyer wrote:
> >> On Thu, 7 Aug 2008 09:15:00 +0300 Alex Kozlov <[EMAIL PROTECTED]> wrote:
> >>> [1]:
> >>> $cat /usr/local/bin/service
> >> Basically what I had in mind, but it can be made more portable across
> >> FreeBSD configurations.
> > [...]
> >> And here's where you go wrong. What you want now is:
> > Yes. This is more correct:
> >   
> Just to save reimplementing the wheel, have a look also at the 
> sysutils/bsdadminscripts port. it has rcstart (and various hardlinks,) 
> which are intended for pretty much what youre intending I think.
Too late, I think. This wheel was reimplemented, and quite some time ago ;-)
Anyway, thanks for the pointer. I'll check on the weekends if pkg_libchk
from bsdadminscripts is a suitable replacement for sysutils/libchk.


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


mercurial working copy of FreeBSD src

2008-08-08 Thread Navdeep Parhar
Hello everyone,

I'm looking for the fastest way to get a full mercurial repository of
HEAD.

I tried using hgsvn and the tree at http://svn.freebsd.org/base/head
but it looks like the first hgpullsvn operation will take days (literally):

$ hgimportsvn http://svn.freebsd.org/base/head
$ cd head
$ hgpullsvn  <=== This will take a long long time

Does anyone know of a faster way to do this?  Is there a mercurial
repository out there somewhere from where I can simply "hg clone" my
copy?

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


Re: Idea for FreeBSD

2008-08-08 Thread Alex Kozlov
On Fri, Aug 08, 2008 at 12:19:54PM +0200, Dag-Erling Smørgrav wrote:
> Alex Kozlov <[EMAIL PROTECTED]> writes:
> > Matthew Seaman <[EMAIL PROTECTED]> writes:
> > > [...]  XML itself is too general-purpose: it has too much baggage
> > > designed for its primary function of facilitating interoperation
> > > between diverse systems in different zones of control, none of which
> > > is particularly applicable to system startup.
> > While in general I agree with You, I must note that We already have
> > xml parser (expat 1.95) for geom. See /lib/libbsdxml.so*
> Non sequitur.  The fact that we have an XML parser in base does not make
> XML more (or less) suitable for the task.
I never said anything like this.
Only that argument about 'to have another shlib or two...
available early in the boot process' is invalid.


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


missing interrupts?

2008-08-08 Thread ping
this is an interrupt handler that's attached to irq 31 on ioapic1 on a 6.1R 
kernel, type INTR_TYPE_NET|INTR_MPSAFE.  seems that it's missing interrupts.  
watching the KTR trace, it was running along fine, then it just stopped.  intr 
handler stopped getting run.  but the interrupt register on chip was high.  is 
this a case of lost interrupts? or hardware problem?

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


Re: read with timeout ??

2008-08-08 Thread Carlos A. M. dos Santos
On Fri, Aug 8, 2008 at 5:09 AM, Pieter de Goeje <[EMAIL PROTECTED]> wrote:
> On Friday 08 August 2008, Carlos A. M. dos Santos wrote:
>> On Thu, Aug 7, 2008 at 10:14 PM, Nate Eldredge <[EMAIL PROTECTED]>
> wrote:
>> > On Thu, 7 Aug 2008, Chuck Robey wrote:
>> >> -BEGIN PGP SIGNED MESSAGE-
>> >> Hash: SHA1
>> >>
>> >> I have my head lost in a code problem.  I just hit a point where I need
>> >> to do a
>> >> read from an fd, but I need to associate it with a timeout, on the order
>> >> of 1
>> >> second, something like that.  I had the feeling that there's a function
>> >> in FreeBSD's libc that makes that simple, but I forget the function
>> >> name.  If anyone can remember something like what I'm talking about, I
>> >> sure would appreciate a function name.  I can figure out how it works,
>> >> if I could only
>> >> dredge up that name.
>> >
>> > man 2 select
>>
>> If the fd is a socket then you can also use setsockopt(2) to set
>> SO_RCVTIMEO and check for EWOULDBLOCK (same as EAGAIN) upon read(2) or
>> recv(2) errors. The net effect is the same of using select but the
>> syntax is simpler, IMO.
>
> I think poll(2) is also simpler than select for this purpose.

BTW, the setsockopt(2) manual page stands that a send or receive
timeout returns with the error EWOULDBLOCK but read(2) recv(2) send(2)
and write(2) only list EAGAIN in their ERRORS section. This is
harmless on BSD and Linux because EAGAIN and EWOULDBLOCK are the same,
but may sound confusing for people porting from/to System V. On HP-UX,
for instance, recv(2) lists both EAGAIN and EWOULDBLOCK.

The setsockopt man page should be improved in order to explain
standards conformance and porting issues. I volunteer to do it but the
changes must be reviewed by a native English speaker.

-- 
If you think things can't get worse it's probably only
because you lack sufficient imagination.
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Idea for FreeBSD

2008-08-08 Thread Dag-Erling Smørgrav
Alex Kozlov <[EMAIL PROTECTED]> writes:
> Matthew Seaman <[EMAIL PROTECTED]> writes:
> > [...]  XML itself is too general-purpose: it has too much baggage
> > designed for its primary function of facilitating interoperation
> > between diverse systems in different zones of control, none of which
> > is particularly applicable to system startup.
> While in general I agree with You, I must note that We already have
> xml parser (expat 1.95) for geom. See /lib/libbsdxml.so*

Non sequitur.  The fact that we have an XML parser in base does not make
XML more (or less) suitable for the task.

DES
-- 
Dag-Erling Smørgrav - [EMAIL PROTECTED]
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Idea for FreeBSD

2008-08-08 Thread Vincent Hoffman

Alex Kozlov wrote:

On Thu, Aug 07, 2008 at 11:25:39AM -0400, Mike Meyer wrote:
  

On Thu, 7 Aug 2008 09:15:00 +0300 Alex Kozlov <[EMAIL PROTECTED]> wrote:


[1]:
$cat /usr/local/bin/service
  

Basically what I had in mind, but it can be made more portable across
FreeBSD configurations.



[...]
  

And here's where you go wrong. What you want now is:


Yes. This is more correct:

  
Just to save reimplementing the wheel, have a look also at the 
sysutils/bsdadminscripts port. it has rcstart (and various hardlinks,) 
which are intended for pretty much what youre intending I think.



Vince

#!/bin/sh

name=$1
cmd=$2

if [ -z "${name}" -o -z "${cmd}" ]; then
echo ${0##*/} service_name command
exit 3
fi

. /etc/rc.subr

load_rc_config ${name}

for dir in /etc/rc.d ${local_startup}; do
if [ -r "${dir}/${name}" ]; then
run_rc_script "${dir}/${name}" ${cmd}
exit 0
fi

if [ -r "${dir}/${name}.sh" ]; then
run_rc_script "${dir}/${name}.sh" ${cmd}
exit 0
fi
done

echo "service '${name}' not found"
exit 2


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


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


Re: read with timeout ??

2008-08-08 Thread Pieter de Goeje
On Friday 08 August 2008, Carlos A. M. dos Santos wrote:
> On Thu, Aug 7, 2008 at 10:14 PM, Nate Eldredge <[EMAIL PROTECTED]> 
wrote:
> > On Thu, 7 Aug 2008, Chuck Robey wrote:
> >> -BEGIN PGP SIGNED MESSAGE-
> >> Hash: SHA1
> >>
> >> I have my head lost in a code problem.  I just hit a point where I need
> >> to do a
> >> read from an fd, but I need to associate it with a timeout, on the order
> >> of 1
> >> second, something like that.  I had the feeling that there's a function
> >> in FreeBSD's libc that makes that simple, but I forget the function
> >> name.  If anyone can remember something like what I'm talking about, I
> >> sure would appreciate a function name.  I can figure out how it works,
> >> if I could only
> >> dredge up that name.
> >
> > man 2 select
>
> If the fd is a socket then you can also use setsockopt(2) to set
> SO_RCVTIMEO and check for EWOULDBLOCK (same as EAGAIN) upon read(2) or
> recv(2) errors. The net effect is the same of using select but the
> syntax is simpler, IMO.

I think poll(2) is also simpler than select for this purpose. 

-- 
Pieter de Goeje

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


Re: em0: The EEPROM Checksum Is Not Valid

2008-08-08 Thread sam

Jeremy Chadwick wrote:

On Thu, Aug 07, 2008 at 08:34:44AM +0400, Vladimir Ermakov wrote:
  

Hello

my trouble with nic

part of `dmesg`  output
-
em0:  port 0xec00-0xec3f mem  
0xfebc-0xfebd,0xfeb8-0xfebb irq 19 at device 2.0 on pci2

em0: The EEPROM Checksum Is Not Valid
device_attach: em0 attach returned 5
--

part of `pciconf -lv` output
--
[EMAIL PROTECTED]:2:2:0: class=0x02 card=0x10018086 chip=0x10268086 rev=0x01  
hdr=0x00

   vendor = 'Intel Corporation'
   device = '82545GM Gigabit Ethernet Controller'
   class  = network
   subclass   = ethernet
--

uname output
--
FreeBSD  7.0-STABLE FreeBSD 7.0-STABLE #2: Wed Jul 16 20:36:12 UTC 2008   
  root@:/usr/obj/usr/src/sys/STONE  i386

--

please, any solution?



Intel probably has a utility to reset the EEPROM settings on the NIC.
Jack Vogel may know where to get such a utility.

I do not believe this problem is FreeBSD-related.

  

thx
took IBAUTIL.EXE from Intel`s site, now my Intel_NIC works

/Vladimir Ermakov

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