Created
November 4, 2015 09:25
-
-
Save mbarcia/ec64ce910f246228f2b2 to your computer and use it in GitHub Desktop.
/etc/init.d/memcached for CentOS 5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# memcached Startup script for memcached processes | |
# | |
# chkconfig: - 90 10 | |
# description: Memcache provides fast memory based storage. | |
# processname: memcached | |
# These mappings correspond one-to-one with Drupal's settings.php file. | |
[ -f memcached ] || exit 0 | |
prog="memcached" | |
start() { | |
echo -n $"Starting $prog " | |
# Default cache. | |
memcached -m 64 -l 0.0.0.0 -p 11212 -d -u nobody | |
RETVAL=$? | |
echo | |
return $RETVAL | |
} | |
stop() { | |
if test "x`pidof memcached`" != x; then | |
echo -n $"Stopping $prog " | |
killall memcached | |
echo | |
fi | |
RETVAL=$? | |
return $RETVAL | |
} | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
restart) | |
stop | |
start | |
;; | |
condrestart) | |
if test "x`pidof memcached`" != x; then | |
stop | |
start | |
fi | |
;; | |
*) | |
echo $"Usage: $0 {start|stop|restart|condrestart}" | |
exit 1 | |
esac | |
exit $RETVAL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment