The installService shell script that ships with Artifactory was designed to work with Linux, and utilizes a few utilities that work slightly differently under Solaris. The install and service scripts require small modifications before being run under Solaris 11. The installService script can be found at $ARTIFACTORY_HOME/bin/installService.sh and the service script is created at /etc/init.d/artifactory. You will need GNU sed (“gsed”) to run these scripts. If your Solaris installation didn’t ship with gsed, you can install it by following these instructions.
1. Replace sed with gsed in the installService.sh script.
$ cd $ARTIFACTORY_HOME/bin$ cp installService.sh installService.sh.bak$ gsed --in-place -e "s,sed,gsed,g;" installService.sh
2. Run the install script.
$ sudo ./installService.sh
3. Edit the artifactory service script in /etc/init.d ($ sudo vim /etc/init.d/artifactory) and make the following three changes:
a. Change line 55 to the following so that it uses solaris’ netstat
SHUTDOWN_PORT=`netstat -aun -P tcp | grep $CATALINA_MGNT_PORT | wc -l`
b. Change line 97 to the following, to use su without “-l”
su $ARTIFACTORY_USER -c "export JAVA_HOME='$JAVA_HOME'; $TOMCAT_HOME/bin/startup.sh"
c. Make the same change on line 127 (remove “-l”)
su $ARTIFACTORY_USER -c "export JAVA_HOME='$JAVA_HOME'; $TOMCAT_HOME/bin/shutdown.sh"
You should now be able to start and stop artifactory by calling the service:
sudo /etc/init.d/artifactory (start|stop)