#!/bin/sh
# start_memcached.sh - start a memcached instance, inspired from ruby-mysql2
# It is in turn inspired by
# debian/test_mysql.sh from libdbi-drivers source package.

set -e

MEMCACHED_USER=nobody
PIDFILE=/tmp/memcached.pid

# Start memcached
/usr/bin/memcached -d -u ${MEMCACHED_USER} -P ${PIDFILE}

dh_auto_install

# Stop memcached and cleanup pid file
kill -9 `cat /tmp/memcached.pid`
rm /tmp/memcached.pid
