/etc/init.d/tftpd-hpa is in tftpd-hpa 5.2-7ubuntu3.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | #!/bin/sh
### BEGIN INIT INFO
# Provides: tftp-hpa
# Required-Start: $local_fs $remote_fs $syslog $network
# Required-Stop: $local_fs $remote_fs $syslog $network
# Default-Start: 2 3 4 5
# Default-Stop: 1
# Short-Description: HPA's tftp client
# Description: tftp server to allow booting clients which support
# the PXE protocol.
### END INIT INFO
PATH="/sbin:/bin:/usr/sbin:/usr/bin"
DAEMON="/usr/sbin/in.tftpd"
test -x "${DAEMON}" || exit 0
NAME="in.tftpd"
DESC="HPA's tftpd"
PIDFILE="/var/run/tftpd-hpa.pid"
DEFAULTS="/etc/default/tftpd-hpa"
# Include tftpd-hpa-server defaults if available
if [ -r "${DEFAULTS}" ]
then
. "${DEFAULTS}"
fi
set -e
. /lib/lsb/init-functions
do_start()
{
# Ensure --secure and multiple server directories are not used at the
# same time
if [ "$(echo ${TFTP_DIRECTORY} | wc -w)" -ge 2 ] && \
echo ${TFTP_OPTIONS} | grep -qs secure
then
echo
echo "When --secure is specified, exactly one directory can be specified."
echo "Please correct your /etc/default/tftpd-hpa."
exit 1
fi
# Ensure server directories are existing
for _DIRECTORY in ${TFTP_DIRECTORY}
do
if [ ! -d "${_DIRECTORY}" ]
then
echo "${_DIRECTORY} missing, aborting."
exit 1
fi
done
start-stop-daemon --start --quiet --oknodo --exec ${DAEMON} -- \
--listen --user ${TFTP_USERNAME} --address ${TFTP_ADDRESS} \
${TFTP_OPTIONS} ${TFTP_DIRECTORY}
}
do_stop ()
{
start-stop-daemon --stop --quiet --oknodo --name ${NAME}
}
do_reload ()
{
start-stop-daemon --stop --quiet --oknodo --name ${NAME} --signal 1
}
case "${1}" in
start)
if init_is_upstart; then
exit 1;
fi
log_daemon_msg "Starting ${DESC}" "${NAME}"
do_start
log_end_msg ${?}
;;
stop)
if init_is_upstart; then
exit 0;
fi
log_daemon_msg "Stopping ${DESC}" "${NAME}"
do_stop
log_end_msg ${?}
;;
restart|force-reload)
if init_is_upstart; then
exit 1;
fi
log_daemon_msg "Restarting ${DESC}" "${NAME}"
do_stop
sleep 1
do_start
log_end_msg ${?}
;;
status)
status_of_proc ${DAEMON} ${NAME}
;;
*)
echo "Usage: ${0} {start|stop|restart|force-reload|status}" >&2
exit 1
;;
esac
exit 0
|