summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Low <lostlogic@gentoo.org>2003-09-08 22:02:14 +0000
committerBrandon Low <lostlogic@gentoo.org>2003-09-08 22:02:14 +0000
commit356f85a4ef594a6cbb13303e6e3e60939cb1afc5 (patch)
treec391dd149e9f0220a2353e71268ef2b51dfbd6a7 /net-p2p/freenet/files
parentBugfix, direct to stable (diff)
downloadgentoo-2-356f85a4ef594a6cbb13303e6e3e60939cb1afc5.tar.gz
gentoo-2-356f85a4ef594a6cbb13303e6e3e60939cb1afc5.tar.bz2
gentoo-2-356f85a4ef594a6cbb13303e6e3e60939cb1afc5.zip
Bugfix, direct to stable
Diffstat (limited to 'net-p2p/freenet/files')
-rw-r--r--net-p2p/freenet/files/digest-freenet-0.5.2.1-r61
-rw-r--r--net-p2p/freenet/files/rc.freenet478
2 files changed, 79 insertions, 0 deletions
diff --git a/net-p2p/freenet/files/digest-freenet-0.5.2.1-r6 b/net-p2p/freenet/files/digest-freenet-0.5.2.1-r6
new file mode 100644
index 000000000000..a9b4651be0e9
--- /dev/null
+++ b/net-p2p/freenet/files/digest-freenet-0.5.2.1-r6
@@ -0,0 +1 @@
+MD5 59270ee48d889e0be9cae584b67d2743 freenet-0.5.2.1.tar.gz 2118774
diff --git a/net-p2p/freenet/files/rc.freenet4 b/net-p2p/freenet/files/rc.freenet4
new file mode 100644
index 000000000000..f62b0f1faaeb
--- /dev/null
+++ b/net-p2p/freenet/files/rc.freenet4
@@ -0,0 +1,78 @@
+#!/sbin/runscript
+# Gentoo freenet init.d-script
+#
+# This script requires the companion script start-freenet.sh to do it's
+# job. This script is needed to facilitate full logging of freenet.
+#
+# Also requires the /etc/conf.d/freenet file to be configured correctly.
+#
+# Gentoo Maintainer: Brandon Low <lostlogic@gentoo.org>
+# Authors: Per Wigren <wigren@home.se>
+# Brandon Low <lostlogic@gentoo.org>
+#
+
+depend() {
+ need net
+}
+
+check_config() {
+ if [ -z "${FREENET_NICENESS}" ] || [ -z "${JAVA_OPTIONS}" ]; then
+ eerror "Please set all options in /etc/conf.d/freenet"
+ return 1
+ fi
+ if [ ! -f /etc/freenet.conf ]; then
+ eerror "To configure freenet, please run:"
+ eerror "# ebuild /usr/portage/net-p2p/freenet/freenet-[version].ebuild"
+ return 1
+ fi
+ return 0
+}
+
+start() {
+ JAVA="$(java-config --java)"
+ #The JVMs don't support NPTL yet, so this is necessary
+ export LD_ASSUME_KERNEL=2.4.1
+
+ check_config || return 1
+
+ ebegin "Starting Freenet now"
+ if [ ! -f /usr/lib/freenet/freenet-ext.jar ]; then
+ ewarn "freenet-ext.jar not found. It can be downloaded from"
+ ewarn "http://freenetproject.org/snapshots/freenet-ext.jar"
+ eend 1
+ return 1
+ fi
+ if [ ! -f /var/freenet/seednodes.ref ]; then
+ ewarn "seednodes.ref not found, you can download some seeds"
+ ewarn "from http://hawk.freenetproject.org/~freenet4/seednodes.ref"
+ eend 1
+ return 1
+ fi
+
+ CLASSPATH=/usr/lib/freenet/freenet.jar:/usr/lib/freenet/freenet-ext.jar:$CLASSPATH
+
+ # if Sun JDK set -server option as suggested on mailing list
+ if [ ! -z "`${JAVA} -help 2>&1 | grep '[-]server'`" ]; then
+ JAVA_ARGS="-server"
+ else
+ JAVA_ARGS=""
+ fi
+ JAVA_ARGS="${JAVA_ARGS} ${JAVA_OPTIONS}"
+ ulimit -n 4096
+ # Had to change off of using start-stop-daemon to start it,
+ # because of suckage. This allows us to log the stdout and
+ # stderr of freenet.
+ export JAVA JAVA_ARGS CLASSPATH
+ echo "XXXXXX" > /var/freenet/freenet.pid
+ nice -n ${FREENET_NICENESS} sudo -u freenet -- /usr/bin/start-freenet.sh \
+ > /var/freenet/freenet.pid
+ sleep 1
+ ps ax|grep "^ *$(cat /var/freenet/freenet.pid)" > /dev/null
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping Freenet"
+ start-stop-daemon --stop --quiet --pidfile /var/freenet/freenet.pid
+ eend $?
+}