aboutsummaryrefslogtreecommitdiff
path: root/contrib/dist
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/dist')
-rw-r--r--contrib/dist/rc.subr43
-rw-r--r--contrib/dist/suse/tor.sh.in118
-rw-r--r--contrib/dist/tor.sh.in123
-rw-r--r--contrib/dist/torctl.in195
4 files changed, 0 insertions, 479 deletions
diff --git a/contrib/dist/rc.subr b/contrib/dist/rc.subr
deleted file mode 100644
index d757e89528..0000000000
--- a/contrib/dist/rc.subr
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/sh
-# $FreeBSD: ports/security/tor-devel/files/tor.in,v 1.1 2006/02/17 22:21:25 mnag Exp $
-#
-# (rc.subr written by Peter Thoenen for Net/FreeBSD)
-#
-# REQUIRE: NETWORKING SERVERS USR
-# BEFORE: LOGIN
-#
-# Add the following lines to /etc/rc.conf to enable tor
-#
-# tor_enable (bool): Set to "NO" by default
-# Set it to "YES" to enable tor
-# tor_conf (str): Points to your tor conf file
-# Default: /usr/local/etc/tor/torrc
-# tor_user (str): Tor Daemon user. Default _tor
-#
-
-. /etc/rc.subr
-
-name="tor"
-rcvar=${name}_enable
-
-load_rc_config ${name}
-
-: ${tor_enable="NO"}
-: ${tor_conf="/usr/local/etc/tor/torrc"}
-: ${tor_user="_tor"}
-: ${tor_pidfile="/var/run/tor/tor.pid"}
-: ${tor_logfile="/var/log/tor"}
-: ${tor_datadir="/var/run/tor"}
-
-required_files=${tor_conf}
-required_dirs=${tor_datadir}
-command="/usr/local/bin/${name}"
-command_args="-f ${tor_conf} --pidfile ${tor_pidfile} --runasdaemon 1 --datadirectory ${tor_datadir} --user ${tor_user}"
-extra_commands="log"
-log_cmd="${name}_log"
-
-tor_log() {
- cat ${tor_logfile}
-}
-
-run_rc_command "$1"
diff --git a/contrib/dist/suse/tor.sh.in b/contrib/dist/suse/tor.sh.in
deleted file mode 100644
index b7e9005eb5..0000000000
--- a/contrib/dist/suse/tor.sh.in
+++ /dev/null
@@ -1,118 +0,0 @@
-#!/bin/sh
-#
-# Copyright (c) 2006-2007 Andrew Lewman
-#
-# tor The Onion Router
-#
-# Startup/shutdown script for tor. This is a wrapper around torctl;
-# torctl does the actual work in a relatively system-independent, or at least
-# distribution-independent, way, and this script deals with fitting the
-# whole thing into the conventions of the particular system at hand.
-#
-# These next couple of lines "declare" tor for the "chkconfig" program,
-# originally from SGI, used on Red Hat/Fedora and probably elsewhere.
-#
-# chkconfig: 2345 90 10
-# description: Onion Router - A low-latency anonymous proxy
-#
-
-### BEGIN INIT INFO
-# Provides: tor
-# Required-Start: $remote_fs $network
-# Required-Stop: $remote_fs $network
-# Default-Start: 3 5
-# Default-Stop: 0 1 2 6
-# Short-Description: Start the tor daemon
-# Description: Start the tor daemon: the anon-proxy server
-### END INIT INFO
-
-. /etc/rc.status
-
-# Shell functions sourced from /etc/rc.status:
-# rc_check check and set local and overall rc status
-# rc_status check and set local and overall rc status
-# rc_status -v ditto but be verbose in local rc status
-# rc_status -v -r ditto and clear the local rc status
-# rc_failed set local and overall rc status to failed
-# rc_reset clear local rc status (overall remains)
-# rc_exit exit appropriate to overall rc status
-
-# First reset status of this service
-rc_reset
-
-# Increase open file descriptors a reasonable amount
-ulimit -n 8192
-
-TORCTL=@BINDIR@/torctl
-
-# torctl will use these environment variables
-TORUSER=@TORUSER@
-export TORUSER
-TORGROUP=@TORGROUP@
-export TORGROUP
-
-TOR_DAEMON_PID_DIR="@LOCALSTATEDIR@/run/tor"
-
-if [ -x /bin/su ] ; then
- SUPROG=/bin/su
-elif [ -x /sbin/su ] ; then
- SUPROG=/sbin/su
-elif [ -x /usr/bin/su ] ; then
- SUPROG=/usr/bin/su
-elif [ -x /usr/sbin/su ] ; then
- SUPROG=/usr/sbin/su
-else
- SUPROG=/bin/su
-fi
-
-case "$1" in
-
- start)
- echo "Starting tor daemon"
-
- if [ ! -d $TOR_DAEMON_PID_DIR ] ; then
- mkdir -p $TOR_DAEMON_PID_DIR
- chown $TORUSER:$TORGROUP $TOR_DAEMON_PID_DIR
- fi
-
- ## Start daemon with startproc(8). If this fails
- ## the echo return value is set appropriate.
-
- startproc -f $TORCTL start
- # Remember status and be verbose
- rc_status -v
- ;;
-
- stop)
- echo "Stopping tor daemon"
- startproc -f $TORCTL stop
- # Remember status and be verbose
- rc_status -v
- ;;
-
- restart)
- echo "Restarting tor daemon"
- startproc -f $TORCTL restart
- # Remember status and be verbose
- rc_status -v
- ;;
-
- reload)
- echo "Reloading tor daemon"
- startproc -f $TORCTL reload
- # Remember status and be verbose
- rc_status -v
- ;;
-
- status)
- startproc -f $TORCTL status
- # Remember status and be verbose
- rc_status -v
- ;;
-
- *)
- echo "Usage: $0 (start|stop|restart|reload|status)"
- RETVAL=1
-esac
-
-rc_exit
diff --git a/contrib/dist/tor.sh.in b/contrib/dist/tor.sh.in
deleted file mode 100644
index 92f890681f..0000000000
--- a/contrib/dist/tor.sh.in
+++ /dev/null
@@ -1,123 +0,0 @@
-#!/bin/sh
-#
-# tor The Onion Router
-#
-# Startup/shutdown script for tor. This is a wrapper around torctl;
-# torctl does the actual work in a relatively system-independent, or at least
-# distribution-independent, way, and this script deals with fitting the
-# whole thing into the conventions of the particular system at hand.
-# This particular script is written for Red Hat/Fedora Linux, and may
-# also work on Mandrake, but not SuSE.
-#
-# These next couple of lines "declare" tor for the "chkconfig" program,
-# originally from SGI, used on Red Hat/Fedora and probably elsewhere.
-#
-# chkconfig: 2345 90 10
-# description: Onion Router - A low-latency anonymous proxy
-#
-
-PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
-DAEMON=/usr/sbin/tor
-NAME=tor
-DESC="tor daemon"
-TORPIDDIR=/var/run/tor
-TORPID=$TORPIDDIR/tor.pid
-WAITFORDAEMON=60
-ARGS=""
-
-# Library functions
-if [ -f /etc/rc.d/init.d/functions ]; then
- . /etc/rc.d/init.d/functions
-elif [ -f /etc/init.d/functions ]; then
- . /etc/init.d/functions
-fi
-
-TORCTL=@BINDIR@/torctl
-
-# torctl will use these environment variables
-TORUSER=@TORUSER@
-export TORUSER
-
-if [ -x /bin/su ] ; then
- SUPROG=/bin/su
-elif [ -x /sbin/su ] ; then
- SUPROG=/sbin/su
-elif [ -x /usr/bin/su ] ; then
- SUPROG=/usr/bin/su
-elif [ -x /usr/sbin/su ] ; then
- SUPROG=/usr/sbin/su
-else
- SUPROG=/bin/su
-fi
-
-# Raise ulimit based on number of file descriptors available (thanks, Debian)
-
-if [ -r /proc/sys/fs/file-max ]; then
- system_max=`cat /proc/sys/fs/file-max`
- if [ "$system_max" -gt "80000" ] ; then
- MAX_FILEDESCRIPTORS=32768
- elif [ "$system_max" -gt "40000" ] ; then
- MAX_FILEDESCRIPTORS=16384
- elif [ "$system_max" -gt "10000" ] ; then
- MAX_FILEDESCRIPTORS=8192
- else
- MAX_FILEDESCRIPTORS=1024
- cat << EOF
-
-Warning: Your system has very few filedescriptors available in total.
-
-Maybe you should try raising that by adding 'fs.file-max=100000' to your
-/etc/sysctl.conf file. Feel free to pick any number that you deem appropriate.
-Then run 'sysctl -p'. See /proc/sys/fs/file-max for the current value, and
-file-nr in the same directory for how many of those are used at the moment.
-
-EOF
- fi
-else
- MAX_FILEDESCRIPTORS=8192
-fi
-
-NICE=""
-
-case "$1" in
-
- start)
- if [ -n "$MAX_FILEDESCRIPTORS" ]; then
- echo -n "Raising maximum number of filedescriptors (ulimit -n) to $MAX_FILEDESCRIPTORS"
- if ulimit -n "$MAX_FILEDESCRIPTORS" ; then
- echo "."
- else
- echo ": FAILED."
- fi
- fi
-
- action $"Starting tor:" $TORCTL start
- RETVAL=$?
- ;;
-
- stop)
- action $"Stopping tor:" $TORCTL stop
- RETVAL=$?
- ;;
-
- restart)
- action $"Restarting tor:" $TORCTL restart
- RETVAL=$?
- ;;
-
- reload)
- action $"Reloading tor:" $TORCTL reload
- RETVAL=$?
- ;;
-
- status)
- $TORCTL status
- RETVAL=$?
- ;;
-
- *)
- echo "Usage: $0 (start|stop|restart|reload|status)"
- RETVAL=1
-esac
-
-exit $RETVAL
diff --git a/contrib/dist/torctl.in b/contrib/dist/torctl.in
deleted file mode 100644
index 4cc137da46..0000000000
--- a/contrib/dist/torctl.in
+++ /dev/null
@@ -1,195 +0,0 @@
-#!/bin/sh
-#
-# TOR control script designed to allow an easy command line interface
-# to controlling The Onion Router
-#
-# The exit codes returned are:
-# 0 - operation completed successfully. For "status", tor running.
-# 1 - For "status", tor not running.
-# 2 - Command not supported
-# 3 - Could not be started or reloaded
-# 4 - Could not be stopped
-# 5 -
-# 6 -
-# 7 -
-# 8 -
-#
-# When multiple arguments are given, only the error from the _last_
-# one is reported.
-#
-#
-# |||||||||||||||||||| START CONFIGURATION SECTION ||||||||||||||||||||
-# -------------------- --------------------
-# Name of the executable
-EXEC=tor
-#
-# the path to your binary, including options if necessary
-TORBIN="@BINDIR@/$EXEC"
-#
-# the path to the configuration file
-TORCONF="@CONFDIR@/torrc"
-#
-# the path to your PID file
-PIDFILE="@LOCALSTATEDIR@/run/tor/tor.pid"
-#
-# The path to the log file
-LOGFILE="@LOCALSTATEDIR@/log/tor/tor.log"
-#
-# The path to the datadirectory
-TORDATA="@LOCALSTATEDIR@/lib/tor"
-#
-TORARGS="--pidfile $PIDFILE --log \"notice file $LOGFILE\" --runasdaemon 1"
-TORARGS="$TORARGS --datadirectory $TORDATA"
-
-# If user name is set in the environment, then use it;
-# otherwise run as the invoking user (or whatever user the config
-# file says)... unless the invoking user is root. The idea here is to
-# let an unprivileged user run tor for her own use using this script,
-# while still providing for it to be used as a system daemon.
-if [ "x`id -u`" = "x0" ]; then
- TORUSER=@TORUSER@
-fi
-
-if [ "x$TORUSER" != "x" ]; then
- TORARGS="$TORARGS --user $TORUSER"
-fi
-
-# We no longer wrap the Tor daemon startup in an su when running as
-# root, because it's too painful to make the use of su portable.
-# Just let the daemon set the UID and GID.
-START="$TORBIN -f $TORCONF $TORARGS"
-
-#
-# -------------------- --------------------
-# |||||||||||||||||||| END CONFIGURATION SECTION ||||||||||||||||||||
-
-ERROR=0
-ARGV="$@"
-if [ "x$ARGV" = "x" ] ; then
- ARGS="help"
-fi
-
-checkIfRunning ( ) {
- # check for pidfile
- PID=unknown
- if [ -f $PIDFILE ] ; then
- PID=`/bin/cat $PIDFILE`
- if [ "x$PID" != "x" ] ; then
- if kill -0 $PID 2>/dev/null ; then
- STATUS="$EXEC (pid $PID) running"
- RUNNING=1
- else
- STATUS="PID file ($PIDFILE) present, but $EXEC ($PID) not running"
- RUNNING=0
- fi
- else
- STATUS="$EXEC (pid $PID?) not running"
- RUNNING=0
- fi
- else
- STATUS="$EXEC apparently not running (no pid file)"
- RUNNING=0
- fi
- return
-}
-
-for ARG in $@ $ARGS
-do
- checkIfRunning
-
- case $ARG in
- start)
- if [ $RUNNING -eq 1 ]; then
- echo "$0 $ARG: $EXEC (pid $PID) already running"
- continue
- fi
- if eval "$START" ; then
- echo "$0 $ARG: $EXEC started"
- # Make sure it stayed up!
- /bin/sleep 1
- checkIfRunning
- if [ $RUNNING -eq 0 ]; then
- echo "$0 $ARG: $EXEC (pid $PID) quit unexpectedly"
- fi
- else
- echo "$0 $ARG: $EXEC could not be started"
- ERROR=3
- fi
- ;;
- stop)
- if [ $RUNNING -eq 0 ]; then
- echo "$0 $ARG: $STATUS"
- continue
- fi
- if kill -15 $PID ; then
- echo "$0 $ARG: $EXEC stopped"
- else
- /bin/sleep 1
- if kill -9 $PID ; then
- echo "$0 $ARG: $EXEC stopped"
- else
- echo "$0 $ARG: $EXEC could not be stopped"
- ERROR=4
- fi
- fi
- # Make sure it really died!
- /bin/sleep 1
- checkIfRunning
- if [ $RUNNING -eq 1 ]; then
- echo "$0 $ARG: $EXEC (pid $PID) unexpectedly still running"
- ERROR=4
- fi
- ;;
- restart)
- $0 stop start
- ;;
- reload)
- if [ $RUNNING -eq 0 ]; then
- echo "$0 $ARG: $STATUS"
- continue
- fi
- if kill -1 $PID; then
- /bin/sleep 1
- echo "$EXEC (PID $PID) reloaded"
- else
- echo "Can't reload $EXEC"
- ERROR=3
- fi
- ;;
- status)
- echo $STATUS
- if [ $RUNNING -eq 1 ]; then
- ERROR=0
- else
- ERROR=1
- fi
- ;;
- log)
- cat $LOGFILE
- ;;
- help)
- echo "usage: $0 (start|stop|restart|status|help)"
- /bin/cat <<EOF
-
-start - start $EXEC
-stop - stop $EXEC
-restart - stop and restart $EXEC if running or start if not running
-reload - cause the running process to reinitialize itself
-status - tell whether $EXEC is running or not
-log - display the contents of the log file
-help - this text
-
-EOF
- ERROR=0
- ;;
- *)
- $0 help
- ERROR=2
- ;;
-
- esac
-
-done
-
-exit $ERROR
-