From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Mon, 20 Oct 2008 14:48:00 +0200 From: "Rudolf Sykora" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@9fans.net> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_10454_24808918.1224506880052" Subject: [9fans] mount followed by srvfs needs a sleep? Topicbox-Message-UUID: 217698fc-ead4-11e9-9d60-3106f5b1d025 ------=_Part_10454_24808918.1224506880052 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello, I have this function in my lib/profile: fn penelopa{ srv penelopa.karlov.mff.cuni.cz penelopa #to solve the authentication --- see the text bellow mount /srv/penelopa $home/shared/penelopa unmount $home/shared/penelopa local mount /srv/penelopa $home/shared/penelopa #sleep 1 # --- see the text bellow; this pertains to my main question local srvfs CALC $home/shared/penelopa/home/ruda/CPA-CALC #**** local mount /srv/CALC $home/shared/CALC } where local is this script: #!/bin/rc plumb 'Local ' ^ $"* (simply, the commands prepended with 'local' are to be executed by the rc of the plumber). And it doesn't work, the #**** command complaining: not OK (63): chdir(44:"/usr/ruda/shared/penelopa/home/ruda/CPA-CALC"): '/usr followed by a naural complaint from the last command: mount: can't open /srv/CALC: '/srv/CALC' file does not exist However, adding the 'sleep 1' at the shown place remedies the situation and everything suddenly works alright. Can anybody say a word about this? Note: /srv/penelopa is a filesystem on a remote linux-running machine. Also note: this is all about having 'global namespace' --- mounting in some window, seeing everywhere; I have these further instructions in the 'case terminal' part of my 'profile': mntgen $home/shared; srvfs shared $home/shared; plumber; rfork n; mount -c /srv/shared $home/shared; exec rio -i riostart. But this is hopefully only to complete the picture. I hope this is irrelevant as far as my question is concerned... Thanks Ruda PS.: also a related little question: When connecting to a remote machine with a 'srv' command follow by a 'mount' command, the execution of the 'mount' results in a request for entering a username&password. This happens only during the first login attempt. After that no further authentication is required. Now. I somehow use this fact to be able to log in. I first run mount followed by unmount. This requires the login&password. Only then I execute my 'local mount ...' command. If I executed this right away (without mount & unmount) I would end in a situation when the plumber shell needs to talk to me. But this shell writes to the /dev/kprint... What is the better way? (and, actually, is this kind of authentication any safe?) ------=_Part_10454_24808918.1224506880052 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
Hello,

I have this function in my lib/profile:
    fn penelopa{
        srv penelopa.karlov.mff.cuni.cz penelopa

        #to solve the authentication --- see the text bellow
        mount /srv/penelopa $home/shared/penelopa
        unmount $home/shared/penelopa

        local mount /srv/penelopa $home/shared/penelopa
        #sleep 1  # --- see the text bellow; this pertains to my main question
        local srvfs CALC $home/shared/penelopa/home/ruda/CPA-CALC  #****
        local mount /srv/CALC $home/shared/CALC
    }

where local is this script:
    #!/bin/rc
    plumb 'Local ' ^ $"*

(simply, the commands prepended with 'local' are to be executed by the rc of the plumber).
And it doesn't work, the #**** command complaining:

    not OK (63): chdir(44:"/usr/ruda/shared/penelopa/home/ruda/CPA-CALC"): '/usr

followed by a naural complaint from the last command:

    mount: can't open /srv/CALC: '/srv/CALC' file does not exist

However, adding the 'sleep 1' at the shown place remedies the situation and everything suddenly works alright. Can anybody say a word about this?

Note: /srv/penelopa is a filesystem on a remote linux-running machine.
Also note: this is all about having 'global namespace' --- mounting in some window, seeing everywhere; I have these further instructions in the 'case terminal' part of my 'profile': mntgen $home/shared; srvfs shared $home/shared; plumber; rfork n; mount -c /srv/shared $home/shared; exec rio -i riostart. But this is hopefully only to complete the picture. I hope this is irrelevant as far as my question is concerned...

Thanks
Ruda

PS.: also a related little question:
When connecting to a remote machine with a 'srv' command follow by a 'mount' command, the execution of the 'mount' results in a request for entering a username&password. This happens only during the first login attempt. After that no further authentication is required. Now. I somehow use this fact to be able to log in. I first run mount followed by unmount. This requires the login&password. Only then I execute my 'local mount ...' command. If I executed this right away (without mount & unmount) I would end in a situation when the plumber shell needs to talk to me. But this shell writes to the /dev/kprint...
What is the better way?
(and, actually, is this kind of authentication any safe?)
------=_Part_10454_24808918.1224506880052-- From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: To: 9fans@9fans.net From: erik quanstrom Date: Mon, 20 Oct 2008 09:05:56 -0400 In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] mount followed by srvfs needs a sleep? Topicbox-Message-UUID: 218ac25a-ead4-11e9-9d60-3106f5b1d025 > #to solve the authentication --- see the text bellow > mount /srv/penelopa $home/shared/penelopa > unmount $home/shared/penelopa i don't see an explination for this below. what does this accomplish? if you are trying to load more keys into your factotum, this can be more cleanly be done by putting them in secstore(1). secstored(8) will serve them. > local mount /srv/penelopa $home/shared/penelopa > #sleep 1 # --- see the text bellow; this pertains to my main the plumber doesn't require that the command it runs finish before returning. (think of plumbing a file. you don't want to hang until the editor exits.) > question > local srvfs CALC $home/shared/penelopa/home/ruda/CPA-CALC #**** > local mount /srv/CALC $home/shared/CALC why are you doing this? - erik From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Mon, 20 Oct 2008 16:43:32 +0200 From: "Rudolf Sykora" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@9fans.net> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_12009_10620117.1224513812780" References: Subject: Re: [9fans] mount followed by srvfs needs a sleep? Topicbox-Message-UUID: 22218780-ead4-11e9-9d60-3106f5b1d025 ------=_Part_12009_10620117.1224513812780 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 2008/10/20 erik quanstrom > > #to solve the authentication --- see the text bellow > > mount /srv/penelopa $home/shared/penelopa > > unmount $home/shared/penelopa > > i don't see an explination for this below. what does this > accomplish? if you are trying to load more keys into your > factotum, this can be more cleanly be done by putting them > in secstore(1). secstored(8) will serve them. Well. I mentioned this reason in the PS note. I do this only to be able to enter my login and password somehow. If I leave out the mount/unmount commands then the 'local mount' will ask for these instead, but then you can't just enter those --- the input/output goes to somewhere (? /dev/kprint) and you get to a situation that some of what you type goes somewhere, some goes elsewhere... Is it better now? I have no other reason than this one. Further, I just didn't want to really serve those like you propose. I do not have a real reason for this (though I could easily think of some). I am now simply interested in the kind of authentication through giving a login and a password, if it can be made secure (I also asked about this) like eg. an ordinary ssh connection. > > local mount /srv/penelopa $home/shared/penelopa > > #sleep 1 # --- see the text bellow; this pertains to my main > > the plumber doesn't require that the command it runs finish > before returning. (think of plumbing a file. you don't want > to hang until the editor exits.) > Ok, understand. Thus I only either have to find a way to be sure the first command has ended, or just rely it does during that 1s and live with that. > > question > > local srvfs CALC $home/shared/penelopa/home/ruda/CPA-CALC #**** > > local mount /srv/CALC $home/shared/CALC > > why are you doing this? > Ok. By doing all the complicated dance _without_ these two commands, I achieve I have _globally_ accesible files served by the penelopa machine. These files can be accessed under $home/shared/penelopa. But usually I need files from this filesystem that are rather deep down this filesystem, eg. /usr/ruda/shared/penelopa/home/ruda/CPA-CALC/doing/leads/co/up. You just can't work fine with such long paths (in acme you then don't see anything else). So the first idea is to do some bind. And you want to do this bind again in the namespace of the plumber through the 'local' trick (you want this bind to be global too). Further, I want this "bind" to be bound into the '$home/shared' directory, which, however, is taken care of by mntgen (for basically any possible remote connection). I am unable to do bind there (you cannot make a directory when mntgen is running). Thus I decided to again serve a portion of the filesystem (all under /home/ruda/CPA-CALC) and then mount it to $home/shared/CALC, which works. Uff. [It's just so difficult to break the locality of the namespace to make something nicely globally accessible... :))] Hopefully I explained... Ruda ------=_Part_12009_10620117.1224513812780 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline


2008/10/20 erik quanstr= om <quanstro@= quanstro.net>
>         #to solve the authen= tication --- see the text bellow
>         mount /srv/penelopa $home/shared/penelopa<= br> >         unmount $home/shared/penelopa

i don't see an explination for this below.  what does this accomplish?  if you are trying to load more keys into your
factotum, this can be more cleanly be done by putting them
in secstore(1).  secstored(8) will serve them.

We= ll. I mentioned this reason in the PS note. I do this only to be able to en= ter my login and password somehow. If I leave out the mount/unmount command= s then the 'local mount' will ask for these instead, but then you c= an't just enter those --- the input/output goes to somewhere (? /dev/kp= rint) and you get to a situation that some of what you type goes somewhere,= some goes elsewhere... Is it better now? I have no other reason than this = one.
Further, I just didn't want to really serve those like you propose. I d= o not have a real reason for this (though I could easily think of some). I = am now simply interested in the kind of authentication through giving a log= in and a password, if it can be made secure (I also asked about this) like = eg. an ordinary ssh connection.
 
&= gt;         local mount /srv/penelopa $home/shared/pene= lopa
>         #sleep 1  # --- see the text bellow; = this pertains to my main

the plumber doesn't require that the command it runs finish
before returning.  (think of plumbing a file.  you don't want=
to hang until the editor exits.)

Ok, understand. Thus I only either have to find a way to be sure= the first command has ended, or just rely it does during that 1s and live = with that.
 
> question
>         local srvfs CALC $home/shared/penelopa/hom= e/ruda/CPA-CALC  #****
>         local mount /srv/CALC $home/shared/CALC
why are you doing this?

Ok. By doing all the complicated dance _witho= ut_ these two commands, I achieve I have _globally_ accesible files served = by the penelopa machine. These files can be accessed under $home/shared/pen= elopa. But usually I need files from this filesystem that are rather deep d= own this filesystem, eg. /usr/ruda/shared/penelopa/home/ruda/CPA-CALC/doing= /leads/co/up. You just can't work fine with such long paths (in acme yo= u then don't see anything else). So the first idea is to do some bind. = And you want to do this bind again in the namespace of the plumber through = the 'local' trick (you want this bind to be global too). Further, I= want this "bind" to be bound into the '$home/shared' dir= ectory, which, however, is taken care of by mntgen (for basically any possi= ble remote connection). I am unable to do bind there (you cannot make a dir= ectory when mntgen is running). Thus I decided to again serve a portion of = the filesystem (all under /home/ruda/CPA-CALC) and then mount it to $home/s= hared/CALC, which works. Uff.
[It's just so difficult to break the locality of the namespace to make = something nicely globally accessible... :))]

Hopefully I explained.= ..

Ruda
------=_Part_12009_10620117.1224513812780-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Mon, 20 Oct 2008 11:24:29 -0400 To: 9fans@9fans.net Message-ID: <7903a919aa4666b5f751f902c836ebec@coraid.com> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] mount followed by srvfs needs a sleep? Topicbox-Message-UUID: 224282e6-ead4-11e9-9d60-3106f5b1d025 > 2008/10/20 erik quanstrom > > > > #to solve the authentication --- see the text bellow > > > mount /srv/penelopa $home/shared/penelopa > > > unmount $home/shared/penelopa > > > > i don't see an explination for this below. what does this > > accomplish? if you are trying to load more keys into your > > factotum, this can be more cleanly be done by putting them > > in secstore(1). secstored(8) will serve them. > > > Well. I mentioned this reason in the PS note. I do this only to be able to > enter my login and password somehow. If I leave out the mount/unmount > commands then the 'local mount' will ask for these instead, but then you really, use secstore. > Ok. By doing all the complicated dance _without_ these two commands, I > achieve I have _globally_ accesible files served by the penelopa machine. i'm not sure i understand what you are doing. you shouldn't be running plumber as eve (typically bootes) on a cpu server to add stuff to the default namespace. typically what one would do to accomplish what you are doing on a cpu server is to use /lib/namespace.$machine to mount your fs as none, or in this case a user with only read permissions. this will add all the stuff listed to the namespace of any process cpu'ing in. (though not to the console's namespace; this needs to be done in /rc/bin/cpurc.) you can store whatever authentication keys you require in addition to the eve's key in secstore. > Hopefully I explained... sounds very complicated. i'm not sure i understand. - erik From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Mon, 20 Oct 2008 18:06:19 +0200 From: "Rudolf Sykora" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@9fans.net> In-Reply-To: <7903a919aa4666b5f751f902c836ebec@coraid.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <7903a919aa4666b5f751f902c836ebec@coraid.com> Subject: Re: [9fans] mount followed by srvfs needs a sleep? Topicbox-Message-UUID: 224ea0bc-ead4-11e9-9d60-3106f5b1d025 2008/10/20 erik quanstrom > sounds very complicated. i'm not sure i understand. Ok. I thought this was lately partially discussed here http://groups.google.com/group/comp.os.plan9/browse_thread/thread/e8b5e25936f3aff1 even with your participation :), namely see your post followed by the post of Federico G. Benavento. Basically what I wanted was to: from any window be able to issue a simple command that would mount any (not known ahead) remote filesystem AND immediately after that see this filesystem in not only this window but also in ANY window already opened or to be yet opened. Through the trick mentioned (but not really explained; it took me a whole day and lots of frustration to start understanding what the trick really is --- the example there did not actually work for me as presented) in the link in F G Benavento's post I finally achieved the goal. All I need to say now is: srv the_filesystem sth local mount /srv/sth $home/shared/a_name and I have the filesystem immediatelly available under $home/shared/a_name everywhere (new, already opened window, acme...; CTRL-f/ins just completes the names...). (Not really that easy, now I have to use two more commands: the mount/unmount pair for authentication...) So that was my goal. (and while striding towards this end, I bumped into those 2 plumber commands which were not, as you explained, executed in order...) (also, since I want to be able to connect to any, not-known-ahead machine, I don't want to store any information; I want to use a login and a password) Ruda From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Mon, 20 Oct 2008 16:10:22 -0700 From: "Micah Stetson" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@9fans.net> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: Subject: Re: [9fans] mount followed by srvfs needs a sleep? Topicbox-Message-UUID: 22ff367a-ead4-11e9-9d60-3106f5b1d025 > local mount /srv/penelopa $home/shared/penelopa > #sleep 1 # --- see the text bellow; this pertains to my main > question > local srvfs CALC $home/shared/penelopa/home/ruda/CPA-CALC #**** > local mount /srv/CALC $home/shared/CALC I haven't actually tried this, so I probably shouldn't be writing it, but.... How about this: local 'rc -c ''mount blah blah && srvfs blah blah && mount blah blah''' > login&password. Only then I execute my 'local mount ...' command. If I > executed this right away (without mount & unmount) I would end in a > situation when the plumber shell needs to talk to me. But this shell writes > to the /dev/kprint... > What is the better way? I think this is the problem auth/fgui is supposed to solve. See factotum(4). > (and, actually, is this kind of authentication any safe?) In what way? Have you read /sys/doc/auth.ps? Micah From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Tue, 21 Oct 2008 10:26:47 +0200 From: "Rudolf Sykora" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@9fans.net> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: Subject: Re: [9fans] mount followed by srvfs needs a sleep? Topicbox-Message-UUID: 23626f6a-ead4-11e9-9d60-3106f5b1d025 2008/10/21 Micah Stetson : >> local mount /srv/penelopa $home/shared/penelopa >> #sleep 1 # --- see the text bellow; this pertains to my main >> question >> local srvfs CALC $home/shared/penelopa/home/ruda/CPA-CALC #**** >> local mount /srv/CALC $home/shared/CALC > > I haven't actually tried this, so I probably shouldn't be writing it, > but.... How about this: > > local 'rc -c ''mount blah blah && srvfs blah blah && mount blah blah''' Well, this seems really nice. I wonder why this did not come to my mind too... :) I guess sth like this will work... Thanks >> login&password. Only then I execute my 'local mount ...' command. If I >> executed this right away (without mount & unmount) I would end in a >> situation when the plumber shell needs to talk to me. But this shell writes >> to the /dev/kprint... >> What is the better way? > > I think this is the problem auth/fgui is supposed to solve. See factotum(4). > >> (and, actually, is this kind of authentication any safe?) > > In what way? Have you read /sys/doc/auth.ps? > > Micah I read auth.ps some time ago, I will read it again as well as factotum(4). Hopefully I will find the answers. Thanks Ruda