Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 444936

Summary: www-apps/redmine creates keepdir /var/run/redmine
Product: Gentoo Linux Reporter: Coacher <itumaykin+gentoo>
Component: Current packagesAssignee: MATSUU Takuto (RETIRED) <matsuu>
Status: RESOLVED FIXED    
Severity: normal CC: pva
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 332633    
Attachments: redmine fixed ebuild
redmine fixed initscript

Description Coacher 2012-11-27 13:03:12 UTC
As seen in the ebuild, www-apps/redmine-1.4.3 is creating /var/run.redmine and
afterwards links it via /var/lib/redmine/tmp/pids. This last dir is later
used by redmine initscript. This should be fixed by creating /var/run/redmine
directly from initscript and removing appropriate keepdir from ebuild. Redmine won't start otherwise

Reproducible: Always
Comment 1 Coacher 2012-11-27 13:22:34 UTC
Created attachment 330734 [details]
redmine fixed ebuild
Comment 2 Coacher 2012-11-27 13:22:54 UTC
Created attachment 330736 [details]
redmine fixed initscript
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2012-11-27 15:07:41 UTC
Comment on attachment 330734 [details]
redmine fixed ebuild

--- redmine-1.4.3.ebuild        2012-08-20 14:22:40.000000000 +0200
+++ -   2012-11-27 16:07:24.269282822 +0100
@@ -1,6 +1,6 @@
 # Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/www-apps/redmine/redmine-1.4.3.ebuild,v 1.2 2012/08/16 03:58:52 flameeyes Exp $
+# $Header: $
 
 EAPI="3"
 # ruby19: dev-ruby/rack has no ruby19
@@ -128,9 +128,6 @@
        else
                newconfd "${FILESDIR}/${PN}.confd" ${PN} || die
                newinitd "${FILESDIR}/${PN}.initd" ${PN} || die
-               keepdir /var/run/${PN} || die
-               fowners -R redmine:redmine /var/run/${PN} || die
-               dosym /var/run/${PN}/ "${REDMINE_DIR}/tmp/pids" || die
        fi
        doenvd "${T}/50${PN}" || die
 }
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2012-11-27 15:08:17 UTC
Comment on attachment 330736 [details]
redmine fixed initscript

--- files/redmine.initd 2012-03-13 12:38:21.000000000 +0100
+++ -   2012-11-27 16:08:07.645924302 +0100
@@ -1,7 +1,7 @@
 #!/sbin/runscript
 # Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/www-apps/redmine/files/redmine.initd,v 1.4 2012/03/12 16:41:05 matsuu Exp $
+# $Header: $
 
 RAILS_ENV=${RAILS_ENV:-production}
 REDMINE_DIR=${REDMINE_DIR:-/var/lib/redmine}
@@ -9,7 +9,7 @@
 REDMINE_PORT=${REDMINE_PORT:-3000}
 REDMINE_USER=${REDMINE_USER:-redmine}
 REDMINE_GROUP=${REDMINE_GROUP:-redmine}
-REDMINE_PIDFILE="${REDMINE_DIR}/tmp/pids/server.pid"
+REDMINE_PIDFILE="/var/run/redmine/server.pid"
 
 depend() {
        use apache2 git-daemon mysql net postgresql svnserve
@@ -23,6 +23,10 @@
                eerror
                return 1
        fi
+
+       if [ ! -d /var/run/redmine ]; then
+               checkpath -q -d -m 0755 -o redmine:redmine /var/run/redmine
+       fi
 }
 
 start() {
Comment 5 Peter Volkov (RETIRED) gentoo-dev 2013-05-11 21:15:11 UTC
Thanks for report. Fixed in 2.2.4.
Comment 6 Coacher 2013-05-12 11:40:20 UTC
(In reply to comment #5)
> Thanks for report. Fixed in 2.2.4.

Thanks! BTW redmine.initd used by redmine-1.4.7 is also affected. Could you please fix it as well?
Comment 7 Coacher 2013-05-12 12:01:46 UTC
Also /var/run could be replaced with simply /run and using bash variable for pidfile in start() would help prevent possible inconsistences:

@@ -9,7 +9,7 @@ REDMINE_ADDRESS=${REDMINE_ADDRESS:-local
 REDMINE_PORT=${REDMINE_PORT:-3000}
 REDMINE_USER=${REDMINE_USER:-redmine}
 REDMINE_GROUP=${REDMINE_GROUP:-redmine}
-REDMINE_PIDFILE="/var/run/redmine/server.pid"
+REDMINE_PIDFILE="/run/redmine/server.pid"

 depend() {
        use apache2 git-daemon mysql net postgresql svnserve
@@ -23,8 +23,9 @@ start_pre() {
                eerror
                return 1
        fi
-       if [ ! -d /var/run/redmine ]; then
-               checkpath -q -d -m 0755 -o redmine:redmine /var/run/redmine
+
+       if [ ! -d /run/redmine ]; then
+               checkpath -q -d -m 0755 -o redmine:redmine /run/redmine
        fi
 }

@@ -36,7 +37,7 @@ start() {
                --exec /usr/bin/ruby "${REDMINE_DIR}"/script/rails server -- \
                --daemon --environment=${RAILS_ENV} \
                --binding=${REDMINE_ADDRESS} --port=${REDMINE_PORT} \
-               --pid /var/run/redmine/server.pid \
+               --pid "${REDMINE_PIDFILE}" \
                ${REDMINE_OPTS}
        eend $?
 }
Comment 8 Coacher 2013-05-12 12:03:15 UTC
CC Peter as MATSUU doesn't respond.
Comment 9 Peter Volkov (RETIRED) gentoo-dev 2013-05-13 10:30:51 UTC
Thanks, Coacher. Updated in the tree.

BTW, if you want to co-maintain redmine, just contact me by mail and I'll add you into metadata.xml so you'll be notified about all bugs we have in redmine )