memcached/rc.memcached

Thu, 04 Oct 2012 20:30:05 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 04 Oct 2012 20:30:05 +0200
changeset 715
c10fb90893b9
permissions
-rw-r--r--

Correct out of date build configuration, porting to Solaris 11 network
link infrastructure and new libpcap logic. This additionally allows for
device drivers in subdirectories of /dev. Correct packaged nmap
personalities and signatures to work out of the box. Finally, hack
arpd logic to properly close sockets and quit on TERM by repeating
signaling in the run command script. Sadly, all this fails to correct
the run time behaviour of honeyd which fails to bind to the IP layer.

     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