From 9062918e35605bc9a8b5c55b8c044ee88d810a18 Mon Sep 17 00:00:00 2001 From: Dimitris Aragiorgis Date: Tue, 3 Jul 2012 16:58:15 +0300 Subject: [PATCH] Remove nfdhcpd from snf-network package Include nfdhcpd in Depends section in debian/control. Signed-off-by: Dimitris Aragiorgis --- debian/control | 9 +- debian/dirs | 2 - debian/install | 4 - debian/postinst | 42 ------- debian/rules | 3 - debian/snf-network.nfdhcpd.default | 12 -- debian/snf-network.nfdhcpd.init | 240 ------------------------------------ 7 files changed, 4 insertions(+), 308 deletions(-) delete mode 100644 debian/postinst delete mode 100644 debian/snf-network.nfdhcpd.default delete mode 100755 debian/snf-network.nfdhcpd.init diff --git a/debian/control b/debian/control index 3db2623..41e94e3 100644 --- a/debian/control +++ b/debian/control @@ -7,17 +7,16 @@ Standards-Version: 3.9.1 Package: snf-network Architecture: all -Conflicts: nfdhcpd, grnet-vnode-tools -Replaces: nfdhcpd, grnet-vnode-tools, snf-cyclades-gtools +Conflicts: grnet-vnode-tools +Replaces: grnet-vnode-tools, snf-cyclades-gtools Depends: ${misc:Depends}, ${python:Depends}, python-scapy(>= 2.0.1-1), python-daemon(>=1.5.2-1), python-pyinotify(>=0.7.1-1), python-ipy(>=1:0.62-1), nfqueue-bindings-python(>=0.3-2), python-cap-ng(>=0.6.0-1), python(>=2.4), python-configobj(>= 4.5.2-1), - iptables, arptables, ipcalc, ebtables, ferm, tcpdump -Provides: nfdhcpd, grnet-vnode-tools + iptables, arptables, ipcalc, ebtables, ferm, tcpdump, nfdhcpd +Provides: grnet-vnode-tools Description: Networking support for VMs inside the Ganeti Cluster. This package provides the following utilities: * vlan handling forGRNET's specific IP-less routing and proxy ARP - * nfdhcpd for responding to VM's dhcp requests * kvm-vif-bridge script for handling tap interfaces of VMs * various configuration files to support private LANs and IPs diff --git a/debian/dirs b/debian/dirs index 97ecc01..b9d7043 100644 --- a/debian/dirs +++ b/debian/dirs @@ -1,5 +1,3 @@ -var/lib/nfdhcpd -var/log/nfdhcpd var/lib/snf-network etc/snf-network diff --git a/debian/install b/debian/install index 6f00a16..cb88316 100644 --- a/debian/install +++ b/debian/install @@ -1,7 +1,3 @@ -nfdhcpd/nfdhcpd.conf etc/nfdhcpd -nfdhcpd/nfdhcpd.ferm etc/ferm -nfdhcpd/nfdhcpd usr/sbin - tools/mac2eui64 usr/bin vlans/prv-net-helper usr/sbin diff --git a/debian/postinst b/debian/postinst deleted file mode 100644 index 2d709f8..0000000 --- a/debian/postinst +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# postinst script for nfdhcp -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `configure' -# * `abort-upgrade' -# * `abort-remove' `in-favour' -# -# * `abort-remove' -# * `abort-deconfigure' `in-favour' -# `removing' -# -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package - - -case "$1" in - configure) - chown nobody:nogroup /var/log/nfdhcpd - ;; - - abort-upgrade|abort-remove|abort-deconfigure) - ;; - - *) - echo "postinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 - - diff --git a/debian/rules b/debian/rules index 5cd2a8c..3cb7212 100755 --- a/debian/rules +++ b/debian/rules @@ -5,6 +5,3 @@ dh $@ -override_dh_installinit: - dh_installinit --name=nfdhcpd - dh_installinit diff --git a/debian/snf-network.nfdhcpd.default b/debian/snf-network.nfdhcpd.default deleted file mode 100644 index 67a5272..0000000 --- a/debian/snf-network.nfdhcpd.default +++ /dev/null @@ -1,12 +0,0 @@ -# Defaults for nfdhcpd initscript -# sourced by /etc/init.d/nfdhcpd -# installed at /etc/default/nfdhcpd by the maintainer scripts - -# -# This is a POSIX shell fragment -# - -RUN="yes" - -# Additional options that are passed to the Daemon. -DAEMON_OPTS="--debug" diff --git a/debian/snf-network.nfdhcpd.init b/debian/snf-network.nfdhcpd.init deleted file mode 100755 index 61ec551..0000000 --- a/debian/snf-network.nfdhcpd.init +++ /dev/null @@ -1,240 +0,0 @@ -#!/bin/sh -# -# This is free software; you may redistribute it and/or modify -# it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2, -# or (at your option) any later version. -# -# This is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License with -# the Debian operating system, in /usr/share/common-licenses/GPL; if -# not, write to the Free Software Foundation, Inc., 59 Temple Place, -# Suite 330, Boston, MA 02111-1307 USA -# -### BEGIN INIT INFO -# Provides: nfdhcpd -# Required-Start: $network $local_fs $remote_fs -# Required-Stop: $remote_fs -# Should-Start: -# Should-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: NFQueue DHCP/RA server -### END INIT INFO - -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin - -DAEMON=/usr/sbin/nfdhcpd -NAME=nfdhcpd -DESC="NFQUEUE-based DHCP/RA server" -LOGDIR=/var/log/nfdhcpd - -PIDFILE=/var/run/$NAME/$NAME.pid - -test -x $DAEMON || exit 0 - -. /lib/lsb/init-functions - -# Default options, these can be overriden by the information -# at /etc/default/$NAME -DAEMON_OPTS="" # Additional options given to the server - -DIETIME=2 # Time to wait for the server to die, in seconds - # If this value is set too low you might not - # let some servers to die gracefully and - # 'restart' will not work - -STARTTIME=1 # Time to wait for the server to start, in seconds - # If this value is set each time the server is - # started (on start or restart) the script will - # stall to try to determine if it is running - # If it is not set and the server takes time - # to setup a pid file the log message might - # be a false positive (says it did not start - # when it actually did) - -LOGFILE=$LOGDIR/$NAME.log # Server logfile -#DAEMONUSER=nfdhcp # Users to run the daemons as. If this value - # is set start-stop-daemon will chuid the server - -# Include defaults if available -if [ -f /etc/default/$NAME ] ; then - . /etc/default/$NAME -fi - -# Use this if you want the user to explicitly set 'RUN' in -# /etc/default/ -if [ "x$RUN" != "xyes" ] ; then - log_failure_msg "$NAME disabled, please adjust the configuration to your needs " - log_failure_msg "and then set RUN to 'yes' in /etc/default/$NAME to enable it." - exit 1 -fi - -# Check that the user exists (if we set a user) -# Does the user exist? -set -e - -running_pid() { - # Check if a given process pid's cmdline matches a given name - pid=$1 - name=$2 - [ -z "$pid" ] && return 1 - [ ! -d /proc/$pid ] && return 1 - cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1 |cut -d : -f 1` - # Is this the expected server - [ "$cmd" != "$name" ] && return 1 - return 0 -} - -running() { - # Check if the process is running looking at /proc - # (works for all users) - # No pidfile, probably no daemon present - [ ! -f "$PIDFILE" ] && return 1 - pid=`cat $PIDFILE` - running_pid $pid python || return 1 - return 0 -} - -start_server() { - # /var/run may be volatile, so we need to ensure that - # /var/run/$NAME exists here as well as in postinst - if [ ! -d /var/run/$NAME ]; then - mkdir /var/run/$NAME || return 1 - chown nobody:nogroup /var/run/$NAME || return 1 - fi - iptables -t mangle -A PREROUTING --proto udp --dport 67 -j NFQUEUE --queue-num 42 - ip6tables -t mangle -A PREROUTING --proto icmpv6 --icmpv6-type router-solicitation -j NFQUEUE --queue-num 43 - ip6tables -t mangle -A PREROUTING --proto icmpv6 --icmpv6-type neighbour-solicitation -j NFQUEUE --queue-num 44 - start_daemon -p $PIDFILE $DAEMON $DAEMON_OPTS - errcode=$? - return $errcode -} - -stop_server() { - iptables -t mangle -D PREROUTING --proto udp --dport 67 -j NFQUEUE --queue-num 42 - ip6tables -t mangle -D PREROUTING --proto icmpv6 --icmpv6-type router-solicitation -j NFQUEUE --queue-num 43 - ip6tables -t mangle -D PREROUTING --proto icmpv6 --icmpv6-type neighbour-solicitation -j NFQUEUE --queue-num 44 - killproc -p $PIDFILE $DAEMON - rrcode=$? - return $errcode -} - -reload_server() { - [ ! -f "$PIDFILE" ] && return 1 - pid=pidofproc $PIDFILE # This is the daemon's pid - # Send a SIGHUP - kill -1 $pid - return $? -} - -force_stop() { -# Force the process to die killing it manually - [ ! -e "$PIDFILE" ] && return - if running ; then - kill -15 $pid - # Is it really dead? - sleep "$DIETIME"s - if running ; then - kill -9 $pid - sleep "$DIETIME"s - if running ; then - echo "Cannot kill $NAME (pid=$pid)!" - exit 1 - fi - fi - fi - rm -f $PIDFILE -} - - -case "$1" in - start) - log_daemon_msg "Starting $DESC " "$NAME" - # Check if it's running first - if running ; then - log_progress_msg "apparently already running" - log_end_msg 0 - exit 0 - fi - if start_server ; then - # NOTE: Some servers might die some time after they start, - # this code will detect this issue if STARTTIME is set - # to a reasonable value - [ -n "$STARTTIME" ] && sleep $STARTTIME # Wait some time - if running ; then - # It's ok, the server started and is running - log_end_msg 0 - else - # It is not running after we did start - log_end_msg 1 - fi - else - # Either we could not start it - log_end_msg 1 - fi - ;; - stop) - log_daemon_msg "Stopping $DESC" "$NAME" - if running ; then - # Only stop the server if we see it running - errcode=0 - stop_server || errcode=$? - log_end_msg $errcode - else - # If it's not running don't do anything - log_progress_msg "apparently not running" - log_end_msg 0 - exit 0 - fi - ;; - force-stop) - # First try to stop gracefully the program - $0 stop - if running; then - # If it's still running try to kill it more forcefully - log_daemon_msg "Stopping (force) $DESC" "$NAME" - errcode=0 - force_stop || errcode=$? - log_end_msg $errcode - fi - ;; - restart|force-reload) - log_daemon_msg "Restarting $DESC" "$NAME" - errcode=0 - stop_server || errcode=$? - # Wait some sensible amount, some server need this - [ -n "$DIETIME" ] && sleep $DIETIME - start_server || errcode=$? - [ -n "$STARTTIME" ] && sleep $STARTTIME - running || errcode=$? - log_end_msg $errcode - ;; - status) - - log_daemon_msg "Checking status of $DESC" "$NAME" - if running ; then - log_progress_msg "running" - log_end_msg 0 - else - log_progress_msg "apparently not running" - log_end_msg 1 - exit 1 - fi - ;; - reload) - log_warning_msg "Reloading $NAME daemon: not implemented, as the daemon" - log_warning_msg "cannot re-read the config file (use restart)." - ;; - *) - N=/etc/init.d/$NAME - echo "Usage: $N {start|stop|force-stop|restart|force-reload|status}" >&2 - exit 1 - ;; -esac - -exit 0 -- 1.7.10.4