Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 612698 - www-apps/gitea doesn't start when using OpenRC
Summary: www-apps/gitea doesn't start when using OpenRC
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Manuel Rüger (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-15 10:46 UTC by Joel
Modified: 2018-06-04 15:30 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joel 2017-03-15 10:46:36 UTC
Yesterday I upgraded to Gitea 1.1.0, and when using OpenRC init script, it fails. If I look into the log, I see the following output:

2017/03/15 11:39:20 [T] Custom path: /var/lib/gitea
2017/03/15 11:39:20 [T] Log path: /var/log/gitea
2017/03/15 11:39:20 [I] Log Mode: File(Info)
2017/03/15 11:39:20 [I] XORM Log Mode: File(Info)
2017/03/15 11:39:20 [I] Cache Service Enabled
2017/03/15 11:39:20 [I] Session Service Enabled
2017/03/15 11:39:20 [I] Mail Service Enabled
2017/03/15 11:39:20 [I] Git Version: 2.10.2
2017/03/15 11:39:20 [...els/issue_indexer.go:77 InitIssueIndexer()] [E] CreateIssuesIndexer: mkdir indexers: permission denied

I reviewed the /var/lib/gitea directory and have rwX permissions for the user git (which is who executes gitea). In fact, this doesn't happen when I launch gitea manually as 'git' user. This is the command I use: "/usr/bin/gitea web --config /var/lib/gitea/conf/app.ini"

This wasn't happening with the previous version.

If this helps, I'm using gentoo hardened (stable branch) with Go 1.8. However, if I look in the system logs, I don't see anything that could be hardened-related. 

Regards,
Comment 1 Manuel Rüger (RETIRED) gentoo-dev 2017-03-19 21:36:27 UTC
commit cea04f6dcd302057b96b40b268cd5eb8f0529b63
Author: Manuel Rüger <mrueg@gentoo.org>
Date:   Sun Mar 19 22:34:12 2017 +0100

    www-apps/gitea: Fix path in config file
    
    Gentoo-Bug: #612698
    
    Package-Manager: Portage-2.3.5, Repoman-2.3.1


The app.ini must be set to:
ISSUE_INDEXER_PATH = ${GITEA_PREFIX}/indexers/issues.bleve#
Comment 2 Joel 2017-03-20 20:03:21 UTC
I've added the following lines to the app.ini file configuration:

ISSUE_INDEXER_PATH = ${GITEA_PREFIX}/indexers/issues.bleve

And when this failed, I changed it to:

ISSUE_INDEXER_PATH = /var/lib/gitea/indexers/issues.bleve

And it still fails. 

If I execute the gitea manually (with the same command OpenRC will execute), gitea works. If I do it through OpenRC, it fails. Maybe OpenRC is missing some variable?
Comment 3 Manuel Rüger (RETIRED) gentoo-dev 2017-06-14 18:19:31 UTC
Can you test with 1.1.2?
Comment 4 Michael Perlov 2017-12-09 18:53:53 UTC
Please do not replace all relative paths within ini file.
Bacause:

1. It's hard to track all upstream changes (REPO_INDEXER_PATH,CERT_FILE,KEY_FILE are not being changed for now [v1.3.0]).
2. Sed commands in ebuild are wrong:

"s#^ISSUE_INDEXER_PATH =#ISSUE_INDEXER_PATH = ${GITEA_PREFIX}/indexers/issues.bleve#"

leads to:

ISSUE_INDEXER_PATH = /var/lib/gitea/indexers/issues.bleve indexers/issues.bleve


Just pass environment variable GITEA_WORK_DIR instead of GITEA_CUSTOM and change only nesessary paths (like logs etc.)

Also, I suppose that changing default GITEA_CUSTOM path (GITEA_WORK_DIR/custom) is not a good idea.

Thanks.
Comment 5 Manuel Rüger (RETIRED) gentoo-dev 2018-06-04 15:30:12 UTC
Please test again with gitea-1.4.1 and reopen if still broken