Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more than one user can't run groovyserv in the same Unix env. #20

Open
berngp opened this issue Mar 1, 2011 · 7 comments
Open

more than one user can't run groovyserv in the same Unix env. #20

berngp opened this issue Mar 1, 2011 · 7 comments

Comments

@berngp
Copy link
Contributor

berngp commented Mar 1, 2011

Given user userA and user userB
and both users are logged to the same Nix system (Ubuntu, *Fedora, Centos, RedHat)

When they try to run groovyclient -v at different times, then the call will fail for the second one with the following message.

 $ groovyclient -v
  ERROR: cannot open cookie file

or just fail silently.

Logs:
Server started with port: 1961
Unexpected error: GroovyServer
----> java.lang.NullPointerException: Cannot invoke method getAt() on null object
... (ClientProtocols.groovy:100)

@berngp
Copy link
Contributor Author

berngp commented Mar 1, 2011

We have two potential solutions we are working on...

  1. Dynamic port resolution per User.
    1.1 Each user has its own port.

  2. OS FIFOs( aka named pipes) per User per Server one per Client.

    1. Isolation is kept at the user context

    ~/.groovy/groovyserver/server.fifo

    ~/.groovy/groovyserver/clients.fifo.d

    ~/.groovy/groovyserver/scripts

    1. A user will only have one Server listening to its fifo (600)
    2. A client will setup a receiving fifo (600) and a script (600), send a message to the server giving the ref. of the client's fifo and the ref of the script.
    3. Server will receive the message through the fifo, read the script and execute such script sending the output to the client's fifo.

Notes

  • The *Nix queue was dropped since its not supported in all environments unfortunately (windows that is)
  • The term pipe was being used previously but changed to FIFO (aka. named pipe)

@uehaj
Copy link
Contributor

uehaj commented Mar 3, 2011

Hi,Berngp
Thank you for idea.
About 2, you mean use named pipe of Unix instead of TCP domain socket port?
Is there are way to implement this in Windows, without cygwin? Or we have to
use Win32 API directly?

@berngp
Copy link
Contributor Author

berngp commented Mar 3, 2011

Hi Uehaj
Yes FIFOs (aka. named pipes). I am working on a *Nix version of this. I don't have a Windows machine but my understanding is that it supports it natively and through cygwin (Win32 SDK can open them in the same way as files).

@nobeans
Copy link
Member

nobeans commented Mar 24, 2011

I'm considering an automatic mechanism of decision of available port number for each user.
it wasn't in time for v0.6 but I wish I could implement it at v0.7.

@berngp
Copy link
Contributor Author

berngp commented Mar 24, 2011

No worries, haven't worked with the FIFOs (btw JDK 1.7 supports binary sockets.. problem is.. not sure when 1.7 will arrive)

@edwardsd
Copy link

Is there currently a workaround to this issue that would allow groovyserv to be used by multiple users in a shared UNIX environment?

@nobeans
Copy link
Member

nobeans commented Mar 26, 2012

You can specify the port number when invoking groovyserver and groovyclient. please use the different port number for each user.
http://kobo.github.com/groovyserv/userguide_en.html#port-number

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants