summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorCameron Norman <CameronNemo@users.noreply.github.com>2014-06-02 20:43:09 -0700
committerdormando <dormando@rydia.net>2015-11-18 02:40:37 -0800
commitb9d8181e8d7907188b08a8d9f96f183606e71821 (patch)
treeedf51d85ab20d34b8d0df88b0f9256b05212e6de /scripts
parent3a91e0a504283d184594b728bd1d4e5baa2de1af (diff)
downloadmemcached-b9d8181e8d7907188b08a8d9f96f183606e71821.tar.gz
Add instance job for memcached
This is (these are) automatically started and stopped by the main job.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/memcached-server.upstart26
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/memcached-server.upstart b/scripts/memcached-server.upstart
new file mode 100644
index 0000000..0e9b4ac
--- /dev/null
+++ b/scripts/memcached-server.upstart
@@ -0,0 +1,26 @@
+description "memcached-server - high-performance memory caching daemon (instance)"
+author "Cameron Norman <camerontnorman@gmail.com>"
+
+stop on stop-memcached-servers or runlevel [016]
+
+expect daemon
+respawn
+
+# Instance w/ default value so main server starts without SERVER param
+env SERVER=""
+instance $SERVER
+usage "SERVER - instance of memcached with corresponding /etc/memcached_$SERVER config"
+
+script
+ if test "x$SERVER" = "x"; then
+ name="memcached"
+ else
+ name="memcached_$SERVER"
+ fi
+
+ test -f /etc/${name}.conf || {
+ echo "No config found, not starting."; exit 1
+ }
+
+ exec /usr/share/memcached/scripts/start-memcached /etc/${name}.conf /var/run/${name}.pid
+end script