ALT Linux sysadmins discussion
 help / color / mirror / Atom feed
* [Sysadmins] Redmine init script
@ 2009-02-13 10:21 Денис Ягофаров
  2009-02-13 10:45 ` Alexey I. Froloff
  0 siblings, 1 reply; 2+ messages in thread
From: Денис Ягофаров @ 2009-02-13 10:21 UTC (permalink / raw)
  To: ALT Linux sysadmin discuss

[-- Attachment #1: Type: text/plain, Size: 227 bytes --]

Доброго времени суток.

Я не профессионал в написании init сценариев, но мне понадобилось 
запускать redmine.

Вот что получилось.


[-- Attachment #2: redmine.init --]
[-- Type: text/plain, Size: 2398 bytes --]

#! /bin/sh
#
# redmine       Redmine task tracking system
#
# chkconfig: - 70 30
# description:  \
#       Redmine is a flexible project management web application.
#       Written using Ruby on Rails framework, it is cross-platform and cross-database.
# processname: ruby
# config: /etc/sysconfig/redmine

# Do not load RH compatibility interface.
WITHOUT_RC_COMPAT=1

# Source function library.
. /etc/init.d/functions

SourceIfNotEmpty /etc/sysconfig/redmine

RDMSERVE=server
RDM_OPTS="-d -e $RDM_ENV"
PIDFILE=/tmp/redmine.pid
LOCKFILE=none
RETVAL=0
PS_COLUMNS="200"

RDMSERVE="$RPM_SRV/$RDMSERVE"

[ -x "$RDMSERVE" ] || exit 1

start()
{
        start_daemon --displayname redmine --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --user "$RDM_USER" --expect-user "$RDM_USER" -- $RDMSERVE $RDM_OPTS
        ps aux --columns 200 | grep 'script/server' | grep -v grep | awk '{print $2}' > $PIDFILE
        RETVAL=$?
        return $RETVAL
}

stop()
{
        stop_daemon --displayname redmine --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user "$RDM_USER" -- ruby
        RETVAL=$?
        return $RETVAL
}

restart()
{
        stop
        start
}

reload()
{
        msg_reloading redmine
        stop_daemon --pidfile "$PIDFILE" --expect-user "$RDM_USER" -HUP -- ruby
        RETVAL=$?
        return $RETVAL
}

# See how we were called.
case "$1" in
        start)
                start
                ;;
        stop)
                stop
                ;;
        reload)
                reload
                ;;
        restart)
                restart
                ;;
        condstop)
                if [ -e "$LOCKFILE" ]; then
                        stop
                fi
                ;;
        condrestart)
                if [ -e "$LOCKFILE" ]; then
                        restart
                fi
                ;;
        condreload)
                if [ -e "$LOCKFILE" ]; then
                        reload
                fi
                ;;
        status)
                status --displayname redmine --pidfile "$PIDFILE" --expect-user "$RDM_USER" -- ruby
                RETVAL=$?
                ;;
        *)
                msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|condreload|status}"
                RETVAL=1
esac

exit $RETVAL

[-- Attachment #3: redmine.sysconfig --]
[-- Type: text/plain, Size: 169 bytes --]

# Redmine user
RDM_USER=redmine

# Redmine environment ( -e option )
RDM_ENV=production

# Redmine path to server script
RPM_SRV=/opt/redmine/redmine-0.8.0/script

[-- Attachment #4: denyago.vcf --]
[-- Type: text/x-vcard, Size: 281 bytes --]

begin:vcard
fn:Denis Timurovich Yagofarov
n:Yagofarov;Denis Timurovich
org:ITGIS NASU
adr:room 615;;Chokolovski blvdr., 13;Kiev;;03151;Ukraine
email;internet:denyago@rambler.ru
title:system administrator
tel;work:80442480755
x-mozilla-html:FALSE
version:2.1
end:vcard


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Sysadmins] Redmine init script
  2009-02-13 10:21 [Sysadmins] Redmine init script Денис Ягофаров
@ 2009-02-13 10:45 ` Alexey I. Froloff
  0 siblings, 0 replies; 2+ messages in thread
From: Alexey I. Froloff @ 2009-02-13 10:45 UTC (permalink / raw)
  To: sysadmins

[-- Attachment #1: Type: text/plain, Size: 408 bytes --]

* Денис Ягофаров <denyago@> [090213 13:23]:
> Я не профессионал в написании init сценариев, но мне понадобилось 
> запускать redmine.
Какой ужас.  Выкиньте это срочно и никогда-никогда так не
делайте.

script/server запускает webrick, он совершенно не предназначен
для production, только для тестирования.  Я уже давал ссылку как
это запускать под apache и mod_fastcgi.

-- 
Regards,
Sir Raorn.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-02-13 10:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-13 10:21 [Sysadmins] Redmine init script Денис Ягофаров
2009-02-13 10:45 ` Alexey I. Froloff

ALT Linux sysadmins discussion

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sysadmins/0 sysadmins/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 sysadmins sysadmins/ http://lore.altlinux.org/sysadmins \
		sysadmins@lists.altlinux.org sysadmins@lists.altlinux.ru sysadmins@lists.altlinux.com
	public-inbox-index sysadmins

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.sysadmins


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git