Index: trunk/debs/libapache2-mod-setproctitle/mod_setproctitle.c |
— | — | @@ -0,0 +1,61 @@ |
| 2 | + /* |
| 3 | + ** mod_proctitle.c -- Apache proctitle module |
| 4 | + ** |
| 5 | + ** $ apxs -c -i mod_proctitle.c |
| 6 | + ** |
| 7 | + ** # httpd.conf |
| 8 | + ** LoadModule proctitle_module modules/mod_proctitle.so |
| 9 | + */ |
| 10 | + |
| 11 | +#include <stdio.h> |
| 12 | +#include <string.h> |
| 13 | + |
| 14 | +#include "httpd.h" |
| 15 | +#include "http_config.h" |
| 16 | +#include "http_protocol.h" |
| 17 | +#include "ap_config.h" |
| 18 | + |
| 19 | +#define PROCTITLE_LEN 128 |
| 20 | + |
| 21 | +extern char *ap_server_argv0; |
| 22 | + |
| 23 | +char *old_argv0; |
| 24 | +char proctitle_buf[PROCTITLE_LEN + 1]; |
| 25 | + |
| 26 | +static void proctitle_child_init(apr_pool_t *p, server_rec *s) |
| 27 | +{ |
| 28 | + snprintf(ap_server_argv0, PROCTITLE_LEN, "%s :init-child", old_argv0); |
| 29 | +} |
| 30 | + |
| 31 | +static int proctitle_clear(request_rec * r) |
| 32 | +{ |
| 33 | + snprintf(ap_server_argv0, PROCTITLE_LEN, "%s :idle", old_argv0); |
| 34 | + return DECLINED; |
| 35 | +} |
| 36 | + |
| 37 | +static int proctitle_ft(request_rec * r) |
| 38 | +{ |
| 39 | + snprintf(ap_server_argv0, PROCTITLE_LEN, "%s :run %s [%s] %s", |
| 40 | + old_argv0, r->connection->remote_ip, r->hostname, |
| 41 | + r->the_request); |
| 42 | + return DECLINED; |
| 43 | +} |
| 44 | + |
| 45 | +static void proctitle_register_hooks(apr_pool_t * p) |
| 46 | +{ |
| 47 | + ap_hook_child_init(proctitle_child_init, NULL, NULL, APR_HOOK_FIRST); |
| 48 | + ap_hook_translate_name(proctitle_ft, NULL, NULL, APR_HOOK_FIRST); |
| 49 | + ap_hook_log_transaction(proctitle_clear, NULL, NULL, APR_HOOK_LAST); |
| 50 | + old_argv0 = strdup(ap_server_argv0); |
| 51 | +} |
| 52 | + |
| 53 | + /* Dispatch list for API hooks */ |
| 54 | +module AP_MODULE_DECLARE_DATA proctitle_module = { |
| 55 | + STANDARD20_MODULE_STUFF, |
| 56 | + NULL, /* create per-dir config structures */ |
| 57 | + NULL, /* merge per-dir config structures */ |
| 58 | + NULL, /* create per-server config structures */ |
| 59 | + NULL, /* merge per-server config structures */ |
| 60 | + NULL, /* table of config file commands */ |
| 61 | + proctitle_register_hooks /* register hooks */ |
| 62 | +}; |
Index: trunk/debs/libapache2-mod-setproctitle/debian/setproctitle.load |
— | — | @@ -0,0 +1 @@ |
| 2 | +LoadModule proctitle_module /usr/lib/apache2/modules/mod_setproctitle.so |
Index: trunk/debs/libapache2-mod-setproctitle/debian/control |
— | — | @@ -0,0 +1,12 @@ |
| 2 | +Source: libapache2-mod-setproctitle |
| 3 | +Section: web |
| 4 | +Priority: optional |
| 5 | +Maintainer: Domas Mituzas <domas@wikimedia.org> |
| 6 | +Build-Depends: debhelper (>> 5.0.0), apache2-prefork-dev (>= 2.0) |
| 7 | +Standards-Version: 3.8.4 |
| 8 | + |
| 9 | +Package: libapache2-mod-setproctitle |
| 10 | +Architecture: any |
| 11 | +Depends: apache2.2-common, ${shlibs:Depends}, ${misc:Depends} |
| 12 | +Description: Sets proctitle for apache2 processes |
| 13 | + With request URI and vhost and IP |
Index: trunk/debs/libapache2-mod-setproctitle/debian/source/format |
— | — | @@ -0,0 +1 @@ |
| 2 | +3.0 (native) |
Index: trunk/debs/libapache2-mod-setproctitle/debian/compat |
— | — | @@ -0,0 +1 @@ |
| 2 | +5 |
Index: trunk/debs/libapache2-mod-setproctitle/debian/changelog |
— | — | @@ -0,0 +1,5 @@ |
| 2 | +libapache2-mod-setproctitle (0.1) unstable; urgency=low |
| 3 | + |
| 4 | + * Initial release |
| 5 | + |
| 6 | + -- Domas Mituzas <domas@wikimedia.org> Sun, 19 Jun 2011 16:04:20 +0200 |
Index: trunk/debs/libapache2-mod-setproctitle/debian/copyright |
— | — | @@ -0,0 +1,7 @@ |
| 2 | +This package was created by Domas, blah blah |
| 3 | + |
| 4 | +Copyright: |
| 5 | + |
| 6 | + © 2001-2011 Domas Mituzas <domas@wikimedia.org> |
| 7 | + |
| 8 | + This is in public domain too. |
Index: trunk/debs/libapache2-mod-setproctitle/debian/libapache2-mod-setproctitle.postinst |
— | — | @@ -0,0 +1,24 @@ |
| 2 | +#!/bin/bash |
| 3 | + |
| 4 | +set -e |
| 5 | + |
| 6 | +case "$1" in |
| 7 | + configure) |
| 8 | + : |
| 9 | + if test "${2+set}" != set; then |
| 10 | + a2enmod setproctitle |
| 11 | + : |
| 12 | + elif test -z "$2" -o "$2" = "<unknown>"; then |
| 13 | + a2enmod setproctitle |
| 14 | + : |
| 15 | + fi ;; |
| 16 | + abort-upgrade | abort-remove | abort-deconfigure) |
| 17 | + : |
| 18 | + ;; |
| 19 | + *) echo "$0: didn't understand being called with \`$1'" 1>&2 |
| 20 | + exit 1;; |
| 21 | +esac |
| 22 | + |
| 23 | +#DEBHELPER# |
| 24 | + |
| 25 | +exit 0 |
Index: trunk/debs/libapache2-mod-setproctitle/debian/libapache2-mod-setproctitle.postrm |
— | — | @@ -0,0 +1,23 @@ |
| 2 | +#! /bin/sh |
| 3 | + |
| 4 | +set -e |
| 5 | + |
| 6 | +case "$1" in |
| 7 | + remove) |
| 8 | + a2dismod setproctitle |
| 9 | + : |
| 10 | + ;; |
| 11 | + purge | disappear | upgrade | failed-upgrade | abort-upgrade) |
| 12 | + : |
| 13 | + ;; |
| 14 | + abort-install) |
| 15 | + a2dismod setproctitle |
| 16 | + : |
| 17 | + ;; |
| 18 | + *) echo "$0: didn't understand being called with \`$1'" 1>&2 |
| 19 | + exit 1;; |
| 20 | +esac |
| 21 | + |
| 22 | +#DEBHELPER# |
| 23 | + |
| 24 | +exit 0 |
Index: trunk/debs/libapache2-mod-setproctitle/debian/rules |
— | — | @@ -0,0 +1,46 @@ |
| 2 | +#!/usr/bin/make -f |
| 3 | +# GNU copyright 1997 to 1999 by Joey Hess. |
| 4 | + |
| 5 | +build: build-stamp |
| 6 | +build-stamp: |
| 7 | + dh_testdir |
| 8 | + apxs2 -c mod_setproctitle.c |
| 9 | + touch build-stamp |
| 10 | + |
| 11 | +clean: |
| 12 | + dh_testdir |
| 13 | + dh_testroot |
| 14 | + rm -f build-stamp |
| 15 | + rm -f mod_setproctitle.la mod_setproctitle.lo mod_setproctitle.slo mod_setproctitle.o |
| 16 | + rm -rf .libs |
| 17 | + dh_clean |
| 18 | + |
| 19 | +install: build |
| 20 | + dh_testdir |
| 21 | + dh_testroot |
| 22 | + dh_clean -k |
| 23 | + dh_installdirs |
| 24 | + dh_install |
| 25 | + |
| 26 | +# Build architecture-independent files here. |
| 27 | +binary-indep: build install |
| 28 | +# We have nothing to do by default. |
| 29 | + |
| 30 | +# Build architecture-dependent files here. |
| 31 | +binary-arch: build install |
| 32 | + dh_testdir |
| 33 | + dh_testroot |
| 34 | + dh_installdocs |
| 35 | + dh_installchangelogs |
| 36 | + dh_link |
| 37 | + dh_strip |
| 38 | + dh_compress |
| 39 | + dh_fixperms |
| 40 | + dh_installdeb |
| 41 | + dh_shlibdeps |
| 42 | + dh_gencontrol |
| 43 | + dh_md5sums |
| 44 | + dh_builddeb |
| 45 | + |
| 46 | +binary: binary-indep binary-arch |
| 47 | +.PHONY: build clean binary-indep binary-arch binary install |
Property changes on: trunk/debs/libapache2-mod-setproctitle/debian/rules |
___________________________________________________________________ |
Added: svn:executable |
1 | 48 | + * |
Index: trunk/debs/libapache2-mod-setproctitle/debian/libapache2-mod-setproctitle.install |
— | — | @@ -0,0 +1,2 @@ |
| 2 | +.libs/mod_setproctitle.so usr/lib/apache2/modules |
| 3 | +debian/setproctitle.load etc/apache2/mods-available |