Closed gilbertoca closed 9 years ago
You are correct. This is the expected behavior. You must launch Gitblit from the installation directory.
So, I can't setup it as OS service. How about the scripts(centos, ubuntu, ..) files in the downloaded file?
Sure you can. Those (working) service scripts chdir to the installation directory. However you decide to startup Gitblit, you must also chdir to the installation directory.
https://github.com/gitblit/gitblit/blob/master/src/main/distrib/linux/service-ubuntu.sh#L31 https://github.com/gitblit/gitblit/blob/master/src/main/distrib/linux/service-centos.sh#L23
Ah, I've used this one https://github.com/gitblit/gitblit/blob/master/src/main/distrib/linux/install-service-fedora.sh It generated the appropriated files(gitblit and gitblit.service) but fails as reported. I will try the one you suggested.
Are you successful in getting an OpenSUSE service running?
Unfortunately no! I've used your dockerfile as guide and did a manual install https://gist.github.com/gilbertoca/285095002a9325fbe3e3#file-gitblit_on_opensuse
I finally got it working! I've just used the gitblit.service file:
BEM-INF007:/opt # cat /etc/systemd/system/gitblit.service
[Unit]
Description=Gitblit managing, viewing, and serving Git repositories.
After=network.target
[Service]
User=gitblit
Group=gitblit
Environment="ARGS=-server -Xmx1024M -Djava.awt.headless=true -jar"
Environment="GITBLIT_BASE_FOLDER=/opt/gitblit/data"
WorkingDirectory=/opt/gitblit/app/1.6.2
ExecStart=/usr/bin/java $ARGS gitblit.jar --baseFolder $GITBLIT_BASE_FOLDER --dailyLogFile
ExecStop=/usr/bin/java $ARGS gitblit.jar --baseFolder $GITBLIT_BASE_FOLDER --stop
[Install]
WantedBy=multi-user.target
Status
BEM-INF007:/opt # systemctl start gitblit.service
BEM-INF007:/opt # systemctl status gitblit.service
gitblit.service - Gitblit managing, viewing, and serving Git repositories.
Loaded: loaded (/etc/systemd/system/gitblit.service; enabled)
Active: active (running) since Thu 2015-10-01 17:53:09 BRT; 2s ago
Process: 2771 ExecStop=/usr/bin/java $ARGS gitblit.jar --baseFolder $GITBLIT_BASE_FOLDER --stop (code=exited, status=0/SUCCESS)
Main PID: 2871 (java)
CGroup: /system.slice/gitblit.service
└─2871 /usr/bin/java -server -Xmx1024M -Djava.awt.headless=true -jar gitblit.jar --baseFolder /opt/gitblit/data --dailyLogFile
BEM-INF007:/opt #
Very good work on GitBlit. Thanks a lot!
Glad to hear it. :fireworks:
Hi, thank you for working on Gitblit. I'm trying to setup os service (openSUSE 13.2). The server start fine inside GITBLIT_PATH folder (/opt/gitblit) but fails outside, thus the service startup no work:
Inside