diff options
author | Florian Zschocke <f.zschocke+git@gmail.com> | 2020-04-05 12:05:14 +0200 |
---|---|---|
committer | Florian Zschocke <f.zschocke+git@gmail.com> | 2020-04-05 12:34:54 +0200 |
commit | 12dea0049f08d1051e27be3e09b6681f7c47ee87 (patch) | |
tree | fdeb60a1305a0af7b009a9303739f2a943d87343 | |
parent | 275d353f59074f78cfec5786e5989637a5606834 (diff) | |
download | gitblit-12dea0049f08d1051e27be3e09b6681f7c47ee87.tar.gz gitblit-12dea0049f08d1051e27be3e09b6681f7c47ee87.zip |
🏃 run: Fix Linux service scripts to use classpath and class
Update the service scripts to use `-cp` and specify the GitBlitServer
class, instead of the `-jar` parameter.
Fixes #1333
-rwxr-xr-x | src/main/distrib/linux/install-service-fedora.sh | 10 | ||||
-rw-r--r-- | src/main/distrib/linux/service-centos.sh | 6 | ||||
-rw-r--r-- | src/main/distrib/linux/service-ubuntu.sh | 2 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/main/distrib/linux/install-service-fedora.sh b/src/main/distrib/linux/install-service-fedora.sh index 4fb43c61..df17590f 100755 --- a/src/main/distrib/linux/install-service-fedora.sh +++ b/src/main/distrib/linux/install-service-fedora.sh @@ -18,16 +18,16 @@ After=network.target [Service] User=gitblit Group=gitblit -Environment="ARGS=-server -Xmx1024M -Djava.awt.headless=true -jar" +Environment="ARGS=-server -Xmx1024M -Djava.awt.headless=true -cp" EnvironmentFile=-/etc/sysconfig/gitblit WorkingDirectory=/opt/gitblit -ExecStart=/usr/bin/java \$ARGS gitblit.jar --httpsPort \$GITBLIT_HTTPS_PORT --httpPort \$GITBLIT_HTTP_PORT --baseFolder \$GITBLIT_BASE_FOLDER --dailyLogFile -ExecStop=/usr/bin/java \$ARGS gitblit.jar --baseFolder \$GITBLIT_BASE_FOLDER --stop +ExecStart=/usr/bin/java \$ARGS gitblit.jar:ext/* com.gitblit.GitBlitServer --httpsPort \$GITBLIT_HTTPS_PORT --httpPort \$GITBLIT_HTTP_PORT --baseFolder \$GITBLIT_BASE_FOLDER --dailyLogFile +ExecStop=/usr/bin/java \$ARGS gitblit.jar:ext/* com.gitblit.GitBlitServer --baseFolder \$GITBLIT_BASE_FOLDER --stop [Install] WantedBy=multi-user.target EOF # Finally copy the files to the destination and register the systemd unit. -sudo su -c "cp /tmp/gitblit.defaults /etc/sysconfig/gitblit && cp /tmp/gitblit.service /etc/systemd/system/" -sudo su -c "systemctl daemon-reload && systemctl enable gitblit.service && systemctl start gitblit.service" +sudo sh -c "cp /tmp/gitblit.defaults /etc/sysconfig/gitblit && cp /tmp/gitblit.service /etc/systemd/system/" +sudo sh -c "systemctl daemon-reload && systemctl enable gitblit.service && systemctl start gitblit.service" diff --git a/src/main/distrib/linux/service-centos.sh b/src/main/distrib/linux/service-centos.sh index 843f015a..a2645e7e 100644 --- a/src/main/distrib/linux/service-centos.sh +++ b/src/main/distrib/linux/service-centos.sh @@ -11,7 +11,7 @@ GITBLIT_HTTP_PORT=0 GITBLIT_HTTPS_PORT=8443 GITBLIT_LOG=/var/log/gitblit.log source ${GITBLIT_PATH}/java-proxy-config.sh -JAVA="java -server -Xmx1024M ${JAVA_PROXY_CONFIG} -Djava.awt.headless=true -jar" +JAVA="java -server -Xmx1024M ${JAVA_PROXY_CONFIG} -Djava.awt.headless=true -cp" RETVAL=0 @@ -21,7 +21,7 @@ case "$1" in then echo $"Starting gitblit server" cd $GITBLIT_PATH - $JAVA $GITBLIT_PATH/gitblit.jar --httpsPort $GITBLIT_HTTPS_PORT --httpPort $GITBLIT_HTTP_PORT --baseFolder $GITBLIT_BASE_FOLDER --dailyLogFile & + $JAVA "$GITBLIT_PATH/gitblit.jar:$GITBLIT_PATH/ext/*" com.gitblit.GitBlitServer --httpsPort $GITBLIT_HTTPS_PORT --httpPort $GITBLIT_HTTP_PORT --baseFolder $GITBLIT_BASE_FOLDER --dailyLogFile & echo "." exit $RETVAL fi @@ -32,7 +32,7 @@ case "$1" in then echo $"Stopping gitblit server" cd $GITBLIT_PATH - $JAVA $GITBLIT_PATH/gitblit.jar --baseFolder $GITBLIT_BASE_FOLDER --stop > /dev/null & + $JAVA "$GITBLIT_PATH/gitblit.jar:$GITBLIT_PATH/ext/*" com.gitblit.GitBlitServer --baseFolder $GITBLIT_BASE_FOLDER --stop > /dev/null & echo "." exit $RETVAL fi diff --git a/src/main/distrib/linux/service-ubuntu.sh b/src/main/distrib/linux/service-ubuntu.sh index 769e3072..461a678c 100644 --- a/src/main/distrib/linux/service-ubuntu.sh +++ b/src/main/distrib/linux/service-ubuntu.sh @@ -19,7 +19,7 @@ GITBLIT_PATH=/opt/gitblit GITBLIT_BASE_FOLDER=/opt/gitblit/data GITBLIT_USER="gitblit" source ${GITBLIT_PATH}/java-proxy-config.sh -ARGS="-server -Xmx1024M ${JAVA_PROXY_CONFIG} -Djava.awt.headless=true -jar gitblit.jar --baseFolder $GITBLIT_BASE_FOLDER --dailyLogFile" +ARGS="-server -Xmx1024M ${JAVA_PROXY_CONFIG} -Djava.awt.headless=true -cp gitblit.jar:ext/* com.gitblit.GitBlitServer --baseFolder $GITBLIT_BASE_FOLDER --dailyLogFile" RETVAL=0 |