9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] replica
@ 2006-08-25  2:30 Richard Bilson
  2006-08-25  3:38 ` Lyndon Nerenberg
  2006-08-25 14:22 ` [9fans] Pegasus 2.2 is released arisawa
  0 siblings, 2 replies; 39+ messages in thread
From: Richard Bilson @ 2006-08-25  2:30 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

I attempted to update my system using replica tonight, using glenda's
pull script, but as bootes and from the file server console. What
seems to have happened is that replica believed that every file ought
to be deleted. I stopped it before it made it out of /sys/src, so my
system is still usable.

Questions:

- Why?

- What can I do to avoid this in future?

- Is there an easy way to get the files resynchronized with sources?
If I try "replica/pull -v /dist/replica/network", it tells me

sys/src/9/ip/devip.c: not replicated; will not update
sys/src/9/pc/etherigbe.c: not replicated; will not update
sys/src/9/pc/fns.h: not replicated; will not update

etc.

I just realized that I didn't have a writable /tmp, so the pull would
have failed anyway, but I usually expect an error message in this
case, not devastation.

- Richard


^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [9fans] replica
  2006-08-25  2:30 [9fans] replica Richard Bilson
@ 2006-08-25  3:38 ` Lyndon Nerenberg
  2006-08-25  4:08   ` geoff
  2006-08-25 14:22 ` [9fans] Pegasus 2.2 is released arisawa
  1 sibling, 1 reply; 39+ messages in thread
From: Lyndon Nerenberg @ 2006-08-25  3:38 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> - What can I do to avoid this in future?

Don't Panic!

It's not just you -- I saw the same thing when I ran pull this afternoon. 
It kind of looks like Russ pushed some changes that had the side effect of 
touching a whole lot of stuff.  Or maybe was intentional -- I had to leave 
before it was done, but my that point it was already putting stuff back.

I'll try to drawterm into the server in a little while and see how it's 
doing.


^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [9fans] replica
  2006-08-25  3:38 ` Lyndon Nerenberg
@ 2006-08-25  4:08   ` geoff
  2006-08-25  8:19     ` Martin Neubauer
  0 siblings, 1 reply; 39+ messages in thread
From: geoff @ 2006-08-25  4:08 UTC (permalink / raw)
  To: 9fans

Our main file server, edith, developed bad spots in its /n/other
partition, so we took /n/other out of service until we sort it out.
Unfortunately, a lot of the machinery that maintains sources lives
there.  We'll be working on this problem on Friday.



^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [9fans] replica
  2006-08-25  4:08   ` geoff
@ 2006-08-25  8:19     ` Martin Neubauer
  2006-08-27 23:23       ` geoff
  0 siblings, 1 reply; 39+ messages in thread
From: Martin Neubauer @ 2006-08-25  8:19 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

* geoff@plan9.bell-labs.com (geoff@plan9.bell-labs.com) wrote:
> Our main file server, edith, developed bad spots in its /n/other
> partition, so we took /n/other out of service until we sort it out.
> Unfortunately, a lot of the machinery that maintains sources lives
> there.  We'll be working on this problem on Friday.

No sweat. I ran a pull last night, too, and all the current situation
means is that everything gets thrown away and pulled afresh afterwards.
Not for the faint of heart though.


^ permalink raw reply	[flat|nested] 39+ messages in thread

* [9fans] Pegasus 2.2 is released
  2006-08-25  2:30 [9fans] replica Richard Bilson
  2006-08-25  3:38 ` Lyndon Nerenberg
@ 2006-08-25 14:22 ` arisawa
  2006-08-26  1:56   ` Skip Tavakkolian
  2006-08-26 19:29   ` Skip Tavakkolian
  1 sibling, 2 replies; 39+ messages in thread
From: arisawa @ 2006-08-25 14:22 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Hello,

Pegasus 2.2 is released.
New supports are digest authentication, CGI/1.1, etc.
and some CGI tools are added.

Take a look at http://plan9.aichi-u.ac.jp/pegasus/eman-2.2/
The source files are http://plan9.aichi-u.ac.jp/netlib/pegasus-2.2.tgz

Bug report to me.
Please enjoy!

Kenji Arisawa
Email: arisawa@aichi-u.ac.jp




^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [9fans] Pegasus 2.2 is released
  2006-08-25 14:22 ` [9fans] Pegasus 2.2 is released arisawa
@ 2006-08-26  1:56   ` Skip Tavakkolian
  2006-08-26  4:36     ` arisawa
  2006-08-26 19:29   ` Skip Tavakkolian
  1 sibling, 1 reply; 39+ messages in thread
From: Skip Tavakkolian @ 2006-08-26  1:56 UTC (permalink / raw)
  To: 9fans

> Pegasus 2.2 is released.
> New supports are digest authentication, CGI/1.1, etc.
> and some CGI tools are added.

this is great.  rit is cool.  i'm wondering now that js is available
in plan9, if it could be integrated into a cgi environment? it seems
that rit could easily run different types of script handlers and invoke
them like <!--js ... --> or <!--rc --> since that's a natural
syntax for html.

would it be difficult to integrate this digest authentication into
standard httpd?



^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [9fans] Pegasus 2.2 is released
  2006-08-26  1:56   ` Skip Tavakkolian
@ 2006-08-26  4:36     ` arisawa
  2006-08-30  1:32       ` Lyndon Nerenberg
  0 siblings, 1 reply; 39+ messages in thread
From: arisawa @ 2006-08-26  4:36 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Hello,

> it seems
> that rit could easily run different types of script handlers and  
> invoke
> them like <!--js ... --> or <!--rc --> since that's a natural
> syntax for html.

I also considered that, and finally stopped to do so.
That makes things complicated and makes coding difficult.
If we want other scripting tool, we can do it as a command of "rc".
I love "rc". "rc" is best for me.

Of course js can be embedded in text part of rc as follows:
	some text <!--js ... -> other text
	${ # rc codes follow ..
	.....}
  	text continues

> would it be difficult to integrate this digest authentication into
> standard httpd?

Implementing digest authentication is not difficult.
However, if we want to change owner of running httpd by digest  
authentication,
then we should consider many many problems.

Thanks Skip for your comments.

Kenji Arisawa



^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [9fans] Pegasus 2.2 is released
  2006-08-25 14:22 ` [9fans] Pegasus 2.2 is released arisawa
  2006-08-26  1:56   ` Skip Tavakkolian
@ 2006-08-26 19:29   ` Skip Tavakkolian
  2006-08-26 21:51     ` arisawa
  1 sibling, 1 reply; 39+ messages in thread
From: Skip Tavakkolian @ 2006-08-26 19:29 UTC (permalink / raw)
  To: 9fans

> The source files are http://plan9.aichi-u.ac.jp/netlib/pegasus-2.2.tgz

is rit packaged separately?



^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [9fans] Pegasus 2.2 is released
  2006-08-26 19:29   ` Skip Tavakkolian
@ 2006-08-26 21:51     ` arisawa
  2006-08-29  4:10       ` [9fans] " Dave Eckhardt
  0 siblings, 1 reply; 39+ messages in thread
From: arisawa @ 2006-08-26 21:51 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> is rit packaged separately?
>

Yes, look http://plan9.aichi-u.ac.jp/netlib/

Kenji Arisawa



^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [9fans] replica
  2006-08-25  8:19     ` Martin Neubauer
@ 2006-08-27 23:23       ` geoff
  2006-08-28  2:46         ` Richard Bilson
  0 siblings, 1 reply; 39+ messages in thread
From: geoff @ 2006-08-27 23:23 UTC (permalink / raw)
  To: 9fans

jmk recovered edith's /n/other onto a new disk on Friday.  The old
disk had developed bad spots and trying to read it wedged edith,
repeatedly and with no messages.

With some guidance from Russ, I've restored
/n/sourcesdump/2006/0824/plan9/dist/replica/plan9.^(db log) on
sources.  pull -n at collyer.net seems to be sane again, so I hope it
will be for everyone else.



^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [9fans] replica
  2006-08-27 23:23       ` geoff
@ 2006-08-28  2:46         ` Richard Bilson
  0 siblings, 0 replies; 39+ messages in thread
From: Richard Bilson @ 2006-08-28  2:46 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> With some guidance from Russ, I've restored
> /n/sourcesdump/2006/0824/plan9/dist/replica/plan9.^(db log) on
> sources.  pull -n at collyer.net seems to be sane again, so I hope it
> will be for everyone else.

Works for me too. Thanks very much for getting this working again.

- Richard


^ permalink raw reply	[flat|nested] 39+ messages in thread

* [9fans] Re: Pegasus 2.2 is released
  2006-08-26 21:51     ` arisawa
@ 2006-08-29  4:10       ` Dave Eckhardt
  2006-08-29  8:16         ` arisawa
  0 siblings, 1 reply; 39+ messages in thread
From: Dave Eckhardt @ 2006-08-29  4:10 UTC (permalink / raw)
  To: 9fans

My apologies for the broadcast, but my mail to Kenji Arisawa
timed out after failing for 3 days as follows:

   ----- Transcript of session follows -----
... while talking to ar.aichi-u.ac.jp.:
>>> DATA
<<< 450 deferred: smtp ping: smtp: dns: dns failure (/net/tcp!lunacy.ugrad.cs.cmu.edu)
<arisawa@ar.aichi-u.ac.jp>... Deferred: 450 deferred: smtp ping: smtp: dns: dns failure (/net/tcp!lunacy.ugrad.cs
.cmu.edu)

If it looks as if this is due to something on this end, please
let me know...

Dave Eckhardt


^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [9fans] Re: Pegasus 2.2 is released
  2006-08-29  4:10       ` [9fans] " Dave Eckhardt
@ 2006-08-29  8:16         ` arisawa
  2006-08-29 19:57           ` erik quanstrom
  0 siblings, 1 reply; 39+ messages in thread
From: arisawa @ 2006-08-29  8:16 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Hello Dave,

It seems my machine "ar.aichi-u.ac.jp" dislikes your machine  
"lunacy.ugrad.cs.cmu.edu",
although your machine is observed by the command ndb/dnsdebug on my  
machine.
I don't know the reason. Sorry...

Please send your mail to my official mail address: arisawa@aichi-u.ac.jp

Kenji Arisawa



^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [9fans] Re: Pegasus 2.2 is released
  2006-08-29  8:16         ` arisawa
@ 2006-08-29 19:57           ` erik quanstrom
  2006-08-30  5:39             ` Dave Eckhardt
  0 siblings, 1 reply; 39+ messages in thread
From: erik quanstrom @ 2006-08-29 19:57 UTC (permalink / raw)
  To: 9fans

cmu.edu is returning bogus results.  dig from linux returns "connection reset" on tcp and a truncated
query on udp.  ndb/dnsquery has better results, but for returns only this for a "cmu.edu any" query

; ndb/dnsquery
> cmu.edu any
cmu.edu txt	[NRDR16452_IN_MX_10.CMU-MX1.ANDREW.CMU.EDU.wRx2sgedR34KMLeiHlkHpA]
> cmu.edu ip
cmu.edu ip	128.2.10.162
cmu.edu ip	128.2.10.163

- erik



^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [9fans] Pegasus 2.2 is released
  2006-08-26  4:36     ` arisawa
@ 2006-08-30  1:32       ` Lyndon Nerenberg
  0 siblings, 0 replies; 39+ messages in thread
From: Lyndon Nerenberg @ 2006-08-30  1:32 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> Implementing digest authentication is not difficult.
> However, if we want to change owner of running httpd by digest 
> authentication,
> then we should consider many many problems.

Digest is a bit of a hybrid in that it does authentication, and also 
provides data integrity and protection.  It would be nice to implement the 
transport layer part in a manner analogous to TLS.  I'm currently hacking 
on Plan 9's IMAP support, and SASL DIGEST with encryption is high on the 
TODO list. (It's a toss-up as to whether DIGEST-MD5 or STARTTLS has the 
wider deployment, but software that supports one tends not to support the 
other, so it's useful to have both for interoperability's sake.)

--lyndon


^ permalink raw reply	[flat|nested] 39+ messages in thread

* [9fans] Re: Pegasus 2.2 is released
  2006-08-29 19:57           ` erik quanstrom
@ 2006-08-30  5:39             ` Dave Eckhardt
  2006-08-30 23:59               ` erik quanstrom
  0 siblings, 1 reply; 39+ messages in thread
From: Dave Eckhardt @ 2006-08-30  5:39 UTC (permalink / raw)
  To: 9fans

> cmu.edu is returning bogus results.  dig from linux returns "connection
> reset" on tcp and a truncated query on udp.

Weird--not for me (off campus and not particularly short-haul).

What I see with dig, straight at the 3 CMU.EDU servers, is a response
truncated due to "excessive" size (e.g., 779 bytes) and apparently-ok
responses via TCP.  That is:

	dig +tcp @t-ns2-sec.net.cmu.edu any cmu.edu
	dig +tcp @cabbage.srv.cs.cmu.edu any cmu.edu
	dig +tcp @t-ns1.net.cmu.edu any cmu.edu

If I ask my LinkSys, what I get back is 102 bytes--lots of stuff trimmed
out, apparently by speakeasy.net DNS servers.

Are the queries failing for you being made directly, or is there maybe
some issue involving an intermediate DNS server?

Thanks for letting me know something odd is going on...

Dave Eckhardt


^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [9fans] Re: Pegasus 2.2 is released
  2006-08-30  5:39             ` Dave Eckhardt
@ 2006-08-30 23:59               ` erik quanstrom
  2006-08-31  8:11                 ` [9fans] i need someone to pinpoint a sample program for me : ) bituman
  0 siblings, 1 reply; 39+ messages in thread
From: erik quanstrom @ 2006-08-30 23:59 UTC (permalink / raw)
  To: 9fans

i was using the Level3-provided dns servers (speakeasy dialup).
it all seems better today.

- erik


^ permalink raw reply	[flat|nested] 39+ messages in thread

* [9fans] i need someone to pinpoint a sample program for me : )
  2006-08-30 23:59               ` erik quanstrom
@ 2006-08-31  8:11                 ` bituman
  2006-08-31 10:18                   ` Gabriel Diaz
                                     ` (2 more replies)
  0 siblings, 3 replies; 39+ messages in thread
From: bituman @ 2006-08-31  8:11 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Ahoi all...
Ive been using my plan9 installation for a while. Now i feel comfortable 
enough to start some coding.
Im like lets starts something basic (basic might be a relative term), 
like a server that exports a ctl and a data file,
every line written to ctl can be read from data with the letters sorted.
Id like someone to pinpoint a sample program for me that exports files, 
the most basic such program will do the trick i guess.
Thanks in advance
bituman


^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [9fans] i need someone to pinpoint a sample program for me : )
  2006-08-31  8:11                 ` [9fans] i need someone to pinpoint a sample program for me : ) bituman
@ 2006-08-31 10:18                   ` Gabriel Diaz
  2006-08-31 12:52                     ` rog
  2006-08-31 15:30                     ` David Leimbach
  2006-08-31 15:05                   ` Sergey Zhilkin
  2006-09-05 20:25                   ` Sascha Retzki
  2 siblings, 2 replies; 39+ messages in thread
From: Gabriel Diaz @ 2006-08-31 10:18 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Hello

a great sample is /sys/src/lib9p/ramfs.c

gabi


On 8/31/06, bituman <bituman@enerla.net> wrote:
> Ahoi all...
> Ive been using my plan9 installation for a while. Now i feel comfortable
> enough to start some coding.
> Im like lets starts something basic (basic might be a relative term),
> like a server that exports a ctl and a data file,
> every line written to ctl can be read from data with the letters sorted.
> Id like someone to pinpoint a sample program for me that exports files,
> the most basic such program will do the trick i guess.
> Thanks in advance
> bituman
>


^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [9fans] i need someone to pinpoint a sample program for me : )
  2006-08-31 10:18                   ` Gabriel Diaz
@ 2006-08-31 12:52                     ` rog
  2006-08-31 13:38                       ` Gabriel Diaz
  2006-08-31 15:30                     ` David Leimbach
  1 sibling, 1 reply; 39+ messages in thread
From: rog @ 2006-08-31 12:52 UTC (permalink / raw)
  To: 9fans

> a great sample is /sys/src/lib9p/ramfs.c

actually, i don't find this a particularly good example, because it implements
an arbitrarily structured namespace, whereas most simpler fileservers serve
a static or highly structured namespace.

9p(2) can remove some of the drudgework.


^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [9fans] i need someone to pinpoint a sample program for me : )
  2006-08-31 12:52                     ` rog
@ 2006-08-31 13:38                       ` Gabriel Diaz
  2006-08-31 13:52                         ` Russ Cox
  2006-08-31 14:05                         ` rog
  0 siblings, 2 replies; 39+ messages in thread
From: Gabriel Diaz @ 2006-08-31 13:38 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Hello,

I put the sample thinking more on 9p than in ramfs particulary.

With that ramfs.c, 9p(2) and 9pfile(2) is "easy" to build what he
wants. At least i found it easier than reading nntpfs.c and the other
samples that do not use 9p and have a syntetic fs.

I think this has been discused in 9fans time ago, but didn't remember
what the conclusion was (producing more samples :-? )

nemo's book looks promising, i will read it to learn some things too.
I hope that the "magic" around the qids,fids and refs get explained.

gabi


On 8/31/06, rog@vitanuova.com <rog@vitanuova.com> wrote:
> > a great sample is /sys/src/lib9p/ramfs.c
>
> actually, i don't find this a particularly good example, because it implements
> an arbitrarily structured namespace, whereas most simpler fileservers serve
> a static or highly structured namespace.
>
> 9p(2) can remove some of the drudgework.
>


^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [9fans] i need someone to pinpoint a sample program for me : )
  2006-08-31 13:38                       ` Gabriel Diaz
@ 2006-08-31 13:52                         ` Russ Cox
  2006-08-31 14:04                           ` rog
  2006-08-31 14:05                         ` rog
  1 sibling, 1 reply; 39+ messages in thread
From: Russ Cox @ 2006-08-31 13:52 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> nemo's book looks promising, i will read it to learn some things too.
> I hope that the "magic" around the qids,fids and refs get explained.

after reading intro(5) there should be no magic around qids and fids anymore.
and ref is just a reference count.

russ


^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [9fans] i need someone to pinpoint a sample program for me : )
  2006-08-31 13:52                         ` Russ Cox
@ 2006-08-31 14:04                           ` rog
  2006-09-07 23:54                             ` Russ Cox
  0 siblings, 1 reply; 39+ messages in thread
From: rog @ 2006-08-31 14:04 UTC (permalink / raw)
  To: 9fans

> after reading intro(5) there should be no magic around qids and fids anymore.
> and ref is just a reference count.

i have thought in the past that the man pages could make it
clearer how ref counts interact with clunk - i.e. that a client will never
send a clunk while there are outstanding transactions on the fid.
this (i think) falls naturally from the way things are implemented
in plan 9, but might not be obvious to those writing servers (or
new clients).


^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [9fans] i need someone to pinpoint a sample program for me : )
  2006-08-31 13:38                       ` Gabriel Diaz
  2006-08-31 13:52                         ` Russ Cox
@ 2006-08-31 14:05                         ` rog
  1 sibling, 0 replies; 39+ messages in thread
From: rog @ 2006-08-31 14:05 UTC (permalink / raw)
  To: 9fans

> I put the sample thinking more on 9p than in ramfs particulary.

... and i'm sorry because i didn't read the source path name properly. i'd forgotten
there was a ramfs example in lib9p, and was thinking you'd pointed to /sys/src/cmd/ramfs.c
which is a different beast entirely (and has been recommended as an example in the past).
i'd agree that /sys/src/lib9p/ramfs.c is a useful example.


^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [9fans] i need someone to pinpoint a sample program for me : )
  2006-08-31  8:11                 ` [9fans] i need someone to pinpoint a sample program for me : ) bituman
  2006-08-31 10:18                   ` Gabriel Diaz
@ 2006-08-31 15:05                   ` Sergey Zhilkin
  2006-09-05 20:25                   ` Sascha Retzki
  2 siblings, 0 replies; 39+ messages in thread
From: Sergey Zhilkin @ 2006-08-31 15:05 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 661 bytes --]

Hi !!!
Here is a sample - http://rs-rlab.narod.ru/dev9b.html
Documentation in russian (sorry)
Have a nice day ! :)


2006/8/31, bituman <bituman@enerla.net>:
>
> Ahoi all...
> Ive been using my plan9 installation for a while. Now i feel comfortable
> enough to start some coding.
> Im like lets starts something basic (basic might be a relative term),
> like a server that exports a ctl and a data file,
> every line written to ctl can be read from data with the letters sorted.
> Id like someone to pinpoint a sample program for me that exports files,
> the most basic such program will do the trick i guess.
> Thanks in advance
> bituman
>

[-- Attachment #2: Type: text/html, Size: 968 bytes --]

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: Re: [9fans] i need someone to pinpoint a sample program for me : )
  2006-08-31 10:18                   ` Gabriel Diaz
  2006-08-31 12:52                     ` rog
@ 2006-08-31 15:30                     ` David Leimbach
  2006-08-31 15:32                       ` David Leimbach
  1 sibling, 1 reply; 39+ messages in thread
From: David Leimbach @ 2006-08-31 15:30 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On 8/31/06, Gabriel Diaz <gabidiaz@gmail.com> wrote:
> Hello
>
> a great sample is /sys/src/lib9p/ramfs.c
>
I disagree, I tried to learn from that and the code seems to make some
shortcuts around certain issues.  It also seems to label itself as a
"toy" in the comments.

It works well enough for how I'm using it though :-)

> gabi
>
>
> On 8/31/06, bituman <bituman@enerla.net> wrote:
> > Ahoi all...
> > Ive been using my plan9 installation for a while. Now i feel comfortable
> > enough to start some coding.
> > Im like lets starts something basic (basic might be a relative term),
> > like a server that exports a ctl and a data file,
> > every line written to ctl can be read from data with the letters sorted.
> > Id like someone to pinpoint a sample program for me that exports files,
> > the most basic such program will do the trick i guess.
> > Thanks in advance
> > bituman
> >
>


^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: Re: Re: [9fans] i need someone to pinpoint a sample program for me : )
  2006-08-31 15:30                     ` David Leimbach
@ 2006-08-31 15:32                       ` David Leimbach
  0 siblings, 0 replies; 39+ messages in thread
From: David Leimbach @ 2006-08-31 15:32 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On 8/31/06, David Leimbach <leimy2k@gmail.com> wrote:
> On 8/31/06, Gabriel Diaz <gabidiaz@gmail.com> wrote:
> > Hello
> >
> > a great sample is /sys/src/lib9p/ramfs.c
> >
> I disagree, I tried to learn from that and the code seems to make some
> shortcuts around certain issues.  It also seems to label itself as a
> "toy" in the comments.
>
> It works well enough for how I'm using it though :-)

Heh, looks like I made the same mistake as rog.... D'oh!
>
> > gabi
> >
> >
> > On 8/31/06, bituman <bituman@enerla.net> wrote:
> > > Ahoi all...
> > > Ive been using my plan9 installation for a while. Now i feel comfortable
> > > enough to start some coding.
> > > Im like lets starts something basic (basic might be a relative term),
> > > like a server that exports a ctl and a data file,
> > > every line written to ctl can be read from data with the letters sorted.
> > > Id like someone to pinpoint a sample program for me that exports files,
> > > the most basic such program will do the trick i guess.
> > > Thanks in advance
> > > bituman
> > >
> >
>


^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [9fans] i need someone to pinpoint a sample program for me : )
  2006-08-31  8:11                 ` [9fans] i need someone to pinpoint a sample program for me : ) bituman
  2006-08-31 10:18                   ` Gabriel Diaz
  2006-08-31 15:05                   ` Sergey Zhilkin
@ 2006-09-05 20:25                   ` Sascha Retzki
  2 siblings, 0 replies; 39+ messages in thread
From: Sascha Retzki @ 2006-09-05 20:25 UTC (permalink / raw)
  To: 9fans

> Ahoi all...
> Im like lets starts something basic (basic might be a relative term), 
> like a server that exports a ctl and a data file,
> every line written to ctl can be read from data with the letters sorted.


I did something like this some long time ago, I was told that using 9p(2)/9pfile(2) for such tiny things, which file structure does not change much is not suggested - I actually did not get that.

Anyway, this may not even compile, I copied out of a source-tree. You want to read it and understand every line, anyway, do you? ;)

#include <u.h>
#include <libc.h>
#include <fcall.h>
#include <thread.h>
#include <9p.h>

Srv *daefs;

/*
our file layout. Note that the enum Qstatus is
used in daefsfiles_create() to determine the size
of the array. Either fix the function or add files 
(in any) before Qstatus.
*/
enum {
	Qctl,
	Qout,
	Qstatus,
};
struct {
	char name[20]; /* name of the file */
	ulong mode;	/* permission mode */
	File *file;		/* File-struct used by createfile() */
	char *data;	/* The data this file contains */
} daefsfiles[] = {
	"ctl",		0666, nil, nil,
	"output",	0444, nil, nil,
	"status",	0444, nil, nil,
};



void daefs_write(Req *r) {
	int i, myQid = (int)r->fid->file->qid.path;

	if(myQid > Qstatus)
			sysfatal("unknown Qid %d in write-call\n",myQid);

	for(i=0;i+r->ifcall.offset < FILESIZE && i < r->ifcall.count;i++) {
		daefsfiles[myQid].data[i+r->ifcall.offset] = r->ifcall.data[i];
		r->ofcall.count++;
	}
	daefsfiles[myQid].file->length = r->ifcall.offset + r->ifcall.count;

	
	if(myQid == Qctl) {
		char *msg = daefsfiles[Qctl].data;
		// Do your processing...

		// Copy the string
		strcpy(daefsfiles[Qstatus].data,msg);
		// Do not forget to set the new length of the file, for stat(5) etc.
		daefsfiles[Qstatus].file->length =  strlen(msg);
	}

	respond(r,nil);
}

void daefs_read(Req *r) {
	readstr(r,daefsfiles[(int)r->fid->file->qid.path].data);
	respond(r,nil);	
}


void daefsfiles_create(void) {
	int i;

	if((daefs->tree = alloctree("daefs","daefs",DMDIR|0777,nil)) == nil)
		sysfatal("daefs: daefsfiles_create(): alloctree() == nil");

	for(i=0;i<=Qstatus;i++) {

		daefsfiles[i].data = emalloc9p(FILESIZE);

		if((daefsfiles[i].file = createfile(daefs->tree->root, daefsfiles[i].name,"daefs", daefsfiles[i].mode,(void *)daefsfiles[i].data)) == nil)
			sysfatal("daefs: daefsfiles_create() for file \"%s\": createfile() == nil\n",daefsfiles[i].name);

	}

	daefs_status("ready\n");
}

void main(int argc, char **argv) {
	char *mtpt = "/n/daefs/";
	daefs = emalloc9p(sizeof(Srv));
	daefs->write = daefs_write;
	daefs->read = daefs_read;
	daefsfiles_create();
	threadpostmountsrv(daefs,"daefs",mtpt,0);
}



^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [9fans] i need someone to pinpoint a sample program for me : )
  2006-08-31 14:04                           ` rog
@ 2006-09-07 23:54                             ` Russ Cox
  0 siblings, 0 replies; 39+ messages in thread
From: Russ Cox @ 2006-09-07 23:54 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> i have thought in the past that the man pages could make it
> clearer how ref counts interact with clunk - i.e. that a client will never
> send a clunk while there are outstanding transactions on the fid.
> this (i think) falls naturally from the way things are implemented
> in plan 9, but might not be obvious to those writing servers (or
> new clients).

i don't actually know how ref counts interact with clunk.
certainly the plan 9 kernels don't send clunks of fids with
transactions outstanding, but there is nothing in section 5
that says this is a requirement, and even if there were,
robust servers would do well to detect that case anyway.

much of the ref counting in lib9p exists for exactly this purpose,
to do something sensible even when the client doesn't.

russ


^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [9fans] replica
  2005-02-12 13:42 [9fans] replica Sergey Reva
@ 2005-02-12 16:15 ` Russ Cox
  0 siblings, 0 replies; 39+ messages in thread
From: Russ Cox @ 2005-02-12 16:15 UTC (permalink / raw)
  To: Sergey Reva, Fans of the OS Plan 9 from Bell Labs

> When pull reached /usr/glenda/lib/profile it write '... file does not exist...'
> (i remove glenda user from my system).
>
> Does it mean replica/pull broken (and some files after /usr dir not
> processed) or it's only report at end of work?

errors are reported at the end.

> Why not change 'clientroot' (in replica profile) to '/root'? It's
> should work in kfs and fossil too.

the existence of /root is a side-effect of the boot script.
i'd rather that things didn't depend on it.  also if you have
rootdir set in plan9.ini then /root and / may be very
different trees.  finally, it won't work for fossil since
we need to arrange a special non-permissions-checked
connection for people who don't like putting themselves
in group sys.

russ


^ permalink raw reply	[flat|nested] 39+ messages in thread

* [9fans] replica
@ 2005-02-12 13:42 Sergey Reva
  2005-02-12 16:15 ` Russ Cox
  0 siblings, 1 reply; 39+ messages in thread
From: Sergey Reva @ 2005-02-12 13:42 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Hello Fans

I got new installation cd, and use replica/pull
I change 'cd' profile from kfs to fossil target, and run replica/pull.

When pull reached /usr/glenda/lib/profile it write '... file does not exist...'
(i remove glenda user from my system).

Does it mean replica/pull broken (and some files after /usr dir not
processed) or it's only report at end of work?

Why not change 'clientroot' (in replica profile) to '/root'? It's
should work in kfs and fossil too.


--
http://rs-rlab.narod.ru                          mailto:rs_rlab@mail.ru



^ permalink raw reply	[flat|nested] 39+ messages in thread

* [9fans] replica
@ 2004-03-24 13:20 David Presotto
  0 siblings, 0 replies; 39+ messages in thread
From: David Presotto @ 2004-03-24 13:20 UTC (permalink / raw)
  To: 9fans

I've rebuilt rio, sam, acme, and vnc{vs} for the keyboard.h change.  I've
also rebuilt aux/vga since it was getting behind.

Make sure you've removed any spaces around = in your /lib/vgadb.  I've already
done it on the sources one.


^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [9fans] replica
@ 2002-07-30 12:15 Russ Cox
  0 siblings, 0 replies; 39+ messages in thread
From: Russ Cox @ 2002-07-30 12:15 UTC (permalink / raw)
  To: 9fans

> When I have some local change to a file, replica reports it without telling me
> what was changed in the replica server.  Sometime, I want to know what was
> changed at Labs, because I have no such solid confidence to myself in many
> case.  ;_;   
> 
> May I ask you to put the changed file of the replica server to my local disk 
> with modifying the name, say such kenji.c to kenji.c.p9bell?

i really don't want to start copying random files
around when there are conflicts.

i don't care about most of them and don't want to spend the time
downloading.

you could use this script though.

g% cat /bin/updiff
#!/bin/rc

rfork e

path = (/bin/)

d = /n/sources/plan9

if(! test -e $d) 9fs sources

for(i in $*){
	echo '=====' $i '====='
	ls -lmd $i
	switch($i){
	case /*
		diff -n $d/$i $i 
	case *
		i = `{cleanname -d `{pwd} $i}
		diff  -n $d/$i $i
	}
}
g% cd /sys/src/cmd
g% updiff tar.c
===== tar.c =====
[] --rw-rw-r-- M 8 glenda sys 12030 Feb 28 15:04 tar.c
/n/sources/plan9//sys/src/cmd/tar.c:268,269 c /sys/src/cmd/tar.c:268
< 	/* the mode test is ugly but sometimes necessary */
< 	if (dblock.dbuf.linkflag == '5' || (sp->mode&0170000) == 040000) {
---
> 	if(dblock.dbuf.linkflag == '5')
/n/sources/plan9//sys/src/cmd/tar.c:271,272 d /sys/src/cmd/tar.c:269
< 		sp->mode |= DMDIR;
< 	}
g%



^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [9fans] replica
@ 2002-07-04 10:20 Fco.J.Ballesteros
  0 siblings, 0 replies; 39+ messages in thread
From: Fco.J.Ballesteros @ 2002-07-04 10:20 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 123 bytes --]

I think -sn would see them.  (you tell it to use the server version
to resolve conflicts, but not to update your files).

[-- Attachment #2: Type: message/rfc822, Size: 5659 bytes --]

[-- Attachment #2.1.1: Type: text/plain, Size: 311 bytes --]

Can replica/pull -n see the changes after I updated the changes?

I updated too many files in a long time, so I came off the desk, and did
other obligations I have for money.   If I could have some backup files
for locally changed ones, I can check it later, and give enough time to
do that...

Kenji


[-- Attachment #2.1.2: Type: message/rfc822, Size: 3889 bytes --]

[-- Attachment #2.1.2.1.1: Type: text/plain, Size: 206 bytes --]

I do a replica/pull -n to see the changes,
then I use diff or acme to look at what changed if I'm not willing
to pull them without looking first at them.

perhaps this may achieve the effect you want.

[-- Attachment #2.1.2.1.2: Type: message/rfc822, Size: 1762 bytes --]

From: okamoto@granite.cias.osakafu-u.ac.jp
To: 9fans@cse.psu.edu
Subject: [9fans] replica
Date: Thu, 4 Jul 2002 18:21:37 +0900
Message-ID: <20020704092234.344EE19988@mail.cse.psu.edu>

Don't laugh me even though I was much delayed to see replica(1). ^_^
Yeah! Replica is very nice interface to maintain and distribute solid
trees of Plan 9.   Thanks everyone who have worked for it.

I have one request here.

When I have some local change to a file, replica reports it without telling me
what was changed in the replica server.  Sometime, I want to know what was
changed at Labs, because I have no such solid confidence to myself in many
case.  ;_;   

May I ask you to put the changed file of the replica server to my local disk 
with modifying the name, say such kenji.c to kenji.c.p9bell?

Kenji

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [9fans] replica
@ 2002-07-04 10:16 okamoto
  0 siblings, 0 replies; 39+ messages in thread
From: okamoto @ 2002-07-04 10:16 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 311 bytes --]

Can replica/pull -n see the changes after I updated the changes?

I updated too many files in a long time, so I came off the desk, and did
other obligations I have for money.   If I could have some backup files
for locally changed ones, I can check it later, and give enough time to
do that...

Kenji


[-- Attachment #2: Type: message/rfc822, Size: 3889 bytes --]

[-- Attachment #2.1.1: Type: text/plain, Size: 206 bytes --]

I do a replica/pull -n to see the changes,
then I use diff or acme to look at what changed if I'm not willing
to pull them without looking first at them.

perhaps this may achieve the effect you want.

[-- Attachment #2.1.2: Type: message/rfc822, Size: 1762 bytes --]

From: okamoto@granite.cias.osakafu-u.ac.jp
To: 9fans@cse.psu.edu
Subject: [9fans] replica
Date: Thu, 4 Jul 2002 18:21:37 +0900
Message-ID: <20020704092234.344EE19988@mail.cse.psu.edu>

Don't laugh me even though I was much delayed to see replica(1). ^_^
Yeah! Replica is very nice interface to maintain and distribute solid
trees of Plan 9.   Thanks everyone who have worked for it.

I have one request here.

When I have some local change to a file, replica reports it without telling me
what was changed in the replica server.  Sometime, I want to know what was
changed at Labs, because I have no such solid confidence to myself in many
case.  ;_;   

May I ask you to put the changed file of the replica server to my local disk 
with modifying the name, say such kenji.c to kenji.c.p9bell?

Kenji

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [9fans] replica
@ 2002-07-04  9:26 Fco.J.Ballesteros
  0 siblings, 0 replies; 39+ messages in thread
From: Fco.J.Ballesteros @ 2002-07-04  9:26 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 206 bytes --]

I do a replica/pull -n to see the changes,
then I use diff or acme to look at what changed if I'm not willing
to pull them without looking first at them.

perhaps this may achieve the effect you want.

[-- Attachment #2: Type: message/rfc822, Size: 1762 bytes --]

From: okamoto@granite.cias.osakafu-u.ac.jp
To: 9fans@cse.psu.edu
Subject: [9fans] replica
Date: Thu, 4 Jul 2002 18:21:37 +0900
Message-ID: <20020704092234.344EE19988@mail.cse.psu.edu>

Don't laugh me even though I was much delayed to see replica(1). ^_^
Yeah! Replica is very nice interface to maintain and distribute solid
trees of Plan 9.   Thanks everyone who have worked for it.

I have one request here.

When I have some local change to a file, replica reports it without telling me
what was changed in the replica server.  Sometime, I want to know what was
changed at Labs, because I have no such solid confidence to myself in many
case.  ;_;   

May I ask you to put the changed file of the replica server to my local disk 
with modifying the name, say such kenji.c to kenji.c.p9bell?

Kenji

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [9fans] replica
@ 2002-07-04  9:21 okamoto
  0 siblings, 0 replies; 39+ messages in thread
From: okamoto @ 2002-07-04  9:21 UTC (permalink / raw)
  To: 9fans

Don't laugh me even though I was much delayed to see replica(1). ^_^
Yeah! Replica is very nice interface to maintain and distribute solid
trees of Plan 9.   Thanks everyone who have worked for it.

I have one request here.

When I have some local change to a file, replica reports it without telling me
what was changed in the replica server.  Sometime, I want to know what was
changed at Labs, because I have no such solid confidence to myself in many
case.  ;_;   

May I ask you to put the changed file of the replica server to my local disk 
with modifying the name, say such kenji.c to kenji.c.p9bell?

Kenji



^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [9fans] replica
@ 2002-05-29 16:32 Russ Cox
  0 siblings, 0 replies; 39+ messages in thread
From: Russ Cox @ 2002-05-29 16:32 UTC (permalink / raw)
  To: 9fans

> the advantage of keeping a hash (eg, md5 or sha1) is that it distinguishes
> contents of files, which usually is what really matters,
> whereas modification times and file length by themselves
> aren't really adequate (in general, in my experience).

> in short, i thought the use of hash values in wrap was a good idea
> and was surprised it wasn't part of replica!

i may well have dropped the ball on this one.
i'm still not sure.  replica was written only
for the distribution and as such i had little
experience with it before sending it into battle.
originally i used only mtimes and thought that
having the local metadata kept by the file system
was a feature, so you could play games if you knew
what you were doing.  then i got talked into using lengths
too (and rightfully so), and at that point i should
probably have tossed in the hash.
at this point it's hard to add fields to the database
and the log, since the current replica tools won't
like that.

i originally planned to use tra but it was clear that
tra wouldn't be solid enough by the time it was
needed.  once i understand things better i may set
up tra as an alternate way to get updates.  what i like
best about tra is that it's completely general.

with replica you have to declare a server to be the single
point of truth, and if you try to chain things (e.g.,
you try to grab updates using a different machine as
server, or vita nuova adds or tweaks some files) then
you have to be careful, because in general you can't
just grab updates from any other machine and expect everything
to work.

if we were using tra, you could install a new system
using any other plan 9 system you had available on the
network, and it would still be safe to go back to
sources for updates.  i still want to see what that
would be like, but it won't happen until the fall.

russ


^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [9fans] replica
@ 2002-05-29  9:43 forsyth
  0 siblings, 0 replies; 39+ messages in thread
From: forsyth @ 2002-05-29  9:43 UTC (permalink / raw)
  To: 9fans

>>Then you have to spend time downloading the
>>remote file when most of the time you're going to throw it away
>>because the local file _has_ been locally modified.
>>I could have included sha1 hashes in the replica(8) metadata.
>>Oh well.  I expected this not to happen very often,
>>and so far have not been proved wrong.

the advantage of keeping a hash (eg, md5 or sha1) is that it distinguishes
contents of files, which usually is what really matters,
whereas modification times and file length by themselves
aren't really adequate (in general, in my experience).  Qid.path and Qid.vers
might do i suppose, but are unique to Plan 9, and even they can change
when the contents of a file hasn't actually changed.  the hash makes it easier
to track versions historically (eg, if i have a file with a given hash code,
i can check distribution packages or logs to see whether that file was
ever actually distributed as it stands, and if so, when).  similarly,
if i've got an external replica, i can also use
the hash values to relate it to the contents of a (worm) file system dump.
there is a risk with hashing of false hits, but perhaps venti suggests
that people can be relaxed about that if the hash is peculiar enough.

in short, i thought the use of hash values in wrap was a good idea
and was surprised it wasn't part of replica!



^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2006-09-07 23:54 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-25  2:30 [9fans] replica Richard Bilson
2006-08-25  3:38 ` Lyndon Nerenberg
2006-08-25  4:08   ` geoff
2006-08-25  8:19     ` Martin Neubauer
2006-08-27 23:23       ` geoff
2006-08-28  2:46         ` Richard Bilson
2006-08-25 14:22 ` [9fans] Pegasus 2.2 is released arisawa
2006-08-26  1:56   ` Skip Tavakkolian
2006-08-26  4:36     ` arisawa
2006-08-30  1:32       ` Lyndon Nerenberg
2006-08-26 19:29   ` Skip Tavakkolian
2006-08-26 21:51     ` arisawa
2006-08-29  4:10       ` [9fans] " Dave Eckhardt
2006-08-29  8:16         ` arisawa
2006-08-29 19:57           ` erik quanstrom
2006-08-30  5:39             ` Dave Eckhardt
2006-08-30 23:59               ` erik quanstrom
2006-08-31  8:11                 ` [9fans] i need someone to pinpoint a sample program for me : ) bituman
2006-08-31 10:18                   ` Gabriel Diaz
2006-08-31 12:52                     ` rog
2006-08-31 13:38                       ` Gabriel Diaz
2006-08-31 13:52                         ` Russ Cox
2006-08-31 14:04                           ` rog
2006-09-07 23:54                             ` Russ Cox
2006-08-31 14:05                         ` rog
2006-08-31 15:30                     ` David Leimbach
2006-08-31 15:32                       ` David Leimbach
2006-08-31 15:05                   ` Sergey Zhilkin
2006-09-05 20:25                   ` Sascha Retzki
  -- strict thread matches above, loose matches on Subject: below --
2005-02-12 13:42 [9fans] replica Sergey Reva
2005-02-12 16:15 ` Russ Cox
2004-03-24 13:20 David Presotto
2002-07-30 12:15 Russ Cox
2002-07-04 10:20 Fco.J.Ballesteros
2002-07-04 10:16 okamoto
2002-07-04  9:26 Fco.J.Ballesteros
2002-07-04  9:21 okamoto
2002-05-29 16:32 Russ Cox
2002-05-29  9:43 forsyth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).