SOURCES: tor.init (NEW), tor.logrotate (NEW), tor.sysconfig (NEW) ...

radek radek at pld-linux.org
Tue Nov 8 22:21:41 CET 2005


Author: radek                        Date: Tue Nov  8 21:21:40 2005 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- new

---- Files affected:
SOURCES:
   tor.init (NONE -> 1.1)  (NEW), tor.logrotate (NONE -> 1.1)  (NEW), tor.sysconfig (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/tor.init
diff -u /dev/null SOURCES/tor.init:1.1
--- /dev/null	Tue Nov  8 22:21:40 2005
+++ SOURCES/tor.init	Tue Nov  8 22:21:34 2005
@@ -0,0 +1,84 @@
+#!/bin/sh
+#
+# tor	Anonymizing overlay network for TCP
+#
+# chkconfig:	345 40 60
+# description:	Tor is a connection-based low-latency anonymous communication system.
+# processname:	tor
+# pidfile:	/var/run/tor.pid
+#
+# $Id$
+
+. /etc/rc.d/init.d/functions
+
+. /etc/sysconfig/network
+
+TOR_USER="tor"
+TOR_GROUP="tor"
+TOR_CONFIG="/etc/tor/torrc"
+
+[ -f /etc/sysconfig/tor ] && . /etc/sysconfig/tor
+
+if is_yes "${NETWORKING}"; then
+	if [ ! -f /var/lock/subsys/network ]; then
+		msg_network_down tor
+		exit 1
+	fi
+else
+	exit 0
+fi
+
+case "$1" in
+  start)
+	if [ ! -f /var/lock/subsys/tor ]; then
+		msg_starting tor
+		daemon tor --user $TOR_USER --group $TOR_GROUP \
+			--pidfile /var/run/tor.pid -f $TOR_CONFIG $TOR_OPTIONS
+		RETVAL=$?
+		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/tor
+	else
+		msg_already_running tor
+	fi
+	;;
+  stop)
+	if [ -f /var/lock/subsys/tor ]; then
+		msg_stopping tor
+		killproc --pidfile /var/run/tor.pid tor
+		rm -f /var/lock/subsys/tor
+	else
+		msg_not_running tor
+	fi
+	;;
+  restart)
+	$0 stop
+	$0 start
+	exit $?
+	;;
+  reload)
+	if [ -f /var/lock/subsys/tor ]; then
+		msg_reloading tor
+		killproc tor -HUP
+		RETVAL=$?
+	else
+		msg_not_running tor >&2
+		RETVAL=7
+	fi
+	;;
+  force-reload)
+	# if program allows reloading without stopping
+	$0 reload
+	exit $?
+	;;
+  status)
+	status tor
+	RETVAL=$?
+	;;
+  *)
+	msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
+	exit 3
+esac
+
+exit $RETVAL
+
+# This must be last line !
+# vi:syntax=sh:ts=8:sw=4

================================================================
Index: SOURCES/tor.logrotate
diff -u /dev/null SOURCES/tor.logrotate:1.1
--- /dev/null	Tue Nov  8 22:21:40 2005
+++ SOURCES/tor.logrotate	Tue Nov  8 22:21:34 2005
@@ -0,0 +1,8 @@
+# $Id$
+
+/var/log/tor/* {
+	olddir /var/log/archiv/tor
+	postrotate
+		/sbin/service tor reload || :
+	endscript
+}

================================================================
Index: SOURCES/tor.sysconfig
diff -u /dev/null SOURCES/tor.sysconfig:1.1
--- /dev/null	Tue Nov  8 22:21:40 2005
+++ SOURCES/tor.sysconfig	Tue Nov  8 22:21:34 2005
@@ -0,0 +1,11 @@
+# Customized settings for tor
+# $Id$
+
+TOR_USER="tor"
+TOR_GROUP="tor"
+TOR_CONFIG="/etc/tor/torrc"
+
+# you probably want to redirect logs in syslog*.conf
+TOR_OPTIONS="--runasdaemon 1 --log 'notice syslog'"
+
+# vi:syntax=sh:ts=8:sw=4
================================================================



More information about the pld-cvs-commit mailing list