summaryrefslogtreecommitdiff
path: root/scripts/start-memcached
diff options
context:
space:
mode:
authorGordon Franke <gordon.franke@web.de>2011-08-07 19:18:23 -0700
committerdormando <dormando@rydia.net>2011-08-10 08:44:52 -0700
commit1e52a2543fe02fc48e3396456d487e6a07065453 (patch)
treebe4104f9a398ee19a2805419762207d30125bf2b /scripts/start-memcached
parent8975fd491ad00e91353d5af45f6b3cdd0e722afc (diff)
downloadmemcached-1e52a2543fe02fc48e3396456d487e6a07065453.tar.gz
Allow memcached-init to start multiple instances
Patch by Gordon Franke. Whitespace fixes and comments added by Dormando. There are many better ways to do this, but it doesn't break the default and the "status" command never existed. Servers can be started and stopped individually, and people seem to like the idea.
Diffstat (limited to 'scripts/start-memcached')
-rwxr-xr-xscripts/start-memcached6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/start-memcached b/scripts/start-memcached
index 145a25a..e33b95c 100755
--- a/scripts/start-memcached
+++ b/scripts/start-memcached
@@ -23,6 +23,11 @@ my $params; my $etchandle; my $etcfile = "/etc/memcached.conf";
my $memcached = "/usr/bin/memcached";
my $pidfile = "/var/run/memcached.pid";
+if (scalar(@ARGV) == 2) {
+ $etcfile = shift(@ARGV);
+ $pidfile = shift(@ARGV);
+}
+
# If we don't get a valid logfile parameter in the /etc/memcached.conf file,
# we'll just throw away all of our in-daemon output. We need to re-tie it so
# that non-bash shells will not hang on logout. Thanks to Michael Renner for
@@ -114,4 +119,3 @@ if($pid == 0)
print STDERR "Can't write pidfile to $pidfile.\n";
}
}
-