[23519] in Source-Commits

home help back first fref pref prev next nref lref last post

/svn/athena r23163 - in trunk/debathena/debathena: . counterlog counterlog/debian

daemon@ATHENA.MIT.EDU (ghudson@MIT.EDU)
Tue Sep 2 15:07:30 2008

Date: Tue, 2 Sep 2008 15:06:55 -0400 (EDT)
From: ghudson@MIT.EDU
Message-Id: <200809021906.PAA03515@drugstore.mit.edu>
To: source-commits@MIT.EDU
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Author: ghudson
Date: 2008-09-02 15:06:54 -0400 (Tue, 02 Sep 2008)
New Revision: 23163

Added:
   trunk/debathena/debathena/counterlog/
   trunk/debathena/debathena/counterlog/debian/
   trunk/debathena/debathena/counterlog/debian/changelog
   trunk/debathena/debathena/counterlog/debian/compat
   trunk/debathena/debathena/counterlog/debian/control
   trunk/debathena/debathena/counterlog/debian/control.in
   trunk/debathena/debathena/counterlog/debian/debathena-counterlog.cron.daily
   trunk/debathena/debathena/counterlog/debian/debathena-counterlog.dirs
   trunk/debathena/debathena/counterlog/debian/rules
Log:
Add debathena-counterlog package.

Added: trunk/debathena/debathena/counterlog/debian/changelog
===================================================================
--- trunk/debathena/debathena/counterlog/debian/changelog	2008-08-28 17:15:43 UTC (rev 23162)
+++ trunk/debathena/debathena/counterlog/debian/changelog	2008-09-02 19:06:54 UTC (rev 23163)
@@ -0,0 +1,5 @@
+debathena-counterlog (1.0) unstable; urgency=low
+
+  * Initial release.
+
+ -- Greg Hudson <ghudson@mit.edu>  Tue, 02 Sep 2008 15:04:50 -0400

Added: trunk/debathena/debathena/counterlog/debian/compat
===================================================================
--- trunk/debathena/debathena/counterlog/debian/compat	2008-08-28 17:15:43 UTC (rev 23162)
+++ trunk/debathena/debathena/counterlog/debian/compat	2008-09-02 19:06:54 UTC (rev 23163)
@@ -0,0 +1 @@
+4

Added: trunk/debathena/debathena/counterlog/debian/control
===================================================================
--- trunk/debathena/debathena/counterlog/debian/control	2008-08-28 17:15:43 UTC (rev 23162)
+++ trunk/debathena/debathena/counterlog/debian/control	2008-09-02 19:06:54 UTC (rev 23163)
@@ -0,0 +1,13 @@
+Source: debathena-counterlog
+Section: debathena/net
+Priority: extra
+Maintainer: Debian-Athena Project <debathena@mit.edu>
+Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 4.2.0)
+Standards-Version: 3.7.2
+
+Package: debathena-counterlog
+Architecture: all
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Machine counting service for Debathena machines
+ Reports on the existence of this machine to a central logging
+ service so that machines can be counted.

Added: trunk/debathena/debathena/counterlog/debian/control.in
===================================================================
--- trunk/debathena/debathena/counterlog/debian/control.in	2008-08-28 17:15:43 UTC (rev 23162)
+++ trunk/debathena/debathena/counterlog/debian/control.in	2008-09-02 19:06:54 UTC (rev 23163)
@@ -0,0 +1,13 @@
+Source: debathena-counterlog
+Section: debathena/net
+Priority: extra
+Maintainer: Debian-Athena Project <debathena@mit.edu>
+Build-Depends: @cdbs@
+Standards-Version: 3.7.2
+
+Package: debathena-counterlog
+Architecture: all
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Machine counting service for Debathena machines
+ Reports on the existence of this machine to a central logging
+ service so that machines can be counted.

Added: trunk/debathena/debathena/counterlog/debian/debathena-counterlog.cron.daily
===================================================================
--- trunk/debathena/debathena/counterlog/debian/debathena-counterlog.cron.daily	2008-08-28 17:15:43 UTC (rev 23162)
+++ trunk/debathena/debathena/counterlog/debian/debathena-counterlog.cron.daily	2008-09-02 19:06:54 UTC (rev 23163)
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+# We want a unique ID for each machine, ideally surviving a reinstall.
+# Produce the ID using the hardware addresses of the ethernet devices,
+# and save it to a file so that it at least survives the duration of
+# this install.
+idfile=/var/lib/debathena-counterlog/id
+if [ -r $idfile ]; then
+  id=$(cat $idfile)
+else
+  id=$(ifconfig -a | sed -nre 's/.*HWaddr ([^ ]+).*/\1/p' | sort -u \
+       | md5sum | awk '{print $1}')
+  echo "$id" > $idfile
+fi
+
+# Determine if this is an Athena 10 or Debathena machine.
+slist=/etc/apt/sources.list.d/debathena.list
+if [ ! -r $slist ]; then
+  slist=/etc/apt/sources.list
+fi
+aptloc=$(awk '/^deb .* debathena.*/ {print $2}' $slist)
+case $aptloc in
+*//athena10.mit.edu/*)
+  version=athena10
+  loghost=wslogger.mit.edu
+  ;;
+*//debathena.mit.edu/*)
+  # SIPB does not currently have a log host set up.  Change this block
+  # if it sets one up and wants counter logs.
+  version=debathena
+  exit
+  ;;
+*)
+  exit
+  ;;
+esac
+
+host=$(hostname --fqdn)
+mtype=$(machtype)
+ctype=$(machtype -c)
+
+# Traditionally, we do counter logging via syslog.  (We could do it
+# via HTTP post or something else instead, if we wanted.)  We can't
+# rely on central syslogging being configured because that's a
+# cluster-only package.  Fortunately, the syslog protocol is dead
+# simple, so just fake a packet to the log host.
+msg="<13>root: counterlog: $host $mtype $ctype $version $id cron"
+printf "%s" "$msg" | nc -q0 -u $loghost syslog

Added: trunk/debathena/debathena/counterlog/debian/debathena-counterlog.dirs
===================================================================
--- trunk/debathena/debathena/counterlog/debian/debathena-counterlog.dirs	2008-08-28 17:15:43 UTC (rev 23162)
+++ trunk/debathena/debathena/counterlog/debian/debathena-counterlog.dirs	2008-09-02 19:06:54 UTC (rev 23163)
@@ -0,0 +1 @@
+var/lib/debathena-counterlog

Added: trunk/debathena/debathena/counterlog/debian/rules
===================================================================
--- trunk/debathena/debathena/counterlog/debian/rules	2008-08-28 17:15:43 UTC (rev 23162)
+++ trunk/debathena/debathena/counterlog/debian/rules	2008-09-02 19:06:54 UTC (rev 23163)
@@ -0,0 +1,4 @@
+#!/usr/bin/make -f
+
+DEB_AUTO_UPDATE_DEBIAN_CONTROL = 1
+include /usr/share/cdbs/1/rules/debhelper.mk


Property changes on: trunk/debathena/debathena/counterlog/debian/rules
___________________________________________________________________
Name: svn:executable
   + *


home help back first fref pref prev next nref lref last post