Index: trunk/debs/wikimedia-task-search/debian/control |
— | — | @@ -7,7 +7,7 @@ |
8 | 8 | |
9 | 9 | Package: wikimedia-task-search |
10 | 10 | Architecture: all |
11 | | -Depends: wikimedia-nis-client, wikimedia-lvs-realserver, openjdk-6-jdk (>= 6b11-2ubuntu2), ant, daemon |
| 11 | +Depends: wikimedia-nis-client, wikimedia-lvs-realserver, openjdk-6-jdk | java-sdk, ant |
12 | 12 | Description: Wikimedia search server |
13 | 13 | This package depends on all packages needed to setup a standard |
14 | 14 | search server. |
Index: trunk/debs/wikimedia-task-search/debian/logrotate |
— | — | @@ -0,0 +1,9 @@ |
| 2 | +/a/search/log/log { |
| 3 | + weekly |
| 4 | + missingok |
| 5 | + notifempty |
| 6 | + rotate 2 |
| 7 | + postrotate |
| 8 | + /etc/init.d/lsearchd restart >/dev/null 2>&1 || true |
| 9 | + endscript |
| 10 | +} |
Index: trunk/debs/wikimedia-task-search/debian/dirs |
— | — | @@ -1 +1,3 @@ |
2 | 2 | etc |
| 3 | +/etc/init.d |
| 4 | +/etc/logrotate.d |
Index: trunk/debs/wikimedia-task-search/debian/postinst |
— | — | @@ -19,6 +19,9 @@ |
20 | 20 | |
21 | 21 | case "$1" in |
22 | 22 | configure) |
| 23 | + # Create user account for lsearchd |
| 24 | + adduser --system --home /var/lib/lsearch --ingroup search --disabled-password --shell /bin/sh lsearch |
| 25 | + |
23 | 26 | # Add a line to /etc/motd describing the task of this server |
24 | 27 | if [ -f /etc/motd.tail ] |
25 | 28 | then |
Index: trunk/debs/wikimedia-task-search/debian/postrm |
— | — | @@ -0,0 +1,39 @@ |
| 2 | +#! /bin/sh |
| 3 | +# postrm script for wikimedia-task-search |
| 4 | +# |
| 5 | +# see: dh_installdeb(1) |
| 6 | + |
| 7 | +set -e |
| 8 | + |
| 9 | +# summary of how this script can be called: |
| 10 | +# * <postrm> `remove' |
| 11 | +# * <postrm> `purge' |
| 12 | +# * <old-postrm> `upgrade' <new-version> |
| 13 | +# * <new-postrm> `failed-upgrade' <old-version> |
| 14 | +# * <new-postrm> `abort-install' |
| 15 | +# * <new-postrm> `abort-install' <old-version> |
| 16 | +# * <new-postrm> `abort-upgrade' <old-version> |
| 17 | +# * <disappearer's-postrm> `disappear' <r>overwrit>r> <new-version> |
| 18 | +# for details, see http://www.debian.org/doc/debian-policy/ or |
| 19 | +# the debian-policy package |
| 20 | + |
| 21 | +case "$1" in |
| 22 | + purge) |
| 23 | + # Remove lsearch user account |
| 24 | + deluser lsearch |
| 25 | + rm -rf /var/lib/lsearch |
| 26 | + ;; |
| 27 | + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) |
| 28 | + ;; |
| 29 | + |
| 30 | + *) |
| 31 | + echo "postrm called with unknown argument \`$1'" >&2 |
| 32 | + exit 1 |
| 33 | +esac |
| 34 | + |
| 35 | +# dh_installdeb will replace this with shell code automatically |
| 36 | +# generated by other debhelper scripts. |
| 37 | + |
| 38 | +#DEBHELPER# |
| 39 | + |
| 40 | +exit 0 |
Index: trunk/debs/wikimedia-task-search/debian/init.d |
— | — | @@ -0,0 +1,69 @@ |
| 2 | +#!/bin/sh |
| 3 | +# chkconfig: 2345 84 16 |
| 4 | +# description: MediaWiki Lucene Search daemon |
| 5 | +# vim: autoindent |
| 6 | + |
| 7 | +SERVICE_NAME="Lucene Search daemon" |
| 8 | +BINDIR=/a/search/lucene-search |
| 9 | +LOGDIR=/a/search/log |
| 10 | + |
| 11 | +. /lib/lsb/init-functions |
| 12 | +. /etc/default/rcS |
| 13 | + |
| 14 | +export PATH=/usr/bin:/usr/local/sbin:$PATH |
| 15 | +pid=/var/run/lsearchd.pid |
| 16 | + |
| 17 | +case "$1" in |
| 18 | + start) |
| 19 | + # Check if running |
| 20 | + if [ -s $pid ] && kill -0 $(cat /var/run/lsearchd.pid) >/dev/null 2>&1; then |
| 21 | + log_progress_msg "Already running" |
| 22 | + log_end_msg 0 |
| 23 | + exit 0 |
| 24 | + fi |
| 25 | + log_daemon_msg "Starting $SERVICE_NAME" |
| 26 | + |
| 27 | + # Increase FD limit |
| 28 | + ulimit -n 8192 |
| 29 | + # Run the daemon |
| 30 | + if start-stop-daemon --start --quiet --background --user lsearch --chuid lsearch --pidfile $pid --make-pidfile --exec /usr/bin/java -- -Xmx1500m -Djava.rmi.server.codebase=file://$BINDIR/LuceneSearch.jar -Djava.rmi.server.hostname=$HOSTNAME -jar $BINDIR/LuceneSearch.jar |
| 31 | + then |
| 32 | + rc=0 |
| 33 | + sleep 1 |
| 34 | + if ! kill -0 $(cat /var/run/lsearchd.pid) >/dev/null 2>&1; then |
| 35 | + log_failure_msg "$SERVICE_NAME failed to start" |
| 36 | + rc=1 |
| 37 | + fi |
| 38 | + fi |
| 39 | + |
| 40 | + if [ $rc -eq 0 ]; then |
| 41 | + log_end_msg 0 |
| 42 | + else |
| 43 | + log_end_msg 1 |
| 44 | + rm -f /var/run/lsearchd.pid |
| 45 | + fi |
| 46 | + ;; |
| 47 | + stop) |
| 48 | + log_daemon_msg "Stopping $SERVICE_NAME" |
| 49 | + start-stop-daemon --stop --quiet --oknodo --pidfile $pid |
| 50 | + log_end_msg $? |
| 51 | + rm -f /var/run/lsearchd.pid |
| 52 | + echo |
| 53 | + ;; |
| 54 | + restart) |
| 55 | + $0 stop |
| 56 | + sleep 5s |
| 57 | + $0 start |
| 58 | + ;; |
| 59 | + status) |
| 60 | + if [ -s $pid ] && kill -0 $(cat /var/run/lsearchd.pid) >/dev/null 2>&1; then |
| 61 | + echo "$SERVICE_NAME is running" |
| 62 | + else |
| 63 | + echo "$SERVICE_NAME is not running" |
| 64 | + fi |
| 65 | + ;; |
| 66 | + *) |
| 67 | + echo "Usage: $0 {start|stop|status|restart}" |
| 68 | + exit 1 |
| 69 | + ;; |
| 70 | +esac |
Index: trunk/debs/wikimedia-task-search/debian/changelog |
— | — | @@ -1,3 +1,13 @@ |
| 2 | +wikimedia-task-search (1.01) hardy; urgency=low |
| 3 | + |
| 4 | + * Add init script |
| 5 | + * Add logrotate script |
| 6 | + * Create lsearch user account, which does not exist in NIS |
| 7 | + * Remove dependency on 'daemon' |
| 8 | + * OpenJDK 6 is too buggy for indexer usage, so be less restrictive in JDKs |
| 9 | + |
| 10 | + -- Mark Bergsma <mark@wikimedia.org> Tue, 16 Sep 2008 22:19:06 +0000 |
| 11 | + |
2 | 12 | wikimedia-task-search (1.0) hardy; urgency=low |
3 | 13 | |
4 | 14 | * Initial release |
Index: trunk/debs/wikimedia-task-search/debian/rules |
— | — | @@ -49,6 +49,8 @@ |
50 | 50 | dh_link |
51 | 51 | |
52 | 52 | install -m 0400 sudoers $(DESTDIR)/etc/ |
| 53 | + install -m 0755 debian/init.d $(DESTDIR)/etc/init.d/lsearchd |
| 54 | + install debian/logrotate $(DESTDIR)/etc/logrotate.d/wikimedia-task-search |
53 | 55 | |
54 | 56 | # Build architecture-independent files here. |
55 | 57 | binary-indep: build install |