Project

General

Profile

HowTo Install Redmine on openSUSE » History » Version 3

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

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