Bug 164300 - Cannot start UNIX server.sh on a fixed port
Summary: Cannot start UNIX server.sh on a fixed port
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 1.0   Edit
Hardware: Sun Unix All
: P2 normal (vote)
Target Milestone: 3.0 M6   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2006-11-13 05:24 EST by Martin Oberhuber CLA
Modified: 2011-05-25 07:16 EDT (History)
0 users

See Also:


Attachments
Server.sh fixed for port selection (1.29 KB, patch)
2007-10-18 22:23 EDT, patrick juhl CLA
mober.at+eclipse: iplog+
Details | Diff
patch to handle port, timeout and clientUserID (2.46 KB, patch)
2008-03-04 10:47 EST, David McKnight CLA
no flags Details | Diff
patch with suggestions from martin (6.92 KB, patch)
2008-03-04 11:34 EST, David McKnight CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Oberhuber CLA 2006-11-13 05:24:20 EST
From the rseserver-1.0-unix.tar archive, the server.sh script does not allow
starting the RSE server on a fixed port (while the Linux server.pl does).

This is unfortunate, since connecting to a running server always requires setting the remote port number in the subsystem Properties. So, if the portnumber changes on every server launch, this is very annoying. Also, it is inconsistent with the Linux version.

UNIX and Mac server.sh should behave exactly like the Linux server.pl

-----------Enter bugs above this line-----------
RSE 1.0 Release Test
installation : WR wb19vx17gpp, based on eclipse-platform-3.2.1 (M20060921-0945)
RSE install  : RSE 1.0 update-site: all runtime + all experimental
java.runtime : Sun 1.5.0_08-b03
os.name      : solaris-motif: Solaris 9 9/04 s9s_u7wos_09 SPARC
os.uname     : SunOS szg-anar 5.9 Generic_118558-06 sun4u SUNW,Sun-Blade-1500
------------------------------------------------
systemtype   : Dstore-windows, Dstore-unix, Solaris-local, Ssh
targetos     : Windows XP SP1, and others
targetuname  : Windows
targetvm     : Sun 1.5.0_08-b03
------------------------------------------------
Comment 1 David Dykstal CLA 2007-01-03 17:28:16 EST
Dave --
Can you look at this too? Seems like it should be a simple script change.
Comment 2 David McKnight CLA 2007-01-26 09:21:38 EST
Martin, I think you were the contributor of the server.sh script (at least that's what the copyrights indicate).  Do you want to do this one?
Comment 3 Martin Oberhuber CLA 2007-01-26 09:25:25 EST
I just fixed it for Solaris / Bourne Shell.
The original script is from IBM.
I'd prefer to not do this.
Comment 4 David McKnight CLA 2007-02-21 09:08:46 EST
Can you look at this one, Kushal?
Comment 5 Martin Oberhuber CLA 2007-07-12 08:38:07 EDT
Back to Dave since Kushal can't be active any more.
Comment 6 Martin Oberhuber CLA 2007-10-01 07:57:02 EDT
Bulk update target milestone 2.0.1 -> 3.0
Comment 7 patrick juhl CLA 2007-10-18 22:23:17 EDT
Created attachment 80725 [details]
Server.sh fixed for port selection

Legal Message: I, Patrick Juhl, declare that I developed attached code from scratch, without referencing any 3rd party materials except material licensed under the EPL. {I am authorized by my employer to make this contribution under the EPL.}

Use: perl ./server.sh [Port]
If no port is specified, a random port will be chosen


Extra:
Bug#: 206843 doc error for file name server.sh
Comment 8 David McKnight CLA 2007-10-19 11:48:39 EDT
Looking at the script, it appears that we used to use the first parameter as an indicator for the client.username.  I think that was a special case that IBM's z-series product had for indicating where to stick tracing info.  Since this product provides it's on start scripts, I don't see this as needed.  The provided patch makes more sense to me.

Martin, I don't have a proper environment to test this out with, do you?
Comment 9 Martin Oberhuber CLA 2008-02-28 16:18:57 EST
Dave can you apply this patch please. I think we need it for running automated unit tests on our dsdp.eclipse.org build server against dstore.
Comment 10 David McKnight CLA 2008-03-03 11:03:20 EST
I've committed the fix for this to cvs.  Thanks for the patch, Patrick!
Comment 11 Martin Oberhuber CLA 2008-03-04 09:02:27 EST
Dave did you review the patch before applying it? It does not seem right:

java [...] -Dclient.username=$1 [...] org.eclipse.dstore.core.server.Server $1

so username == server port?

Please review again, and especially ensure that we do the same thing as on other Platforms e.g. Linux/server.pl which does this:

$port = $ARGV[0];
$timeout = $ARGV[1];
$packaged_as = $ARGV[2];
$clientUserID = $ARGV[3];
Comment 12 David McKnight CLA 2008-03-04 10:47:56 EST
Created attachment 91521 [details]
patch to handle port, timeout and clientUserID

I've attached a patch including support for the port, timeout and clientUserID.  Client UserID is used so that server logging can be made for a user other than $USER on the server side (for example in the case where multiple clients share the same server id).  I didn't include the packaged_as argument since I think that was for a rare debugging scenario that I don't think anyone uses.
Comment 13 Martin Oberhuber CLA 2008-03-04 10:53:49 EST
What about this:

if [ $# -gt 2 ]; then
  clientUserID=$3
fi
if [ $# -gt 1 ]; then
  timeout=$2
fi
if [ $# -gt 0 ]; then
  port=$1
fi

case x$port in
  x-h*) echo "Usage: server.sh [port] [timeout] [clientUserId]"
        exit 0
        ;;
esac

Also, if you get rid of the package stuff, please get rid of it in the other servers as well. I really want usage to be consistent across all Platforms. And, please add docs about usage to the User Docs if you can.
Comment 14 David McKnight CLA 2008-03-04 11:34:08 EST
Created attachment 91534 [details]
patch with suggestions from martin

I updated the patch to include your suggestions although I didn't include the:

case x$port in
  x-h*) echo "Usage: server.sh [port] [timeout] [clientUserId]"
        exit 0
        ;;
esac

since that doesn't work for me.
Comment 15 Martin Oberhuber CLA 2008-03-04 11:37:38 EST
In what respect didn't it work? It works fine for me:
   server.sh -help
Comment 16 David McKnight CLA 2008-03-04 11:46:09 EST
(In reply to comment #15)
> In what respect didn't it work? It works fine for me:
>    server.sh -help

oops... nevermind that then.  I've committed the changes to cvs.
Comment 17 David McKnight CLA 2008-03-05 13:47:50 EST
marking this fixed now.
Comment 18 Martin Oberhuber CLA 2011-05-25 07:16:05 EDT
Comment on attachment 80725 [details]
Server.sh fixed for port selection

Marking iplog+ since parts of the patch were used in the end.