Пример скрипта, запускающего сервис
jira
start script
service
service control
Пример скрипта, запускающего сервис
jira-service.sh
#!/bin/sh -e
# Example Atlassian Standalone init script
# Define some variables
# Name of app JIRA, Confluence, etc
APP=JIRA
# Name of the user to run as
USER=jira
# Location of application’s bin directory
BIN=/opt/jira401/bin
# Location of Java JDK
export JAVA_HOME=/usr/lib/jvm/java-6-sun
case “$1” in
# Start command
start)
echo “Starting $APP”
/bin/su -m USER \-c "BIN/startup.sh &> /dev/null”
;;
# Stop command
stop)
echo “Stopping $APP”
/bin/su -m USER \-c "BIN/shutdown.sh &> /dev/null”
echo “$APP stopped successfully”
;;
*)
echo “Usage: /etc/init.d/jira {start|stop}”
exit 1
;;
esac
exit 0