shell script is set to start / close

we /etc/init.d/confluence

-----------------------------

#!/bin/bash
# chkconfig: 2345 85 15
# Provides: atlassian
# Short-Description: Start and stop the Jira&Confluence server
# Description: Start and stop the Jira&Confluence server.

# source function library
./etc/init.d/functions

Confluence=/home/atlassian/confluence

startup=$Confluence/bin/startup.sh

shutdown=$Confluence/bin/shutdown.sh

export JAVA_HOME=/home/java/jdk1.8.0_181

start(){
echo -n $"Starting Confluence"
#daemon -c
$startup
RETVAL=$?
echo
}
stop(){
echo $"Stopping Confluence"
$shutdown
RETVAL=$?
echo
}
restart(){
stop
start
}
status(){
numproc=`ps -ef | grep confluence | grep -v "grep confluence" | wc -l`
if [ $numproc -gt 0 ]; then
echo "Confluence is running..."
else
echo "Confluence is stopped..."
fi
}
# See how we were called.

case "$1" in
start)
start
;;
stop)
stop
;;
status)
status
;;
restart)
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart}"
exit 1
esac
exit 0

---------------------------

The need to assign the file executable permissions

chmod +x /etc/init.d/confluence

cd /etc/init.d

Add Service

chkconfig --add confluence

Check confluence service start level

chkconfig --list

Ensure open 2-5

chkconfig -s confluence on

Test start confluence

service confluence start

Restart centos

reboot

confluence automatic start

Guess you like

Origin www.cnblogs.com/qiangyuzhou/p/11776373.html