Last active
August 29, 2015 14:10
-
-
Save perusio/dc6adca881cf193b8988 to your computer and use it in GitHub Desktop.
This file contains 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 | |
# | |
# description: Kyoto Tycoon is a lightweight database server. | |
# processname: ktserver | |
# config: /usr/local/etc/ktserver.conf | |
# pidfile: /var/run/ktserver.pid | |
# Source function library. | |
. /etc/init.d/functions | |
PORT=1978 | |
LOG="/var/log/ktserver.log" | |
DB="" | |
OPTIONS="" | |
if [ -f /usr/local/etc/ktserver.conf ];then | |
. /usr/local/etc/ktserver.conf | |
fi | |
# Check that networking is up. | |
. /etc/sysconfig/network | |
if [ "$NETWORKING" = "no" ] | |
then | |
exit 0 | |
fi | |
RETVAL=0 | |
ktserver="/usr/local/bin/ktserver" | |
prog="ktserver" | |
start () { | |
echo -n $"Starting $prog: " | |
daemon --pidfile /var/run/ktserver.pid $ktserver -dmn -port $PORT -log $LOG -pid /var/run/ktserver.pid $OPTIONS $DB | |
RETVAL=$? | |
echo | |
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/ktserver | |
} | |
stop () { | |
echo -n $"Stopping $prog: " | |
killproc -p /var/run/ktserver.pid $prog | |
RETVAL=$? | |
echo | |
if [ $RETVAL -eq 0 ] ; then | |
rm -f /var/lock/subsys/ktserver | |
rm -f /var/run/ktserver.pid | |
fi | |
} | |
restart () { | |
stop | |
start | |
} | |
# See how we were called. | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
status) | |
status ktserver | |
;; | |
restart|reload|force-reload) | |
restart | |
;; | |
*) | |
echo $"Usage: $0 {start|stop|status|restart|reload|force-reload}" | |
exit 1 | |
esac | |
exit $? |
This file contains 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
# | |
# Show specification http://fallabs.com/kyototycoon/command.html | |
# | |
# Specifies the path of the log file. | |
LOG="/var/log/ktserver.log" | |
# Specifies a database. | |
DB="/var/lib/ktserver/casket.kch#opts=l#bnum=20000000#msiz=256m#dfunit=8" | |
# Specifies other options. | |
# OPTIONS="-plsv /usr/local/libexec/ktplugservmemc.so -plex 'port=11211'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment