[RTFACT-15012] Fix installService.sh to support SUSE Linux Enterprise Server Created: 27/Sep/17  Updated: 21/Feb/18  Resolved: 28/Jan/18

Status: Resolved
Project: Artifactory Binary Repository
Component/s: None
Affects Version/s: 5.5.1
Fix Version/s: 5.9.0

Type: Bug Priority: Normal
Reporter: Angello Maggio Assignee: Sagiv Levi
Resolution: Fixed Votes: 2
Labels: None
Environment:

OS: SUSE Linux Enterprise Server


Regression:
Yes
Assigned QA: Dudi Morad

 Description   

The checkRoot part throws an error, because the systemd on SLES is located at "/usr/lib/systemd/system".
Tested on SUSE Linux Enterprise 12 SP3

Customer recommends to change this from the following.

checkRoot

artBinDir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
artExtractDir="$(cd "$(dirname "$artBinDir")" && pwd)"

[ -n "$ARTIFACTORY_HOME" ] || ARTIFACTORY_HOME="$artExtractDir"
[ -n "$artEtcDir" ] || artEtcDir="/etc/opt/jfrog/artifactory"
TOMCAT_HOME="$ARTIFACTORY_HOME/tomcat"
artLogDir="$ARTIFACTORY_HOME/logs"
artRunDir="$ARTIFACTORY_HOME/run"
[ -n "$artInitdFile" ] || artInitdFile="/etc/init.d/artifactory"

if [ -z "$artSystemdFile" ]; then
UNAME=$(uname | tr "[:upper:]" "[:lower:]")
if [ "$UNAME" == "linux" ]; then
artSystemdFile="/etc/systemd/system/artifactory.service"
else
artSystemdFile="/usr/lib/systemd/system/artifactory.service"
fi
fi

  • To the following (Note the green parts). *

checkRoot

artBinDir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
artExtractDir="$(cd "$(dirname "$artBinDir")" && pwd)"

[ -n "$ARTIFACTORY_HOME" ] || ARTIFACTORY_HOME="$artExtractDir"
[ -n "$artEtcDir" ] || artEtcDir="/etc/opt/jfrog/artifactory"
TOMCAT_HOME="$ARTIFACTORY_HOME/tomcat"
artLogDir="$ARTIFACTORY_HOME/logs"
artRunDir="$ARTIFACTORY_HOME/run"
[ -n "$artInitdFile" ] || artInitdFile="/etc/init.d/artifactory"

if [ -z "$artSystemdFile" ]; then

SUSE=$(cat /etc/issue | grep -io suse)
NOSUSE=$(echo $SUSE | tr "[:upper:]" "[:lower:]")

UNAME=$(uname | tr "[:upper:]" "[:lower:]")
if [ "$UNAME" == "linux" ]
&& [ "$NOSUSE" != "suse" ]; then
artSystemdFile="/etc/systemd/system/artifactory.service"
else
artSystemdFile="/usr/lib/systemd/system/artifactory.service"
fi
fi


Generated at Wed Aug 21 11:38:11 UTC 2019 using JIRA 7.6.3#76005-sha1:8a4e38d34af948780dbf52044e7aafb13a7cae58.