[Pkg-privacy-commits] [onioncat] 100/340: debian start-stop script added
Ximin Luo
infinity0 at moszumanska.debian.org
Sat Aug 22 13:04:29 UTC 2015
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch debian
in repository onioncat.
commit a0f52436d437bcea4226d99746452bd2e7150278
Author: eagle <eagle at 58e1ccc2-750e-0410-8d0d-f93ca75ab447>
Date: Mon Dec 15 23:00:54 2008 +0000
debian start-stop script added
git-svn-id: http://www.cypherpunk.at/svn/onioncat/trunk@393 58e1ccc2-750e-0410-8d0d-f93ca75ab447
---
rc.d/debian/onioncat | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++
src/ocat.h | 3 +++
2 files changed, 67 insertions(+)
diff --git a/rc.d/debian/onioncat b/rc.d/debian/onioncat
new file mode 100755
index 0000000..004c81e
--- /dev/null
+++ b/rc.d/debian/onioncat
@@ -0,0 +1,64 @@
+#! /bin/bash
+
+### BEGIN INIT INFO
+# Provides: onioncat
+# Required-Start: tor
+# Required-Stop:
+# Should-Start:
+# Should-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Starts OnionCat anonymous TOR VPN
+# Description: Starts OnionCat anonymous TOR VPN
+### END INIT INFO
+
+set -e
+
+DAEMON=/usr/local/bin/ocat
+NAME=OnionCat
+DESC="o(nion)cat daemon"
+OCATPID=/var/run/ocat.pid
+DAEMON_USER=debian-tor
+DAEMON_NAME=ocat
+ONIONURL=`cat /var/lib/tor/hidden_service/hostname`
+ARGS="-u $DAEMON_USER -b -L /var/lib/tor/.ocat/ocat_log $ONIONURL"
+
+case "$1" in
+ start)
+
+ echo "Starting $DESC: $NAME..."
+
+ start-stop-daemon --start --quiet \
+ --pidfile $OCATPID \
+ $NICE \
+ --exec $DAEMON -- $ARGS
+ echo "done."
+ ;;
+
+ stop)
+ echo -n "Stopping $DESC: "
+ pid=`cat $OCATPID 2>/dev/null` || true
+
+ if test ! -f $OCATPID -o -z "$pid"; then
+ echo "not running (there is no $OCATPID)."
+ exit 0
+ fi
+
+ start-stop-daemon --stop --signal INT --quiet --pidfile $OCATPID --name $DAEMON_NAME --user $DAEMON_USER
+ ;;
+
+ restart)
+
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+
+ *)
+ echo "Usage: $0 {start|stop|restart}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
diff --git a/src/ocat.h b/src/ocat.h
index 0536aba..0543722 100644
--- a/src/ocat.h
+++ b/src/ocat.h
@@ -269,6 +269,9 @@ typedef struct OcatPeer
int fraglen; //!< current frag buffer size
pthread_mutex_t mutex; //!< mutex for thread locking
int perm; //!< keep peer permanently open
+ time_t last_io; //!< timestamp when last I/O packet measurement started
+ unsigned inm;
+ unsigned outm;
} OcatPeer_t;
typedef struct OcatThread
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/onioncat.git
More information about the Pkg-privacy-commits
mailing list