[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [flashproxy/master] Add instructions for building the Cumulus server.



commit 67d49a45b114ac93b9fe36592509bf9fd1c2804b
Author: David Fifield <david@xxxxxxxxxxxxxxx>
Date:   Fri Jun 17 01:19:34 2011 -0700

    Add instructions for building the Cumulus server.
---
 Cumulus-no-manage-log.patch |   39 ++++++++++++++++++++++++++++++
 README                      |   32 +++++++++++++++++++++++++
 cumulus                     |   55 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 126 insertions(+), 0 deletions(-)

diff --git a/Cumulus-no-manage-log.patch b/Cumulus-no-manage-log.patch
new file mode 100644
index 0000000..810b52d
--- /dev/null
+++ b/Cumulus-no-manage-log.patch
@@ -0,0 +1,39 @@
+Don't try to re-open log files. This avoids a failure after --daemon
+causes a chdir to /.
+
+diff --git a/CumulusService/sources/main.cpp b/CumulusService/sources/main.cpp
+index 891621f..39ea4eb 100644
+--- a/CumulusService/sources/main.cpp
++++ b/CumulusService/sources/main.cpp
+@@ -132,7 +132,6 @@ protected:
+ 	void dumpHandler(const char* data,int size) {
+ 		cout.write(data,size);
+ 		_logStream.write(data,size);
+-		manageLogFile();
+ 	}
+ 
+ 	void logHandler(Thread::TID threadId,const std::string& threadName,Priority priority,const char *filePath,long line, const char *text) {
+@@ -140,23 +139,6 @@ protected:
+ 		_logStream << DateTimeFormatter::format(LocalDateTime(),"%d/%m %H:%M:%S.%c  ")
+ 				<< g_logPriorities[priority-1] << '\t' << threadName << '(' << threadId << ")\t"
+ 				<< Path(filePath).getFileName() << '[' << line << "]  " << text << std::endl;
+-		manageLogFile();
+-	}
+-
+-	void manageLogFile() {
+-		if(_logFile.getSize()>LOG_SIZE) {
+-			_logStream.close();
+-			int num = 10;
+-			File file(LOG_FILE(10));
+-			if(file.exists())
+-				file.remove();
+-			while(--num>=0) {
+-				file = LOG_FILE_VAR(num);
+-				if(file.exists())
+-					file.renameTo(LOG_FILE_VAR(num+1));
+-			}
+-			_logStream.open(LOG_FILE(0),ios::in | ios::ate);
+-		}	
+ 	}
+ 
+ 	bool onConnection(Client& client) {
diff --git a/README b/README
index 4b6a2dc..ccde8b9 100644
--- a/README
+++ b/README
@@ -94,6 +94,38 @@ try deleting the files in ~/.tor or /var/lib/tor.
 You will be able to see byte counts flowing in the browser window, and
 eventually be able to build a circuit.
 
+== Building the Cumulus RTMFP server
+
+There is a free RTMFP rendezvous server called Cumulus. It is a
+replacement for the Adobe Cirrus service at rtmfp://p2p.rtmfp.net/.
+These are instructions to build and install it.
+
+First install the prerequisite libpoco, http://poco.sourceforge.net/.
+You only need the "Basic Edition."
+	# apt-get install libpoco-dev
+or
+	$ cd poco-VERSION
+	$ ./configure && make
+	# make install
+
+Follow these steps to install the Cumulus server. You need to open port
+1935/udp in the firewall.
+	$ git clone git://github.com/OpenRTMFP/Cumulus.git
+	$ cd Cumulus
+	$ patch -p0 < Cumulus-no-manage-log.patch
+	$ cd CumulusLib
+	$ make LIBS=./
+	# cp libCumulus.so /usr/local/lib
+	$ cd ../../CumulusService
+	$ make
+	# cp CumulusService /usr/local/bin
+	# useradd -d /dev/null -s /bin/false cumulus
+	# mkdir /var/cumulus
+	# chown -R cumulus.cumulus /var/cumulus
+	# cp flashproxy/cumulus /etc/init.d/cumulus
+	# chkconfig --add cumulus
+	# service cumulus start
+
 == Rationale
 
 The purpose of this project is to create many, generally ephemeral
diff --git a/cumulus b/cumulus
new file mode 100755
index 0000000..7fdac3e
--- /dev/null
+++ b/cumulus
@@ -0,0 +1,55 @@
+#!/bin/sh
+#
+# cumulus      This shell script takes care of starting and stopping
+#              the Cumulus server.
+#
+# chkconfig: 2345 90 10
+# description: Cumulus RTMFP server.
+# processname: CumulusService
+# pidfile: /var/cumulus/cumulus.pid
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+BINDIR=/usr/local/bin
+VARDIR=/var/cumulus
+CUMULUS=$BINDIR/CumulusService
+PIDFILE=$VARDIR/cumulus.pid
+USER=cumulus
+
+# See how we were called.
+case "$1" in
+  start)
+	[ -x $CUMULUS ] || exit 1
+	echo -n $"Starting Cumulus server: "
+	cd $VARDIR && daemon --user cumulus --pidfile $PIDFILE $CUMULUS --daemon --pidfile=$PIDFILE
+	RETVAL=$?
+	echo
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/cumulus
+	;;
+  stop)
+	# Stop daemon.
+	echo -n $"Shutting down Cumulus server: "
+	killproc CumulusService
+	RETVAL=$?
+	echo
+	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/cumulus
+	;;
+  status)
+	status cumulus
+	RETVAL=$?
+	;;
+  restart|reload)
+	$0 stop
+	$0 start
+	;;
+  condrestart)
+	[ -f /var/lock/subsys/cumulus ] && restart || :
+	;;
+  *)
+	echo $"Usage: $0 {start|stop|status|restart}"
+	RETVAL=3
+	;;
+esac
+
+exit $RETVAL



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits