~yolanda.robla/ubuntu/trusty/memcached/add_distribution

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh

set -e

GROUP="memcache"
USER="memcache"
DATADIR="/nonexistent"

# shamelessly copied from debian gearman-job-server package...

case "$1" in
configure)
    # creating memcache group if it isn't already there
    if ! getent group $GROUP >/dev/null ; then
            # Adding system group
            addgroup --system $GROUP >/dev/null
    fi

    # creating memcache user if it isn't already there
    if ! getent passwd $USER >/dev/null ; then
            # Adding system user
            adduser \
              --system \
              --disabled-login \
              --ingroup $GROUP \
              --home $DATADIR \
              --gecos "Memcached" \
              --shell /bin/false \
              $USER  >/dev/null
    fi
    if [ ! -e /etc/memcached.conf ]
        then
            mkdir -p /etc
            cp /usr/share/memcached/memcached.conf.default /etc/memcached.conf
    fi
    ;;
esac

#DEBHELPER#