memcached/rc.memcached

Tue, 28 Aug 2012 18:28:45 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 28 Aug 2012 18:28:45 +0200
changeset 528
3b08e6396b45
permissions
-rw-r--r--

Massively update from 5.1 to 5.5 release, completely changing from
autotools to cmake build configuration along with the corresponding
corrections. Correct some less important problems like typical german
english mistakes, as well as use parallel make for faster builds with
SMP and multicore architectures. Warning, the 5.5 releases of MySQL
seem to be equally bug ridden as the 5.1 are, for example building
the NDBCluster storage engine fails.

     1 #!@l_prefix@/bin/openpkg rc
     2 ##
     3 ##  rc.memcached -- Run-Commands
     4 ##
     6 %config
     7     memcached_enable="$openpkg_rc_def"
     8     memcached_daemon="yes"
     9     memcached_flags="-l 127.0.0.1 -p 11211"
    10     memcached_log_prolog="true"
    11     memcached_log_epilog="true"
    12     memcached_log_numfiles="10"
    13     memcached_log_minsize="1M"
    14     memcached_log_complevel="9"
    16 %common
    17     memcached_pidfile="@l_prefix@/var/memcached/memcached.pid"
    18     memcached_signal () {
    19         [ -f $memcached_pidfile ] && kill -$1 `cat $memcached_pidfile`
    20     }
    22 %status -u @l_susr@ -o
    23     memcached_usable="unknown"
    24     memcached_active="no"
    25     rcService memcached enable yes && \
    26         memcached_signal 0 && memcached_active="yes"
    27     echo "memcached_enable=\"$memcached_enable\""
    28     echo "memcached_usable=\"$memcached_usable\""
    29     echo "memcached_active=\"$memcached_active\""
    31 %start -p 100 -u @l_susr@
    32     rcService memcached enable yes || exit 0
    33     rcService memcached active yes && exit 0
    34     rcVarIsYes memcached_daemon || exit 0
    35     @l_prefix@/bin/memcached \
    36         -d -u @l_nusr@ \
    37         -P $memcached_pidfile \
    38         $memcached_flags
    40 %stop -p 900 -u @l_susr@
    41     rcService memcached enable yes || exit 0
    42     rcService memcached active no  && exit 0
    43     rcVarIsYes memcached_daemon || exit 0
    44     memcached_signal TERM
    45     sleep 2
    46     rm -f $memcached_pidfile >/dev/null 2>&1 || true
    48 %restart -p 100 -u @l_susr@
    49     rcService memcached enable yes || exit 0
    50     rcService memcached active no  && exit 0
    51     rcVarIsYes memcached_daemon || exit 0
    52     rc memcached stop start
    54 %daily -u @l_susr@
    55     rcService memcached enable yes || exit 0
    56     rcVarIsYes memcached_daemon || exit 0
    57     shtool rotate -f \
    58         -n $memcached_log_numfiles -s $memcached_log_minsize -d \
    59         -z $memcached_log_complevel -m 644 -o @l_nusr@ -g @l_ngrp@ \
    60         -P "$memcached_log_prolog" \
    61         -E "$memcached_log_epilog && rc memcached reload" \
    62         @l_prefix@/var/memcached/memcached.log

mercurial