diff options
author | Cameron Norman <CameronNemo@users.noreply.github.com> | 2014-06-02 20:40:31 -0700 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2015-11-18 02:40:31 -0800 |
commit | 3a91e0a504283d184594b728bd1d4e5baa2de1af (patch) | |
tree | 1352a36f02a59ec390356bdb16b4f828d458ba0b /scripts | |
parent | 00b34fd951d8a00ec8e4911ebad444bf77069bc8 (diff) | |
download | memcached-3a91e0a504283d184594b728bd1d4e5baa2de1af.tar.gz |
Added main memcached job.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/memcached.upstart | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/scripts/memcached.upstart b/scripts/memcached.upstart new file mode 100644 index 0000000..b1c1017 --- /dev/null +++ b/scripts/memcached.upstart @@ -0,0 +1,25 @@ +description "memcached - high performance memory caching daemon" +author "Cameron Norman <camerontnorman@gmail.com>" + +start on filesystem +stop on runlevel [016] + +pre-start script + ret=0 + + test -x /usr/bin/memcached || { stop; exit 0; } + + # Main + start memcached-server || ret=$? + # Instances + for i in /etc/memcached_*.conf; do + i=${i#/etc/memcached_} + i=${i%.conf} + test "$i" = "*" && continue + start memcached-server SERVER=$i || ret=$? + done + + exit $ret +end script + +post-stop exec initctl emit stop-memcached-servers |