Blob Blame History Raw
diff -Naur ../tayga-0.9.2.orig/README.redhat ./README.redhat
--- ../tayga-0.9.2.orig/README.redhat	1970-01-01 01:00:00.000000000 +0100
+++ ./README.redhat	2016-01-14 22:06:20.685923559 +0100
@@ -0,0 +1,44 @@
+For systemd users, that is Fedora and RHEL7 and onwards:
+========================================================
+
+To enable a tayga service with the default config in /etc/tayga/default.conf
+
+# systemctl enable tayga@default.service
+
+You can now use this config as a normal systemd service
+
+# systemctl start  tayga@default.service
+# systemctl status tayga@default.service
+# systemctl stop   tayga@default.service
+
+To set up an extra tayga service instance, create a new tayga config in
+/etc/tayga/instancename.conf. Then enable this config as a systemd alias
+
+# systemctl enable tayga@instancename.service
+
+You can now use this config as a normal systemd service
+
+# systemctl start  tayga@instancename.service
+# systemctl status tayga@instancename.service
+# systemctl stop   tayga@instancename.service
+
+
+For sysv users, that is RHEL5 and RHEL6:
+========================================
+
+The tayga init script will use the default config in /etc/tayga/default.conf
+
+# service tayga start
+# service tayga status
+# service tayga stop
+
+To create a new tayga instance, create a new config file in 
+/etc/tayga/instancename.conf. Then enable this config by symlinking
+/etc/init.d/tayga to /etc/init.d/tayga-instancename
+
+The resulting symlink can be called as a normal sysv service
+
+# service tayga-instancename start
+# service tayga-instancename status
+# service tayga-instancename stop
+
diff -Naur ../tayga-0.9.2.orig/tayga.initrc.redhat ./tayga.initrc.redhat
--- ../tayga-0.9.2.orig/tayga.initrc.redhat	1970-01-01 01:00:00.000000000 +0100
+++ ./tayga.initrc.redhat	2016-01-14 21:41:52.443894199 +0100
@@ -0,0 +1,137 @@
+#! /bin/sh
+#
+# tayga Control the Tayga NAT64 daemon
+#
+# chkconfig: - 90 10
+# description: Tayga NAT64 daemon
+# processname: tayga
+# config: /etc/tayga.conf
+# pidfile: /var/run/tayga/tayga.pid
+
+### BEGIN INIT INFO
+# Provides: tayga
+# Required-Start: $network $local_fs $remote_fs
+# Required-Stop: $network $local_fs $remote_fs
+# Default-Start:
+# Default-Stop:
+# Short-Description: start and stop tayga
+# Description: Tayga NAT64 daemon
+### END INIT INFO
+
+# Source function library.
+. /etc/init.d/functions
+
+# Parse scriptname and find the instance name, if any
+script=$(basename "$0")
+instance=$(echo $script | sed 's/.*-//')
+
+# If no instance is set, use the default config provided
+# with the package
+if [ "$instance" == "$script" ]; then instance="default"; fi
+
+retval=0
+pidfile="/var/run/tayga/tayga-${instance}.pid"
+lockfile="/var/lock/subsys/tayga-${instance}"
+config="/etc/tayga/${instance}.conf"
+exec="/usr/sbin/tayga"
+prog="tayga"
+
+# Load overrides if they exist
+test -f /etc/sysconfig/tayga-$instance && . /etc/sysconfig/tayga-$instance
+
+
+start() {
+
+	if [ ! -x $exec ]
+	then
+		echo $exec not found
+		exit 5
+	fi
+
+	if [ ! -f $config ]
+	then
+		echo $config not found
+		exit 6
+	fi
+
+	echo -n "Starting tayga nat64: "
+
+	daemon $exec "--pidfile $pidfile --config $config" 
+	retval=$?
+	if [ $retval -eq 0 ]
+	then
+		touch $lockfile
+		echo_success
+		echo
+	else
+		echo_failure
+		echo
+	fi
+	return $retval
+}
+
+stop() {
+	echo -n "Stopping Tayga NAT64 daemon: "
+	killproc -p $pidfile $prog
+	retval=$?
+	echo
+	[ $retval -eq 0 ] && rm -f $lockfile
+	return $retval
+}
+
+restart() {
+	stop
+	start
+}
+
+reload() {
+	restart
+}
+
+force_reload() {
+	restart
+}
+
+rh_status() {
+	status -p $pidfile $prog
+}
+
+rh_status_q() {
+	rh_status >/dev/null 2>&1
+}
+
+# See how we were called.
+case "$1" in
+	start)
+		rh_status_q && exit 0
+		$1
+		;;
+	stop)
+		rh_status_q || exit 0
+		$1
+		;;
+	restart)
+		$1
+		;;
+	reload)
+		rh_status_q || exit 7
+		$1
+		;;
+	force-reload)
+		force_reload
+		;;
+	status)
+		rh_status
+		;;
+	condrestart|try-restart)
+		rh_status_q || exit 0
+		restart
+		;;
+	*)
+	echo "Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+
+	exit 2
+esac
+
+exit $?
+
diff -Naur ../tayga-0.9.2.orig/tayga.service ./tayga.service
--- ../tayga-0.9.2.orig/tayga.service	1970-01-01 01:00:00.000000000 +0100
+++ ./tayga.service	2016-01-14 22:08:57.936748752 +0100
@@ -0,0 +1,32 @@
+[Unit]
+Description=Simple, no-fuss NAT64
+After=syslog.target network.target
+
+[Service]
+
+# To enable a tayga service with the default config
+#
+# systemctl enable tayga@default.service
+# 
+# To set up an extra tayga service instance, create a new tayga config in
+# /etc/tayga/instancename.conf. Then enable this config as a systemd alias
+#
+# systemctl enable tayga@instancename.service
+#
+# If you want to make changes to this file, please symlink it to 
+# /etc/systemd/system/tayga@instancename.service and make your changes there.
+# Configuration may be done in /etc/tayga/instancename.conf
+
+PIDFile=/run/tayga-%i.pid
+
+# Maximum size of the corefile. 
+LimitCORE=infinity
+
+Type=simple
+PrivateTmp=true
+ExecStart=/usr/sbin/tayga --pidfile /var/run/tayga-%i.pid -d --config /etc/tayga/%i.conf
+
+
+[Install]
+WantedBy=multi-user.target
+
diff -Naur ../tayga-0.9.2.orig/tayga.tmpfilesd.conf ./tayga.tmpfilesd.conf
--- ../tayga-0.9.2.orig/tayga.tmpfilesd.conf	1970-01-01 01:00:00.000000000 +0100
+++ ./tayga.tmpfilesd.conf	2015-10-01 01:30:49.460407857 +0200
@@ -0,0 +1 @@
+d /run/tayga 0755 root root -