Linux service scripts fail on startup because of wrong user.dir #354

Closed
gitblit opened this Issue Aug 12, 2015 · 7 comments

Comments

Projects
None yet
2 participants
@gitblit
Owner

gitblit commented Aug 12, 2015

Originally reported on Google Code with ID 58

What steps will reproduce the problem?
1. Trying to start Gitblit GO as a service in (k)ubuntu 10.04 (root user)

What is the expected output? What do you see instead?
Service should start. Instead the following exception occurs

---
Exception in thread "main" java.lang.RuntimeException: Error downloading http://repo1.maven.org/maven2/com/beust/jcommander/1.17/jcommander-1.17.jar
to ext/jcommander-1.17.jar
        at com.gitblit.build.Build.downloadFromMaven(Build.java:330)
        at com.gitblit.build.Build.downloadFromApache(Build.java:246)
        at com.gitblit.build.Build.runtime(Build.java:74)
        at com.gitblit.Launcher.main(Launcher.java:62)
Caused by: java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:529)
        at java.net.Socket.connect(Socket.java:478)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
        at sun.net.www.http.HttpClient.<init>(HttpClient.java:233)
        at sun.net.www.http.HttpClient.New(HttpClient.java:306)
        at sun.net.www.http.HttpClient.New(HttpClient.java:323)
        at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:970)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:911)
        at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:836)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1172)
        at java.net.URL.openStream(URL.java:1010)
        at com.gitblit.build.Build.downloadFromMaven(Build.java:300)
        ... 3 more

---

What version of the product are you using? On what operating system?
Gitblit GO 0.8.2
Kubuntu 10.04.3 LTS
Java 1.6.26

Please provide any additional information below.

- It should not try to download the jar-dependencies as they are already provided in
GITBLIT_PATH/ext/
- There is a proxy in the network. I configured it with .m2/settings.xml -> no effect.
- The app runs fine if I run it manually in GITBLIT_PATH with "java -jar gitblit.jar"

Reported by kosta.grails on 2012-02-06 10:28:40

@gitblit

This comment has been minimized.

Show comment
Hide comment
@gitblit

gitblit Aug 12, 2015

Owner
The contributed Linux service scripts have a flaw in them which I did not find until
the other day when I tried to use them myself.  The working folder (user.dir) of the
app is incorrectly set.  The easiest way to set the folder is to cd into gitblit_path
in your script.

Adjust your script as indicated in this commit:
https://github.com/gitblit/gitblit/commit/a71c5a27e3768cb68b979eac6ec8c7d7612dec8f

I'm running this script on Ubuntu Server 11.04.

Gitblit does not use Maven to download anything which is why .m2/settings.xml does
not make a difference.  However, Gitblit does directly download from MavenCentral,
if it can not find a dependency.

I expect Gitblit will not be retrieving dependencies at runtime in the next release
as I am rearranging my build system.

Reported by James.Moger on 2012-02-06 13:08:33

Owner

gitblit commented Aug 12, 2015

The contributed Linux service scripts have a flaw in them which I did not find until
the other day when I tried to use them myself.  The working folder (user.dir) of the
app is incorrectly set.  The easiest way to set the folder is to cd into gitblit_path
in your script.

Adjust your script as indicated in this commit:
https://github.com/gitblit/gitblit/commit/a71c5a27e3768cb68b979eac6ec8c7d7612dec8f

I'm running this script on Ubuntu Server 11.04.

Gitblit does not use Maven to download anything which is why .m2/settings.xml does
not make a difference.  However, Gitblit does directly download from MavenCentral,
if it can not find a dependency.

I expect Gitblit will not be retrieving dependencies at runtime in the next release
as I am rearranging my build system.

Reported by James.Moger on 2012-02-06 13:08:33

@gitblit

This comment has been minimized.

Show comment
Hide comment
@gitblit

gitblit Aug 12, 2015

Owner
Did that change work for you?

Reported by James.Moger on 2012-02-07 18:04:34

Owner

gitblit commented Aug 12, 2015

Did that change work for you?

Reported by James.Moger on 2012-02-07 18:04:34

@gitblit

This comment has been minimized.

Show comment
Hide comment
@gitblit

gitblit Aug 12, 2015

Owner
Hi James,

yes it worked great. I used the latest version of the init script on github (master).

Thnx for the help.

Reported by kosta.grails on 2012-02-08 08:49:51

Owner

gitblit commented Aug 12, 2015

Hi James,

yes it worked great. I used the latest version of the init script on github (master).

Thnx for the help.

Reported by kosta.grails on 2012-02-08 08:49:51

@gitblit

This comment has been minimized.

Show comment
Hide comment
@gitblit

gitblit Aug 12, 2015

Owner

Reported by James.Moger on 2012-02-08 12:56:24

  • Status changed: Started
  • Labels added: Milestone-0.9.0
Owner

gitblit commented Aug 12, 2015

Reported by James.Moger on 2012-02-08 12:56:24

  • Status changed: Started
  • Labels added: Milestone-0.9.0
@gitblit

This comment has been minimized.

Show comment
Hide comment
@gitblit

gitblit Aug 12, 2015

Owner

Reported by James.Moger on 2012-02-09 22:50:44

  • Status changed: Queued
Owner

gitblit commented Aug 12, 2015

Reported by James.Moger on 2012-02-09 22:50:44

  • Status changed: Queued
@gitblit

This comment has been minimized.

Show comment
Hide comment
@gitblit

gitblit Aug 12, 2015

Owner
Fixed in v0.9.1

Reported by James.Moger on 2012-03-28 00:02:10

Owner

gitblit commented Aug 12, 2015

Fixed in v0.9.1

Reported by James.Moger on 2012-03-28 00:02:10

@gitblit

This comment has been minimized.

Show comment
Hide comment
@gitblit

gitblit Aug 12, 2015

Owner
Fixed in v0.9.1. Closing.

Reported by James.Moger on 2012-03-28 00:03:13

  • Status changed: Fixed
Owner

gitblit commented Aug 12, 2015

Fixed in v0.9.1. Closing.

Reported by James.Moger on 2012-03-28 00:03:13

  • Status changed: Fixed

@gitblit gitblit closed this Aug 12, 2015

@fzs fzs modified the milestone: 0.9.0 Dec 13, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment