summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Legler <a3li@gentoo.org>2011-06-12 17:13:51 +0000
committerAlex Legler <a3li@gentoo.org>2011-06-12 17:13:51 +0000
commitd2e527e25fde24c97b9978139f052510bfb068e6 (patch)
tree9be171312640a5d24f5fccdbbd23de87cb9fa9af /www-servers/thin/files
parentVersion bump to the latest. Drop 1.5.0. (diff)
downloadgentoo-2-d2e527e25fde24c97b9978139f052510bfb068e6.tar.gz
gentoo-2-d2e527e25fde24c97b9978139f052510bfb068e6.tar.bz2
gentoo-2-d2e527e25fde24c97b9978139f052510bfb068e6.zip
Version bump. The package now installs init scripts and works with more rspec versions.
(Portage version: 2.2.0_alpha39/cvs/Linux x86_64)
Diffstat (limited to 'www-servers/thin/files')
-rw-r--r--www-servers/thin/files/thin.confd20
-rw-r--r--www-servers/thin/files/thin.initd63
2 files changed, 83 insertions, 0 deletions
diff --git a/www-servers/thin/files/thin.confd b/www-servers/thin/files/thin.confd
new file mode 100644
index 000000000000..ca517d6fe36c
--- /dev/null
+++ b/www-servers/thin/files/thin.confd
@@ -0,0 +1,20 @@
+# /etc/conf.d/thin: Configuration for /etc/init.d/thin*
+# Copy this file to /etc/conf.d/thin.SERVERNAME for server specific options.
+
+# Set the configuration file location.
+# In start-all mode (/etc/init.d/thin), this must point to the directory where
+# all the thin configurations are located.
+# When starting a specific server (/etc/init.d/thin.SERVER), point to the exact
+# location of the .yml configuration file.
+# CONFIG="/etc/thin/${SVCNAME#*.}.yml"
+
+# Disable looking for a configuration file.
+# You can use THIN_OPTS instead for setting command line options.
+# NOCONFIG=0
+
+# Set the Ruby interpreter to use.
+# RUBY="/usr/bin/ruby"
+
+# Set command line options to pass to thin.
+# In specific server mode, '--tag SERVER_NAME' is automatically appended.
+# THIN_OPTS=
diff --git a/www-servers/thin/files/thin.initd b/www-servers/thin/files/thin.initd
new file mode 100644
index 000000000000..35dfee6ee718
--- /dev/null
+++ b/www-servers/thin/files/thin.initd
@@ -0,0 +1,63 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/www-servers/thin/files/thin.initd,v 1.1 2011/06/12 17:13:51 a3li Exp $
+
+SERVER=${SVCNAME#*.}
+if [ ${SERVER} != thin ]; then
+ CONFIG=${CONFIG:-/etc/thin/${SERVER}.yml}
+else
+ CONFIG=${CONFIG:-/etc/thin/}
+fi
+NOCONFIG=${NOCONFIG:-0}
+RUBY=${RUBY:-/usr/bin/ruby}
+THIN_OPTS=${THIN_OPTS:-}
+
+depend() {
+ need net localmount
+}
+
+checkconfig() {
+ [ ${SERVER} = thin -o ${NOCONFIG} != 0 ] && return 0
+
+ if [ ! -f ${CONFIG} ]; then
+ eerror "Unable to find the server configuration."
+ eerror "Please set the CONFIG variable in /etc/conf.d/${SVCNAME} or"
+ eerror "set NOCONFIG there to 1 to disable looking for a config file."
+ return 1
+ fi
+}
+
+buildargs() {
+ if [ ${NOCONFIG} = 0 -a ${SERVER} != thin ]; then
+ echo -n "-C ${CONFIG} "
+ fi
+
+ echo -n "${THIN_OPTS}"
+}
+
+action() {
+ checkconfig || return 1
+
+ if [ ${SERVER} = thin ]; then
+ ebegin "$2 all thin servers in ${CONFIG}"
+ ${RUBY} /usr/bin/thin $1 $(buildargs) --all ${CONFIG}
+ eend $?
+ else
+ ebegin "$2 thin server ${SERVER}"
+ ${RUBY} /usr/bin/thin $(buildargs) --tag ${SERVER} $1
+ eend $?
+ fi
+}
+
+start() {
+ action start 'Starting'
+}
+
+stop() {
+ action stop 'Stopping'
+}
+
+restart() {
+ action restart 'Restarting'
+}