How to Install Artifactory as a Service on Solaris 11

JFrog Support
2023-01-22 11:07

TheinstallServiceshell script that ships with Artifactory was designed to work with Linux. However, it uses a fewutilitiesthat work slightly differently underSolaris. The install and service scripts requiresmall modificationsbefore being run under Solaris 11. The installService script can be found in$ARTIFACTORY_HOME/bin/installService.sh, while the service script will be created at/etc/init.d/artifactory. You’ll needGNU sed(gsed) to run these scripts. If your Solaris installation didn't ship with gsed, you can install it by following the instructions availableHERE.

1.Replacethesedwith thegsedin theinstallService.shscript.

$ cd $ARTIFACTORY_HOME/bin $ cp installService.sh installService.sh.bak $ gsed --in-place -e "s,sed,gsed,g;" installService.sh

2.Runthe install script.

$ sudo ./installService.sh

3.Editthe Artifactory service script in/etc/init.d($ sudo vim /etc/init.d/artifactory) and make the followingthree changes:

a. Changeline 55to the following, which will allow it to use Solaris'netstat:

SHUTDOWN_PORT=`netstat -aun -P tcp | grep $CATALINA_MGNT_PORT | wc -l`

b. Changeline 97to the following, which will allow you to usesuwithout-l:

su $ARTIFACTORY_USER -c "export JAVA_HOME='$JAVA_HOME'; $TOMCAT_HOME/bin/startup.sh"

c. Make thesamechange online127(i.e., remove-l)

su $ARTIFACTORY_USER -c "export JAVA_HOME='$JAVA_HOME'; $TOMCAT_HOME/bin/shutdown.sh"

You should now be able tostart and stopArtifactory by calling the service:

sudo /etc/init.d/artifactory (start|stop)