From 84f01caf2766e3e839aaf7d089a0d686e5787c2b Mon Sep 17 00:00:00 2001 From: Mike Croft Date: Mon, 27 Apr 2015 21:16:06 +0100 Subject: [PATCH] fixed service script and incorporated to Vagrantfile --- Vagrantfile | 9 +++++++-- payara_service-4.1.151 | 23 ++++++++++++----------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 200ac7f..47ca252 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -83,8 +83,13 @@ Vagrant.configure(2) do |config| sudo apt-get -y install openjdk-7-jdk # Install JDK 7 sudo apt-get -y install unzip # Install unzip wget http://bit.ly/1CGCtI9 -O temp.zip # Download Payara - sudo mkdir -p /opt/payara # Make dir for Payara - sudo chown vagrant:vagrant /opt/payara # Make sure vagrant owns dir + sudo mkdir -p /opt/payara/startup # Make dirs for Payara unzip temp.zip -d /opt/payara # unzip Payara to dir + sudo cp /vagrant/payara_service-4.1.151 /opt/payara/startup/ + sudo chmod +x /opt/payara/startup/payara_service-4.1.151 + ln -s /opt/payara/startup/payara_service-4.1.151 /etc/init.d/payara + sudo update-rc.d payara defaults + sudo chown -R vagrant:vagrant /opt/payara # Make sure vagrant owns dir + service payara start SHELL end diff --git a/payara_service-4.1.151 b/payara_service-4.1.151 index d715254..9f527bb 100644 --- a/payara_service-4.1.151 +++ b/payara_service-4.1.151 @@ -7,6 +7,18 @@ PAYARA_HOME=/opt/payara/payara41 export PAYARA_HOME + +start() { + echo -n "Starting Payara: " + $PAYARA_HOME/bin/asadmin start-domain +} + +stop() { + echo -n "Stopping Payara: " + $PAYARA_HOME/bin/asadmin stop-domain +} + + case "$1" in start) start @@ -20,14 +32,3 @@ restart) \*) echo "usage: $0 (start|stop|restart|help)" esac - - -start() { - echo -n "Starting Payara: " - $PAYARA_HOME/bin/asadmin start-domain -} - -stop() { - echo -n "Stopping Payara: " - $PAYARA_HOME/bin/asadmin stop-domain -} -- 2.39.5