Index: trunk/udpprofile/debian/control |
— | — | @@ -0,0 +1,11 @@ |
| 2 | +Source: udpprofile |
| 3 | +Section: net |
| 4 | +Priority: extra |
| 5 | +Maintainer: Ryan Lane <rlane@wikimedia.org> |
| 6 | +Build-Depends: debhelper (>= 4), libdb4.8-dev, gcc |
| 7 | +Standards-Version: 1.0 |
| 8 | + |
| 9 | +Package: udpprofile |
| 10 | +Architecture: amd64 |
| 11 | +Depends: libdb4.8 |
| 12 | +Description: UDP profiling daemon |
Index: trunk/udpprofile/debian/dirs |
— | — | @@ -0,0 +1,3 @@ |
| 2 | +usr/udpprofile |
| 3 | +usr/udpprofile/sbin |
| 4 | +usr/udpprofile/web |
Index: trunk/udpprofile/debian/compat |
— | — | @@ -0,0 +1 @@ |
| 2 | +6 |
Index: trunk/udpprofile/debian/install |
— | — | @@ -0,0 +1,10 @@ |
| 2 | +collector /usr/udpprofile/sbin |
| 3 | +exporter /usr/udpprofile/sbin |
| 4 | +web /usr/udpprofile/web |
| 5 | +web/admin.py /usr/udpprofile/web |
| 6 | +web/config.py /usr/udpprofile/web |
| 7 | +web/extractprofile.py /usr/udpprofile/web |
| 8 | +web/pcache-hit-rate.py /usr/udpprofile/web |
| 9 | +web/pcache-request-rate.py /usr/udpprofile/web |
| 10 | +web/report.py /usr/udpprofile/web |
| 11 | +web/VERSION /usr/udpprofile/web |
Index: trunk/udpprofile/debian/changelog |
— | — | @@ -0,0 +1,5 @@ |
| 2 | +udpprofile (1.0) lucid-wikimedia; urgency=low |
| 3 | + |
| 4 | + * Initial package |
| 5 | + |
| 6 | + -- Ryan Lane <rlane@wikimedia.org> Wed, 30 Mar 2011 21:35:28 +0000 |
Index: trunk/udpprofile/debian/copyright |
— | — | @@ -0,0 +1,23 @@ |
| 2 | +This package was debianized by Ryan Lane <rlane@wikimedia.org> on |
| 3 | +Wed, 30 Mar 2011 21:35:28 +0000. |
| 4 | + |
| 5 | +It was downloaded from http://svn.wikimedia.org/viewvc/mediawiki/trunk/udpprofile/ |
| 6 | + |
| 7 | +Upstream Author(s): |
| 8 | + |
| 9 | + Domas Mituzas |
| 10 | + |
| 11 | +Copyright: |
| 12 | + |
| 13 | + Copyright (C) 2011 Domas Mituzas |
| 14 | + |
| 15 | +License: |
| 16 | + |
| 17 | + Public Domain |
| 18 | + |
| 19 | +The Debian packaging is: |
| 20 | + |
| 21 | + Copyright (C) 2011 Ryan Lane <rlane@wikimedia.org> |
| 22 | + |
| 23 | +and is licensed under the GPL version 2, |
| 24 | +see `/usr/share/common-licenses/GPL-2'. |
Index: trunk/udpprofile/debian/rules |
— | — | @@ -0,0 +1,88 @@ |
| 2 | +#!/usr/bin/make -f |
| 3 | +# -*- makefile -*- |
| 4 | +# Sample debian/rules that uses debhelper. |
| 5 | +# This file was originally written by Joey Hess and Craig Small. |
| 6 | +# As a special exception, when this file is copied by dh-make into a |
| 7 | +# dh-make output file, you may use that output file without restriction. |
| 8 | +# This special exception was added by Craig Small in version 0.37 of dh-make. |
| 9 | + |
| 10 | +# Uncomment this to turn on verbose mode. |
| 11 | +export DH_VERBOSE=1 |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | +configure: configure-stamp |
| 18 | +configure-stamp: |
| 19 | + dh_testdir |
| 20 | + # Add here commands to configure the package. |
| 21 | + |
| 22 | + touch configure-stamp |
| 23 | + |
| 24 | + |
| 25 | +build: build-stamp |
| 26 | + |
| 27 | +build-stamp: configure-stamp |
| 28 | + dh_testdir |
| 29 | + |
| 30 | + # Add here commands to compile the package. |
| 31 | + make |
| 32 | + |
| 33 | + touch $@ |
| 34 | + |
| 35 | +clean: |
| 36 | + dh_testdir |
| 37 | + dh_testroot |
| 38 | + rm -f build-stamp configure-stamp |
| 39 | + |
| 40 | + # Add here commands to clean up after the build process. |
| 41 | + rm -rf build |
| 42 | + |
| 43 | + dh_clean |
| 44 | + |
| 45 | +install: build |
| 46 | + dh_testdir |
| 47 | + dh_testroot |
| 48 | + #dh_prep |
| 49 | + dh_installdirs |
| 50 | + |
| 51 | +# Build architecture-independent files here. |
| 52 | +binary-indep: install |
| 53 | + dh_testdir |
| 54 | + dh_testroot |
| 55 | + dh_installinit -n |
| 56 | + |
| 57 | +# Build architecture-dependent files here. |
| 58 | +binary-arch: install |
| 59 | + dh_testdir |
| 60 | + dh_testroot |
| 61 | +# dh_installchangelogs |
| 62 | +# dh_installdocs |
| 63 | +# dh_installexamples |
| 64 | + dh_install |
| 65 | +# dh_installmenu |
| 66 | +# dh_installdebconf |
| 67 | +# dh_installlogrotate |
| 68 | +# dh_installemacsen |
| 69 | +# dh_installpam |
| 70 | +# dh_installmime |
| 71 | +# dh_python |
| 72 | +# dh_installinit |
| 73 | +# dh_installcron |
| 74 | +# dh_installinfo |
| 75 | +# dh_installman |
| 76 | + dh_link |
| 77 | + dh_strip |
| 78 | + dh_compress |
| 79 | + dh_fixperms |
| 80 | +# dh_perl |
| 81 | +# dh_makeshlibs |
| 82 | + dh_installdeb |
| 83 | + dh_shlibdeps |
| 84 | + dh_gencontrol |
| 85 | + dh_md5sums |
| 86 | + dh_builddeb |
| 87 | + |
| 88 | +binary: binary-indep binary-arch |
| 89 | +.PHONY: build clean binary-indep binary-arch binary install configure |
Property changes on: trunk/udpprofile/debian/rules |
___________________________________________________________________ |
Added: svn:executable |
1 | 90 | + * |
Index: trunk/udpprofile/debian/udpprofile.init |
— | — | @@ -0,0 +1,141 @@ |
| 2 | +#! /bin/sh |
| 3 | +### BEGIN INIT INFO |
| 4 | +# Provides: udp-profile-collector |
| 5 | +# Required-Start: $remote_fs $syslog |
| 6 | +# Required-Stop: $remote_fs $syslog |
| 7 | +# Default-Start: 2 3 4 5 |
| 8 | +# Default-Stop: 0 1 6 |
| 9 | +# Short-Description: UDP Profile Collector |
| 10 | +# Description: UDP Profile Collector |
| 11 | +### END INIT INFO |
| 12 | + |
| 13 | +# Author: Ryan Lane <rlane@wikimedia.org> |
| 14 | +# |
| 15 | +# Do NOT "set -e" |
| 16 | + |
| 17 | +PATH=/sbin:/usr/sbin:/bin:/usr/bin |
| 18 | +DESC="UDP Profile Collector" |
| 19 | +DAEMON="/usr/udpprofile/sbin/collector" |
| 20 | +USER="nobody" |
| 21 | +SCRIPTNAME=/etc/init.d/udpprofile |
| 22 | + |
| 23 | +# Exit if the package is not installed |
| 24 | +[ -x "$START" ] || exit 0 |
| 25 | + |
| 26 | +# Read configuration variable file if it is present |
| 27 | +[ -r /etc/default/$NAME ] && . /etc/default/$NAME |
| 28 | + |
| 29 | +# Load the VERBOSE setting and other rcS variables |
| 30 | +. /lib/init/vars.sh |
| 31 | + |
| 32 | +# Define LSB log_* functions. |
| 33 | +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. |
| 34 | +. /lib/lsb/init-functions |
| 35 | + |
| 36 | +# |
| 37 | +# Function that starts the daemon/service |
| 38 | +# |
| 39 | +do_start() |
| 40 | +{ |
| 41 | + # Return |
| 42 | + # 0 if daemon has been started |
| 43 | + # 1 if daemon was already running |
| 44 | + # 2 if daemon could not be started |
| 45 | + start-stop-daemon --start --quiet -m -d /tmp -c $USER --exec $START --test > /dev/null \ |
| 46 | + || return 1 |
| 47 | + start-stop-daemon --start --quiet -m -d /tmp -c $USER --exec $START \ |
| 48 | + || return 2 |
| 49 | + # Add code here, if necessary, that waits for the process to be ready |
| 50 | + # to handle requests from services started subsequently which depend |
| 51 | + # on this one. As a last resort, sleep for some time. |
| 52 | +} |
| 53 | + |
| 54 | +# |
| 55 | +# Function that stops the daemon/service |
| 56 | +# |
| 57 | +do_stop() |
| 58 | +{ |
| 59 | + # Return |
| 60 | + # 0 if daemon has been stopped |
| 61 | + # 1 if daemon was already stopped |
| 62 | + # 2 if daemon could not be stopped |
| 63 | + # other if a failure occurred |
| 64 | + start-stop-daemon --start --quiet -c $USER --exec $STOP |
| 65 | + RETVAL="$?" |
| 66 | + [ "$RETVAL" = 2 ] && return 2 |
| 67 | + return "$RETVAL" |
| 68 | +} |
| 69 | + |
| 70 | +# |
| 71 | +# Function that sends a SIGHUP to the daemon/service |
| 72 | +# |
| 73 | +do_reload() { |
| 74 | + # |
| 75 | + # If the daemon can reload its configuration without |
| 76 | + # restarting (for example, when it is sent a SIGHUP), |
| 77 | + # then implement that here. |
| 78 | + # |
| 79 | + do_stop |
| 80 | + do_start |
| 81 | + return 0 |
| 82 | +} |
| 83 | + |
| 84 | +case "$1" in |
| 85 | + start) |
| 86 | + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" |
| 87 | + do_start |
| 88 | + case "$?" in |
| 89 | + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; |
| 90 | + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; |
| 91 | + esac |
| 92 | + ;; |
| 93 | + stop) |
| 94 | + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" |
| 95 | + do_stop |
| 96 | + case "$?" in |
| 97 | + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; |
| 98 | + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; |
| 99 | + esac |
| 100 | + ;; |
| 101 | + status) |
| 102 | + status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? |
| 103 | + ;; |
| 104 | + #reload|force-reload) |
| 105 | + # |
| 106 | + # If do_reload() is not implemented then leave this commented out |
| 107 | + # and leave 'force-reload' as an alias for 'restart'. |
| 108 | + # |
| 109 | + #log_daemon_msg "Reloading $DESC" "$NAME" |
| 110 | + #do_reload |
| 111 | + #log_end_msg $? |
| 112 | + #;; |
| 113 | + restart|force-reload) |
| 114 | + # |
| 115 | + # If the "reload" option is implemented then remove the |
| 116 | + # 'force-reload' alias |
| 117 | + # |
| 118 | + log_daemon_msg "Restarting $DESC" "$NAME" |
| 119 | + do_stop |
| 120 | + case "$?" in |
| 121 | + 0|1) |
| 122 | + do_start |
| 123 | + case "$?" in |
| 124 | + 0) log_end_msg 0 ;; |
| 125 | + 1) log_end_msg 1 ;; # Old process is still running |
| 126 | + *) log_end_msg 1 ;; # Failed to start |
| 127 | + esac |
| 128 | + ;; |
| 129 | + *) |
| 130 | + # Failed to stop |
| 131 | + log_end_msg 1 |
| 132 | + ;; |
| 133 | + esac |
| 134 | + ;; |
| 135 | + *) |
| 136 | + #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 |
| 137 | + echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 |
| 138 | + exit 3 |
| 139 | + ;; |
| 140 | +esac |
| 141 | + |
| 142 | +: |
Index: trunk/udpprofile/debian/udpprofile.default |
— | — | @@ -0,0 +1,7 @@ |
| 2 | +# Defaults for udpprofile initscript |
| 3 | +# sourced by /etc/init.d/udpprofile |
| 4 | +# installed at /etc/default/udpprofile by the maintainer scripts |
| 5 | + |
| 6 | +# |
| 7 | +# This is a POSIX shell fragment |
| 8 | +# |
Index: trunk/udpprofile/export.c |
— | — | @@ -14,7 +14,7 @@ |
15 | 15 | #include <string.h> |
16 | 16 | #include <unistd.h> |
17 | 17 | #include <netinet/in.h> |
18 | | -#include <db4/db.h> |
| 18 | +#include <db.h> |
19 | 19 | #include "collector.h" |
20 | 20 | |
21 | 21 | void dumpData(FILE *fd) { |
Index: trunk/udpprofile/collector.c |
— | — | @@ -21,7 +21,7 @@ |
22 | 22 | #include <errno.h> |
23 | 23 | #include <fcntl.h> |
24 | 24 | #include <netinet/in.h> |
25 | | -#include <db4/db.h> |
| 25 | +#include <db.h> |
26 | 26 | #include "collector.h" |
27 | 27 | |
28 | 28 | void hup(); |
Index: trunk/udpprofile/collector.h |
— | — | @@ -2,7 +2,7 @@ |
3 | 3 | /* $Id$ */ |
4 | 4 | |
5 | 5 | #include <stdio.h> |
6 | | -#include <db4/db.h> |
| 6 | +#include <db.h> |
7 | 7 | |
8 | 8 | DB *db; |
9 | 9 | |