Project

General

Profile

HowTo Install Redmine on openSUSE » History » Version 2

Dr. Ing. Dieter Jurzitza, 2015-09-18 17:38

1 1 Anonymous
h1. HowTo Install Redmine on openSUSE
2
3
h2. Installation
4
5
The installation process can be done as described [[http://www.redmine.org/projects/redmine/wiki/RedmineInstall here]]
6
7
h2. Startscript for openSUSE 12.2
8
9 2 Dr. Ing. Dieter Jurzitza
Please note that for more recent installations you have to tell the server that it should listen not only to localhost, 
10
but to - usually - all hosts that want to talk to redmine. To achieve this, the script /etc/init.d/redmine as depicted below
11
should be changed as follows:
12
13
add the line "RAILSACCESS" below line 34
14
ENVIRONMENT=production
15
RAILSACCESS="0.0.0.0"
16
17
and change line 73
18
    startproc -t 2 -u $REDMINE_USER -g $REDMINE_GROUP /usr/bin/ruby $REDMI-NE_BIN server webrick -e $ENVIRONMENT >$RCFILE 2>&1
19
20
into
21
    startproc -t 2 -u $REDMINE_USER -g $REDMINE_GROUP /usr/bin/ruby $REDMI-NE_BIN server webrick -b $RAILSACCESS -e $ENVIRONMENT >$RCFILE 2>&1
22
23 1 Anonymous
/etc/init.d/redmine
24
<pre>
25
#! /bin/sh
26
# customized for redmine 2.1. original author below
27
#
28
# Copyright (c) 2009 SQQD GmbH Lichtentanne, Germany.
29
#
30
# Author: Gerrit Beine <gerrit.beine@gmx.de>, 2009
31
#
32
# /etc/init.d/redmine
33
#
34
#   and symbolic its link
35
#
36
# /usr/sbin/rcredmine
37
#
38
# System startup script for the redmine daemon
39
#
40
### BEGIN INIT INFO
41
# Provides:       redmine
42
# Required-Start: $remote_fs $syslog $time
43
# Should-Start:   $network smtp
44
# Required-Stop:  $remote_fs $syslog
45
# Should-Stop:    $network smtp
46
# Default-Start:  2 3 5
47
# Default-Stop:   0 1 6
48
# Short-Description: Redmine Web Server
49
# Description:    Redmine Web Server
50
### END INIT INFO
51
52
REDMINE_BIN=/srv/redmine/current/script/rails
53
REDMINE_USER=user
54
REDMINE_GROUP=users
55
test -x $REDMINE_BIN || exit 5
56
PIDFILE=/var/run/redmine.pid
57
RCFILE=/var/log/rcredmine.out
58
ENVIRONMENT=production
59
60
# Shell functions sourced from /etc/rc.status:
61
#      rc_check         check and set local and overall rc status
62
#      rc_status        check and set local and overall rc status
63
#      rc_status -v     ditto but be verbose in local rc status
64
#      rc_status -v -r  ditto and clear the local rc status
65
#      rc_failed        set local and overall rc status to failed
66
#      rc_failed <num>  set local and overall rc status to <num><num>
67
#      rc_reset         clear local rc status (overall remains)
68
#      rc_exit          exit appropriate to overall rc status
69
. /etc/rc.status
70
71
# First reset status of this service
72
rc_reset
73
74
# Return values acc. to LSB for all commands but status:
75
# 0 - success
76
# 1 - generic or unspecified error
77
# 2 - invalid or excess argument(s)
78
# 3 - unimplemented feature (e.g. "reload")
79
# 4 - insufficient privilege
80
# 5 - program is not installed
81
# 6 - program is not configured
82
# 7 - program is not running
83
#
84
# Note that starting an already running service, stopping
85
# or restarting a not-running service as well as the restart
86
# with force-reload (in case signalling is not supported) are
87
# considered a success.
88
89
case "$1" in
90
    start)
91
    echo -n "Starting Redmine daemon"
92
    ## Start daemon with startproc(8). If this fails
93
    ## the echo return value is set appropriate.
94
95
    # NOTE: startproc return 0, even if service is
96
    # already running to match LSB spec.
97
    startproc -t 2 -u $REDMINE_USER -g $REDMINE_GROUP /usr/bin/ruby $REDMI-NE_BIN server webrick -e $ENVIRONMENT >$RCFILE 2>&1
98
    ps aux --columns 200 | grep $REDMINE_BIN | grep -v grep | awk '{print $2}'> $PIDFILE
99
100
    # Remember status and be verbose
101
    rc_status -v
102
    ;;
103
    stop)
104
    echo -n "Shutting down Redmine daemon"
105
    ## Stop daemon with killproc(8) and if this fails
106
    ## set echo the echo return value.
107
108
    killproc -INT -p $PIDFILE ruby $REDMINE_BIN >/dev/null 2>&1
109
    # Remember status and be verbose
110
    rc_status -v
111
    ;;
112
    try-restart)
113
    ## Stop the service and if this succeeds (i.e. the
114
    ## service was running before), start it again.
115
    ## Note: try-restart is not (yet) part of LSB (as of 0.7.5)
116
    $0 status >/dev/null &&  $0 restart
117
118
    # Remember status and be quiet
119
    rc_status
120
    ;;
121
    restart)
122
    ## Stop the service and regardless of whether it was
123
    ## running or not, start it again.
124
    $0 stop
125
    $0 start
126
127
    # Remember status and be quiet
128
    rc_status
129
    ;;
130
    force-reload)
131
    ## Signal the daemon to reload its config. Most daemons
132
    ## do this on signal 1 (SIGHUP).
133
    ## If it does not support it, restart.
134
    $0 stop
135
    $0 start
136
137
    # Remember status and be quiet
138
    rc_status
139
    ;;
140
    reload)
141
    ## Like force-reload, but if daemon does not support
142
    ## signalling, do nothing (!)
143
144
    ## Otherwise if it does not support reload:
145
    rc_status -v
146
    ;;
147
    status)
148
    echo -n "Checking for Redmine: "
149
    ## Check status with checkproc(8), if process is running
150
    ## checkproc will return with exit status 0.
151
152
    # Status has a slightly different for the status command:
153
    # 0 - service running
154
    # 1 - service dead, but /var/run/  pid  file exists
155
    # 2 - service dead, but /var/lock/ lock file exists
156
    # 3 - service not running
157
158
    # NOTE: checkproc returns LSB compliant status values.
159
    checkproc -p $PIDFILE ruby $REDMINE_BIN
160
    rc_status -v
161
    ;;
162
    probe)
163
    ## Optional: Probe for the necessity of a reload,
164
    ## give out the argument which is required for a reload.
165
166
    ;;
167
    *)
168
    echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
169
    exit 1
170
    ;;
171
esac
172
rc_exit
173
174
</pre>