0
我使用的是debian系統,希望爲我的應用程序提供一個init啓動腳本。在腳本中,我有一個不同的(開始|停止|重新開始)參數的案例主體。當腳本從啓動開始時,它會進入一個無限循環,因爲它貫穿所有參數。這裏是我的腳本如何在啓動時自動將啓動參數發送至初始化腳本?
#! /bin/sh
### BEGIN INIT INFO
# Provides: skeleton
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
### END INIT INFO
PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="Studio-service"
NAME=application-studio
automatey_nodetype=development
vmargs="-DencryptorCredentials=currentPass|oldPass|1 -Xms512m -Xmx2048m
- DLOGGING_HOME=configuration/ -Djava.io.tmpdir=/var/tmp
- Dorg.osgi.service.http.port=8081 -Declipse.ignoreApp=true
-Dosgi.noShutdown=true -Xdebug -Xnoagent -Djava.compiler=NONE
-Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n
-Djava.net.preferIPv4Stack=true -DapplyDbMigrations=true -XX:MaxPermSize=128m
-XX:- HeapDumpOnOutOfMemoryError "
SCRIPTNAME=/etc/init.d/$NAME
DAEMON=start.sh
STUDIO=/opt/application
case "$1" in
start)
set -e -x
cd /opt/application
./firewall.sh
${STUDIO}/${DAEMON} ${automatey_nodetype} "$echo $vmargs"
;;
stop)
screen -SX application-studio kill
;;
restart)
set -e -x
${STUDIO}/${DAEMON} ${automatey_nodetype} "$echo $vmargs"
;;
esac
退出0
我發現它自己。腳本內部有另一個腳本的無盡的呼叫。不管怎樣,謝謝你 – DaemonFreerider