diff --git a/pom.xml b/pom.xml index c4eee96..c47b948 100644 --- a/pom.xml +++ b/pom.xml @@ -82,7 +82,8 @@ install ${basedir}/target - ${project.artifactId}-${project.version} + + ${project.name} ${basedir}/src/main/resources diff --git a/shell/backupFo.sh b/shell/backupFo.sh new file mode 100644 index 0000000..b17e513 --- /dev/null +++ b/shell/backupFo.sh @@ -0,0 +1,3 @@ +#!/bin/sh +source /applications/adds/bin/stopFo.sh +mv /applications/adds/adds-fo.war /applications/adds/adds-fo.war_backup diff --git a/shell/startFo.sh b/shell/startFo.sh new file mode 100644 index 0000000..2d020ee --- /dev/null +++ b/shell/startFo.sh @@ -0,0 +1,9 @@ +#!/bin/bash +echo "======================" +echo "adds-fo application start" +echo "======================" +JAVA_HOME=/lib/jvm/jdk-17.0.2 +export JAVA_HOME +LANG=ko_KR.utf8 +export LANG +sudo nohup $JAVA_HOME/bin/java -Dspring.profiles.active=prod -jar /applications/adds/adds-fo.war > /dev/null & diff --git a/shell/stopFo.sh b/shell/stopFo.sh new file mode 100644 index 0000000..b62e6d6 --- /dev/null +++ b/shell/stopFo.sh @@ -0,0 +1,27 @@ +#!/bin/sh +#if [ $# -ne 1 ]; then +# echo "-----------------------------------" +# echo " Undefined parameter" +# echo "./stopFo.sh [application name]" +# echo "-----------------------------------" +# exit 1 +#fi + +PIDS=`ps -ef | grep java | grep adds-fo | awk '{print $2}'` +for PID in $PIDS; do + echo "Process ID: $PID" +done + +if [ -z "$PIDS" ]; then + echo "==============================" + echo " No adds-fo deamon is running" + echo "==============================" +else + for PID in $PIDS; do + echo "===============================" + echo "Kill adds-fo[$PID] process" + sudo kill -9 $PID + echo "adds-fo[$PID] application stop" + echo "===============================" + done +fi diff --git a/src/main/java/cokr/xit/adds/XitBootApplication.java b/src/main/java/cokr/xit/adds/XitBootApplication.java index 965b295..030eb52 100644 --- a/src/main/java/cokr/xit/adds/XitBootApplication.java +++ b/src/main/java/cokr/xit/adds/XitBootApplication.java @@ -1,11 +1,22 @@ package cokr.xit.adds; +import org.springframework.boot.Banner; import org.springframework.boot.SpringApplication; +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.context.ApplicationPidFileWriter; import cokr.xit.base.boot.XitBaseApplication; public class XitBootApplication extends XitBaseApplication { public static void main(String[] args) { - SpringApplication.run(XitBootApplication.class, args); + //SpringApplication.run(XitBootApplication.class, args); + + final SpringApplicationBuilder applicationBuilder = new SpringApplicationBuilder(XitBootApplication.class); + final SpringApplication application = applicationBuilder.build(); + application.setBannerMode(Banner.Mode.OFF); + application.setLogStartupInfo(false); + + application.addListeners(new ApplicationPidFileWriter( "adds-fo.pid")); + application.run(args); } -} \ No newline at end of file +}