SOURCES: tftpd-hpa.sysconfig (NEW), tftpd-hpa.init (NEW) - initscript and c...

baggins baggins at pld-linux.org
Thu Apr 23 17:00:54 CEST 2009


Author: baggins                      Date: Thu Apr 23 15:00:54 2009 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- initscript and config for standalone tftpd-hpa

---- Files affected:
SOURCES:
   tftpd-hpa.sysconfig (NONE -> 1.1)  (NEW), tftpd-hpa.init (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/tftpd-hpa.sysconfig
diff -u /dev/null SOURCES/tftpd-hpa.sysconfig:1.1
--- /dev/null	Thu Apr 23 17:00:55 2009
+++ SOURCES/tftpd-hpa.sysconfig	Thu Apr 23 17:00:48 2009
@@ -0,0 +1,53 @@
+# Connect with IPv4 only
+#LISTEN_IPV4=yes
+
+# Connect with IPv6 only
+#LISTEN_IPV6=yes
+
+# Specify a specific address and port to listen on.
+# The format is [address][:port]
+#ADDRESS=
+
+# Allow new files to be created.
+#CREATE=no
+
+# Sets the umask for newly created files to the specified value.
+#CREATEUMASK=0027
+
+# Determine the default timeout, in microseconds, before the first
+# packet is retransmitted. The default is 1000000 (1 second.)
+#TIMEOUT=1000000
+
+# Specify the use of filename remapping. The $MAPFILE is a file
+# containing  the  remapping  rules.
+#MAPFILE=
+
+# Specifies the maximum permitted block size.  The permitted range
+# for  this parameter is from 512 to 65464.
+#BLOCKSIZE=
+
+# Force  the  server port number (the Transaction ID) to be in the
+# specified range of port numbers. The format is port:port
+#PORTRANGE=
+
+# Set the logging verbosity of tftpd.
+VERBOSE=yes
+#VERBOSITY=
+
+# Indicate  that  a  specific RFC 2347 TFTP option should never be accepted.
+# Valid options are: blksize, blksize2, tsize, timeout, utimeout
+#REFUSE_OPTIONS=
+
+# The username which tftpd will run as.
+USER=tftp
+
+# Change root directory on startup.
+SECURE=yes
+
+# Perform no additional permissions checks above the normal system-provided
+# access controls for the user specified via the $USER option
+#PERMISSIVE=no
+
+# Space separated list of directories that tftpd will serve.
+# When $SECURE is "yes" then only one directory may be specified.
+DIRECTORY="/var/lib/tftp"

================================================================
Index: SOURCES/tftpd-hpa.init
diff -u /dev/null SOURCES/tftpd-hpa.init:1.1
--- /dev/null	Thu Apr 23 17:00:55 2009
+++ SOURCES/tftpd-hpa.init	Thu Apr 23 17:00:48 2009
@@ -0,0 +1,109 @@
+#!/bin/sh
+#
+# tfpd		tftp-hpa server
+#
+# chkconfig:	345 85 15
+# description:	Trivial File Transfer Protocol server.
+# processname:	tftpd
+# pidfile:	/var/run/tftpd.pid
+# config:	
+
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Get service config
+[ -f /etc/sysconfig/tftpd ] && . /etc/sysconfig/tftpd
+
+# 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 tftpd
+		exit 1
+	fi
+else
+	exit 0
+fi
+
+start() {
+	# Check if the service is already running?
+	if [ ! -f /var/lock/subsys/tftpd ]; then
+		TFTPD_OPTS="-l"
+		is_yes "$LISTEN_IPV4" && TFTPD_OPTS="$TFTPD_OPTS -4"
+		is_yes "$LISTEN_IPV6" && TFTPD_OPTS="$TFTPD_OPTS -6"
+		[ -n "$ADDRESS" ] &&  TFTPD_OPTS="$TFTPD_OPTS -a $ADDRESS"
+		is_yes "$CREATE" && TFTPD_OPTS="$TFTPD_OPTS -c"
+		[ -n "$CREATEUMASK" ] &&  TFTPD_OPTS="$TFTPD_OPTS -U $CREATEUMASK"
+		[ -n "$TIMEOUT" ] &&  TFTPD_OPTS="$TFTPD_OPTS -T $TIMEOUT"
+		[ -n "$MAPFILE" ] &&  TFTPD_OPTS="$TFTPD_OPTS -m $MAPFILE"
+		[ -n "$BLOCKSIZE" ] &&  TFTPD_OPTS="$TFTPD_OPTS -B $BLOCKSIZE"
+		[ -n "$PORTRANGE" ] &&  TFTPD_OPTS="$TFTPD_OPTS -R $PORTRANGE"
+		is_yes "$VERBOSE" && TFTPD_OPTS="$TFTPD_OPTS -v"
+		[ -n "$VERBOSITY" ] &&  TFTPD_OPTS="$TFTPD_OPTS --verbosity $VERBOSITY"
+		[ -n "$REFUSE_OPTIONS" ] &&  TFTPD_OPTS="$TFTPD_OPTS -r $REFUSE_OPTIONS"
+		[ -n "$USER" ] &&  TFTPD_OPTS="$TFTPD_OPTS -u $USER"
+		is_yes "$SECURE" && TFTPD_OPTS="$TFTPD_OPTS -s"
+		is_yes "$PERMISSIVE" &&  TFTPD_OPTS="$TFTPD_OPTS -p"
+		TFTPD_OPTS="$TFTPD_OPTS $DIRECTORY"
+		msg_starting TFTPD
+		daemon tftpd $TFTPD_OPTS
+		RETVAL=$?
+		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/tftpd
+	else
+		msg_already_running TFTPD
+	fi
+}
+
+stop() {
+	# Stop daemons.
+	if [ -f /var/lock/subsys/tftpd ]; then
+		msg_stopping TFTPD
+		killproc tftpd
+		rm -f /var/lock/subsys/tftpd /var/run/tftpd* > /dev/null 2>&1
+	else
+		msg_not_running TFTPD
+	fi
+}
+
+condrestart() {
+	if [ -f /var/lock/subsys/tftpd ]; then
+		stop
+		start
+	else
+		msg_not_running TFTPD
+		RETVAL=$1
+	fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+  	stop
+	;;
+  restart)
+	stop
+	start
+	;;
+  try-restart)
+	condrestart 0
+	;;
+  force-reload)
+	condrestart 7
+	;;
+  status)
+	status tftpd
+	exit $?
+	;;
+  *)
+	msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
+	exit 3
+esac
+
+exit $RETVAL
================================================================


More information about the pld-cvs-commit mailing list