First check in

This commit is contained in:
2018-10-29 20:24:48 -05:00
commit de0a876a9d
15 changed files with 498 additions and 0 deletions

5
SNAP/README Normal file
View File

@@ -0,0 +1,5 @@
This is the directory where the manifest, snapinfo,
and files.tar.gz files will be created. It is also
where the usher file should be placed if it is
required by the package. Any other files that need
to be included could also be placed here.

BIN
SNAP/config.tar.gz Normal file

Binary file not shown.

48
SNAP/named.init Normal file
View File

@@ -0,0 +1,48 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: bind
# Required-Start: $time $network
# Should-Start:
# Required-Stop: $network
# Should-Stop: $remote_fs
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Short-Description: DNS Daemon
# Description: Provides a local DNS daemon
### END INIT INFO
. /lib/lsb/init-functions
[ -r /etc/default/named ] && . /etc/default/named
NAME="named"
DAEMON="/usr/sbin/named"
PIDFILE="/var/run/named.pid"
case "$1" in
start)
log_init_msg "Starting named"
start_daemon "$DAEMON" "$NAMEDOPTS" && log_success_msg || log_failure_msg
;;
stop)
log_init_msg "Stopping named"
killproc -p "$PIDFILE" "$DAEMON" && log_success_msg || log_failure_msg
;;
restart)
$0 stop
sleep 1
$0 start
;;
reload)
log_init_msg "Reloading named"
killproc -p "$PIDFILE" "$DAEMON" -HUP && log_success_msg || log_failure_msg
;;
status)
status_of_proc -p "$PIDFILE" "$DAEMON"
;;
*)
echo "Usage: $0 {start|stop|restart|reload|status}"
exit 1
;;
esac

43
SNAP/usher Executable file
View File

@@ -0,0 +1,43 @@
#!/bin/sh
set -e
case $1 in
preinst)
exit 0
;;
postinst)
if ! getent group named 2>&1 > /dev/null; then
if groupadd -g 20 named; then
echo 'Created group named'
else
echo 'Failed to create group named!'
exit 1
fi
fi
if ! getent passwd named 2>&1 > /dev/null; then
if useradd -c 'BIND Account' -g named \
-s /bin/false -u 20 named; then
echo 'Created user named'
else
echo 'Failed to create user named!'
exit 1
fi
fi
if [ -d /var/named ]; then
chown -R named:named /var/named
fi
/etc/init.d/named status 2>&1 > /dev/null && /etc/init.d/named restart
exit 0
;;
prerm)
/etc/init.d/named status 2>&1 > /dev/null && /etc/init.d/named stop
exit 0
;;
postrm)
exit 0
;;
esac