1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-08 17:45:24 +02:00

Add MacOS X startup scripts

This commit is contained in:
David Dykstal 2006-06-19 16:07:06 +00:00
parent bee2092643
commit 4c8908a591
5 changed files with 122 additions and 4 deletions

View file

@ -32,7 +32,6 @@ import java.util.ArrayList;
import javax.net.ssl.HandshakeCompletedEvent;
import javax.net.ssl.HandshakeCompletedListener;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLServerSocket;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSocket;
@ -292,13 +291,13 @@ public class ServerLauncher extends Thread
}
else
{
//read over stuff coming from the login shell invocation
// look for the server startup string, it needs to occur somewhere in the line.
String status = _errReader.readLine();
while (status!=null && !status.equals(ServerReturnCodes.RC_DSTORE_SERVER_MAGIC))
while (status!=null && (status.indexOf(ServerReturnCodes.RC_DSTORE_SERVER_MAGIC) < 0))
{
status = _errReader.readLine();
}
//now read the real server status
// now read the real server status
if (status != null)
{
status = _errReader.readLine();

View file

@ -0,0 +1,46 @@
#!/usr/bin/perl -w
# Assumes the $CLASSPATH environment variable is set.
# Assumes password is supplied on STDIN.
# Sets return code of 0 on failure, 1 on success.
$user=`whoami`; chomp($user);
if ($user ne "root") {
print "The root user must run the authorization script.\n";
exit 0;
}
$argc = @ARGV;
if ($argc < 5 || $argc > 6) {
print("command usage:\n");
print("auth.pl USER PATH PORT TIMEOUT TICKET [JAVA_HOME]\n");
exit 0;
}
$user = $ARGV[0];
$plugin_path = $ARGV[1];
$port = $ARGV[2];
$timeout = $ARGV[3];
$ticket = $ARGV[4];
if ($argc == 6) {
$java = $ARGV[5]."/bin/java";
} else {
$java = "java";
}
$password = <STDIN>; chomp($password);
open(CHECK, "su $user -c 'perl check.pl $password'|");
$rc = <CHECK>; chomp($rc);
close(CHECK);
if ($rc > 0) {
printf("Invalid password.\n");
exit 0;
}
print "success\n";
$classpath = $ENV{CLASSPATH};
$server = "org.eclipse.dstore.core.server.Server";
$inner_command = "$java -cp $classpath -DA_PLUGIN_PATH=$plugin_path -DDSTORE_SPIRIT_ON=true $server $port $timeout $ticket";
$outer_command = "su $user -l -c '$inner_command'";
system($outer_command);
exit 1;

View file

@ -0,0 +1,13 @@
#!/usr/bin/perl -w
# On MacOS X the password check must be run under the user's uid.
# If the password is OK, prints "0\n" to STDOUT.
# If not OK, prints "1\n" on STDOUT.
# Password prompt and errors are sent to the bit bucket.
$password = $ARGV[0];
$user = `whoami`; chomp($user);
$rc = system ("echo $password | su $user -c 'echo 0' 2> /dev/null");
if ($rc > 0) {
print "1\n";
}

View file

@ -0,0 +1,51 @@
#!/usr/bin/perl -w
# Arguments:
# ARGV[0] is the port number for the daemon to listen on. Default is 4035.
# ARGV[1] is the directory that contains RSE Dstore server jar files and
# installation supplied miner class files. The default is the working
# directory.
#
# Environment Variables:
# CLASSPATH - used to form the tail of the classpath for the daemon and server execution.
# DSTORE_TRACING_ON - 0 means to not trace, 1 means to trace.
# DSTORE_DEBUG_ON - 0 means to start in normal mode, 1 means to start in debug mode.
#
# Results:
# Returns 1 if there is a startup error of some sort.
# Does not return if the daemon starts successfully. Terminate the
# daemon with a signal such as TERM or INT.
$port = $ARGV[0] || "4035";
$plugin_dir = $ARGV[1] || $ENV{PWD};
$trace = $ENV{DSTORE_TRACING_ON} || "0";
$debug = $ENV{DSTORE_DEBUG_ON} || "0";
$user=`whoami`; chomp($user);
if ($user ne "root") {
print "The root user must run the RSE DStore server daemon.\n";
exit 1;
}
if ($debug) {
$debug_options = "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000";
} else {
$debug_options = "";
}
$classpath_old = $ENV{CLASSPATH};
$classpath = "$plugin_dir";
$classpath .= ":$plugin_dir/dstore_extra_server.jar";
$classpath .= ":$plugin_dir/dstore_core.jar";
$classpath .= ":$plugin_dir/dstore_miners.jar";
$classpath .= ":$plugin_dir/clientserver.jar";
if ($classpath_old) {
$classpath .= ":$classpath_old";
}
$ENV{CLASSPATH} = $classpath;
$launcher = "org.eclipse.dstore.core.server.ServerLauncher";
$command = "java $debug_options -DA_PLUGIN_PATH=$plugin_dir -DDSTORE_TRACING_ON=$trace $launcher $port";
print "$command\n";
system($command);

View file

@ -0,0 +1,9 @@
#!/bin/sh
# Shell script to start RSE communications server
# This script will start the datastore server listening on an available socket
export serverpath=.;
export CLASSPATH=.:dstore_extra_server.jar:dstore_core.jar:dstore_miners.jar:clientserver.jar:$CLASSPATH;
if [ $1 ]
then java -DA_PLUGIN_PATH=$serverpath -DDSTORE_TRACING_ON=false -Dclient.username=$1 -DDSTORE_SPIRIT_ON=true org.eclipse.dstore.core.server.Server 0 60000 &
else java -DA_PLUGIN_PATH=$serverpath -DDSTORE_TRACING_ON=false -DDSTORE_SPIRIT_ON=true org.eclipse.dstore.core.server.Server 0 60000 &
fi