Summary: | Cannot start UNIX server.sh on a fixed port | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Tools] Target Management | Reporter: | Martin Oberhuber <mober.at+eclipse> | ||||||||
Component: | RSE | Assignee: | David McKnight <dmcknigh> | ||||||||
Status: | RESOLVED FIXED | QA Contact: | Martin Oberhuber <mober.at+eclipse> | ||||||||
Severity: | normal | ||||||||||
Priority: | P2 | Keywords: | contributed | ||||||||
Version: | 1.0 | ||||||||||
Target Milestone: | 3.0 M6 | ||||||||||
Hardware: | Sun | ||||||||||
OS: | Unix All | ||||||||||
Whiteboard: | |||||||||||
Attachments: |
|
Description
Martin Oberhuber
2006-11-13 05:24:20 EST
Dave -- Can you look at this too? Seems like it should be a simple script change. 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? I just fixed it for Solaris / Bourne Shell. The original script is from IBM. I'd prefer to not do this. Can you look at this one, Kushal? Back to Dave since Kushal can't be active any more. Bulk update target milestone 2.0.1 -> 3.0 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
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? 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. I've committed the fix for this to cvs. Thanks for the patch, Patrick! 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]; 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.
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. 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.
In what respect didn't it work? It works fine for me: server.sh -help (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. marking this fixed now. Comment on attachment 80725 [details]
Server.sh fixed for port selection
Marking iplog+ since parts of the patch were used in the end.
|