com.anrisoftware.sscontrol.httpd.redmine.thin.templates.thin_config.stg Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sscontrol-httpd-redmine Show documentation
Show all versions of sscontrol-httpd-redmine Show documentation
Redmine project management web application - http://www.redmine.org/
thinDefaultsConfig(args) ::= <<
# RoboBee Auto Generated
# Configuration for
# Author: Erwin Müller, \
THIN_USER=""
THIN_GROUP=""
RUN_AT_STARTUP="YES"
>>
thinScriptConfig(args) ::= <<
#!/bin/sh
### BEGIN INIT INFO
# Provides: thin
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: thin initscript
# Description: thin
### END INIT INFO
# RoboBee Auto Generated
# Configuration for
# Author: Erwin Müller, \
# Original author: Forrest Robertson
# Do NOT "set -e"
SCRIPT_NAME=""
DAEMON=""
PKGNAME="thin"
RUN_DIR=""
LOG_DIR=""
# Read configuration variable file if it is present
[ -r /etc/default/$PKGNAME ] && . /etc/default/$PKGNAME
DAEMON_ARGS="-g $THIN_GROUP -u $THIN_USER"
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
run_action() {
ACTION="$1"
createdir $THIN_GROUP $THIN_USER 755 $RUN_DIR
createdir $THIN_GROUP $THIN_USER 750 $LOG_DIR
if [ -x /usr/bin/ruby1.9.1 ]; then
/usr/bin/ruby1.9.1 $DAEMON $ACTION --all /etc/thin1.9.1 $DAEMON_ARGS
fi
if [ -x /usr/bin/ruby1.8 ]; then
/usr/bin/ruby1.8 $DAEMON $ACTION --all /etc/thin1.8 $DAEMON_ARGS
fi
}
# Function that creates a directory with the specified
# ownership and permissions
# Parameters:
# $1 = user
# $2 = group
# $3 = permissions (octal)
# $4 = path to directory
# Return value: none
createdir()
{
# In the future, use -P/-Z to have SE Linux enhancement
install -d --group="$2" --mode="$3" --owner="$1" "$4"
}
case "$1" in
start)
run_action start
;;
stop)
run_action stop
;;
restart|force-reload|reload)
run_action restart
;;
*)
echo "Usage: $SCRIPT_NAME {start|stop|restart}" >&2
exit 3
;;
esac
>>