SOURCES: tspc.init (NEW), tspc-PLD.patch (NEW) - new

radek radek at pld-linux.org
Sun Nov 30 17:11:06 CET 2008


Author: radek                        Date: Sun Nov 30 16:11:06 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- new

---- Files affected:
SOURCES:
   tspc.init (NONE -> 1.1)  (NEW), tspc-PLD.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/tspc.init
diff -u /dev/null SOURCES/tspc.init:1.1
--- /dev/null	Sun Nov 30 17:11:06 2008
+++ SOURCES/tspc.init	Sun Nov 30 17:11:00 2008
@@ -0,0 +1,101 @@
+#!/bin/sh
+#
+# tspc	configure an IPv6 tunnel to Hexago's migration broker
+#
+# chkconfig:	345 12 88
+#
+# description:	configure an IPv6 tunnel to Hexago's migration broker
+#
+# processname:	tspc
+#
+# $Id$
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Set defaults
+TSPC_OPTIONS=""
+
+# Get service config - may override defaults
+[ -f /etc/sysconfig/tspc ] && . /etc/sysconfig/tspc
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+	if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+		msg_network_down tspc
+		exit 1
+	fi
+else
+	exit 0
+fi
+
+start() {
+	# Check if the service is already running?
+	if [ ! -f /var/lock/subsys/tspc ]; then
+		msg_starting tspc
+		daemon /usr/sbin/tspc $TSPC_OPTIONS
+		RETVAL=$?
+		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/tspc
+	else
+		msg_already_running tspc
+	fi
+}
+
+stop() {
+	if [ -f /var/lock/subsys/tspc ]; then
+		# Stop daemons.
+		msg_stopping tspc
+		killproc tspc
+		# read tsp client config, to get the interface used
+		. /etc/tsp/tspc.conf
+		/sbin/ip tunnel del $if_tunnel_v6v4    2>/dev/null
+		/sbin/ip tunnel del $if_tunnel_v6udpv6 2>/dev/null
+		rm -f /var/lock/subsys/tspc
+	else
+		msg_not_running tspc
+	fi
+}
+
+condrestart() {
+	if [ -f /var/lock/subsys/tspc ]; then
+		stop
+		start
+	else
+		msg_not_running tspc
+		RETVAL=$1
+	fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+  	stop
+	;;
+  restart)
+	stop
+	start
+	;;
+  try-restart)
+	condrestart 0
+	;;
+# use this one if program doesn't support reloading without restart
+  force-reload)
+	condrestart 7
+	;;
+  status)
+	status tspc
+	RETVAL=$?
+	;;
+  *)
+	msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
+	exit 3
+esac
+
+exit $RETVAL

================================================================
Index: SOURCES/tspc-PLD.patch
diff -u /dev/null SOURCES/tspc-PLD.patch:1.1
--- /dev/null	Sun Nov 30 17:11:07 2008
+++ SOURCES/tspc-PLD.patch	Sun Nov 30 17:11:00 2008
@@ -0,0 +1,21 @@
+--- tspc2/platform/linux/tsp_local.c~	2008-11-30 16:16:10.308049558 +0100
++++ tspc2/platform/linux/tsp_local.c	2008-11-30 16:16:12.308047391 +0100
+@@ -59,13 +59,13 @@
+ 
+ /* these globals are defined by US used by alot of things in  */
+ 
+-char *FileName  = "tspc.conf";
+-char *LogFile   = "tspc.log";
++char *FileName  = "/etc/tsp/tspc.conf";
++char *LogFile   = "/var/log/tspc.log";
+ char *LogFileName = NULL;
+-char *ScriptInterpretor = "/bin/sh";
++char *ScriptInterpretor = NULL;
+ char *ScriptExtension = "sh";
+-char *ScriptDir = NULL;
+-char *TspHomeDir = "/usr/local/etc/tsp";
++char *ScriptDir = "/etc/tsp";
++char *TspHomeDir = "/etc/tsp";
+ char DirSeparator = '/';
+ 
+ int Verbose = 0;
================================================================


More information about the pld-cvs-commit mailing list