Filippo Giunchedi has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/193096

Change subject: import debian directory
......................................................................

import debian directory

Bug: T90111
Change-Id: I25aa4f2e456a8f05455e6c34c511a77c83b77541
---
A debian/README.source
A debian/changelog
A debian/compat
A debian/control
A debian/copyright
A debian/docs
A debian/install
A debian/postinst
A debian/rules
A debian/source/format
A debian/statsite.ini
A debian/statsite.init
A debian/statsite.service
A debian/statsite.upstart
14 files changed, 267 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/debs/statsite 
refs/changes/96/193096/2

diff --git a/debian/README.source b/debian/README.source
new file mode 100644
index 0000000..eb0c9f1
--- /dev/null
+++ b/debian/README.source
@@ -0,0 +1,8 @@
+statsite for Debian
+-------------------
+
+bundled dependencies check and libev have been removed from deps/ and Debian's
+packages are used instead during build.
+
+ -- Filippo Giunchedi <fili...@wikimedia.org>  Wed, 25 Feb 2015 10:30:54 +0000
+
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..cb0c3ee
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+statsite (0.7.0-1) unstable; urgency=low
+
+  * Initial release (Closes: #778731)
+
+ -- Filippo Giunchedi <fili...@wikimedia.org>  Wed, 25 Feb 2015 10:30:54 +0000
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..e30a997
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,23 @@
+Source: statsite
+Section: utils
+Priority: optional
+Maintainer: Filippo Giunchedi <fili...@wikimedia.org>
+Build-Depends: debhelper (>= 9), dh-systemd, scons, check, libev-dev
+Standards-Version: 3.9.5
+Homepage: https://github.com/armon/statsite
+#Vcs-Git: git://anonscm.debian.org/collab-maint/statsite.git
+#Vcs-Browser: http://anonscm.debian.org/?p=collab-maint/statsite.git;a=summary
+
+Package: statsite
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, adduser
+Recommends: python
+Description: metrics aggregation server
+ Statsite is designed to be both highly performant,
+ and very flexible. To achieve this, it implements the stats
+ collection and aggregation in pure C, using libev to be
+ extremely fast.
+ .
+ This allows it to handle hundreds of connections,
+ and millions of metrics.
+ .
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..da10586
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,44 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: statsite
+Source: https://github.com/armon/statsite
+
+Files: *
+Copyright: 2012 Armon Dadgar
+License: BSD-3-clause
+
+Files: deps/murmurhash/*
+Copyright: Austin Appleby
+License: Public Domain
+
+Files: deps/inih/*
+Copyright: 2009 Brush Technology
+License: BSD-3-clause
+
+Files: debian/*
+Copyright: 2015 Filippo Giunchedi
+           2015 Wikimedia Foundation
+License: BSD-3-clause
+
+License: BSD-3-clause
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions are met:
+      * Redistributions of source code must retain the above copyright
+        notice, this list of conditions and the following disclaimer.
+      * Redistributions in binary form must reproduce the above copyright
+        notice, this list of conditions and the following disclaimer in the
+        documentation and/or other materials provided with the distribution.
+      * Neither the name of the organization nor the
+        names of its contributors may be used to endorse or promote products
+        derived from this software without specific prior written permission.
+  .
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE
+  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+  POSSIBILITY OF SUCH DAMAGE.
diff --git a/debian/docs b/debian/docs
new file mode 100644
index 0000000..b43bf86
--- /dev/null
+++ b/debian/docs
@@ -0,0 +1 @@
+README.md
diff --git a/debian/install b/debian/install
new file mode 100644
index 0000000..402bbf2
--- /dev/null
+++ b/debian/install
@@ -0,0 +1,3 @@
+statsite /usr/bin
+sinks /usr/lib/statsite/
+debian/statsite.ini /etc
diff --git a/debian/postinst b/debian/postinst
new file mode 100644
index 0000000..d90ef36
--- /dev/null
+++ b/debian/postinst
@@ -0,0 +1,11 @@
+#!/bin/sh
+set -e
+
+case "$1" in
+    configure)
+        adduser --quiet --system --no-create-home \
+            --home /var/lib/statsite statsite
+    ;;
+esac
+
+#DEBHELPER#
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..172ce6d
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,12 @@
+#!/usr/bin/make -f
+# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
+DPKG_EXPORT_BUILDFLAGS = 1
+include /usr/share/dpkg/default.mk
+
+%:
+       dh $@ --with-systemd
+
+override_dh_auto_clean:
+       scons -c test_runner
+       scons -c
+       dh_auto_clean $@
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/statsite.ini b/debian/statsite.ini
new file mode 100644
index 0000000..313f57c
--- /dev/null
+++ b/debian/statsite.ini
@@ -0,0 +1,11 @@
+[statsite]
+port = 8125
+udp_port = 8125
+log_level = INFO
+input_counter = statsd.received
+flush_interval = 60
+timer_eps = 0.01
+set_eps = 0.02
+#stream_cmd = python /usr/lib/statsite/sinks/graphite.py localhost 2003 ''
+use_type_prefix = 0
+#extended_counters = 1
diff --git a/debian/statsite.init b/debian/statsite.init
new file mode 100644
index 0000000..ca604fc
--- /dev/null
+++ b/debian/statsite.init
@@ -0,0 +1,128 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides:          statsite
+# Required-Start:    $remote_fs $syslog $network
+# Required-Stop:     $remote_fs $syslog $network
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: C statsd daemon
+### END INIT INFO
+
+# Author: Filippo Giunchedi <fili...@wikimedia.org>
+
+# Do NOT "set -e"
+
+# PATH should only include /usr/* if it runs after the mountnfs.sh script
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+DESC="C statsd daemon"
+NAME=statsite
+DAEMON=/usr/bin/$NAME
+DAEMON_ARGS="-f /etc/statsite.ini"
+DAEMON_USER="statsite"
+PIDFILE=/var/run/$NAME.pid
+SCRIPTNAME=/etc/init.d/$NAME
+
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || exit 0
+
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+# Load the VERBOSE setting and other rcS variables
+. /lib/init/vars.sh
+
+# Define LSB log_* functions.
+# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
+# and status_of_proc is working.
+. /lib/lsb/init-functions
+
+#
+# Function that starts the daemon/service
+#
+do_start()
+{
+       # Return
+       #   0 if daemon has been started
+       #   1 if daemon was already running
+       #   2 if daemon could not be started
+       start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile \
+               --chuid $DAEMON_USER --exec $DAEMON --test > /dev/null \
+               || return 1
+       start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile \
+               --chuid $DAEMON_USER --background --exec $DAEMON -- 
$DAEMON_ARGS \
+               || return 2
+}
+
+#
+# Function that stops the daemon/service
+#
+do_stop()
+{
+       # Return
+       #   0 if daemon has been stopped
+       #   1 if daemon was already stopped
+       #   2 if daemon could not be stopped
+       #   other if a failure occurred
+       start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile 
$PIDFILE \
+               --user $DAEMON_USER --name $NAME
+       RETVAL="$?"
+       [ "$RETVAL" = 2 ] && return 2
+       # Wait for children to finish too if this is a daemon that forks
+       # and if the daemon is only ever run from this initscript.
+       # If the above conditions are not satisfied then add some other code
+       # that waits for the process to drop all resources that could be
+       # needed by services started subsequently.  A last resort is to
+       # sleep for some time.
+       start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 \
+               --user $DAEMON_USER --exec $DAEMON
+       [ "$?" = 2 ] && return 2
+       # Many daemons don't delete their pidfiles when they exit.
+       rm -f $PIDFILE
+       return "$RETVAL"
+}
+
+case "$1" in
+  start)
+       [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
+       do_start
+       case "$?" in
+               0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+               2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+       esac
+       ;;
+  stop)
+       [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
+       do_stop
+       case "$?" in
+               0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+               2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+       esac
+       ;;
+  status)
+       status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
+       ;;
+  restart|force-reload)
+       log_daemon_msg "Restarting $DESC" "$NAME"
+       do_stop
+       case "$?" in
+         0|1)
+               do_start
+               case "$?" in
+                       0) log_end_msg 0 ;;
+                       1) log_end_msg 1 ;; # Old process is still running
+                       *) log_end_msg 1 ;; # Failed to start
+               esac
+               ;;
+         *)
+               # Failed to stop
+               log_end_msg 1
+               ;;
+       esac
+       ;;
+  *)
+       echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
+       exit 3
+       ;;
+esac
+
+:
diff --git a/debian/statsite.service b/debian/statsite.service
new file mode 100644
index 0000000..7dd0e02
--- /dev/null
+++ b/debian/statsite.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=C statsd daemon
+
+[Service]
+User=statsite
+ExecStart=/usr/bin/statsite -f /etc/statsite.ini
+
+[Install]
+WantedBy=multi-user.target
diff --git a/debian/statsite.upstart b/debian/statsite.upstart
new file mode 100644
index 0000000..56b8664
--- /dev/null
+++ b/debian/statsite.upstart
@@ -0,0 +1,10 @@
+description "C statsd daemon"
+
+start on (local-filesystems and net-device-up IFACE!=lo)
+stop on [!12345]
+
+limit nofile 32768 32768
+
+setuid statsite
+
+exec /usr/bin/statsite -f /etc/statsite.ini

-- 
To view, visit https://gerrit.wikimedia.org/r/193096
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I25aa4f2e456a8f05455e6c34c511a77c83b77541
Gerrit-PatchSet: 2
Gerrit-Project: operations/debs/statsite
Gerrit-Branch: master
Gerrit-Owner: Filippo Giunchedi <fgiunch...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to