#!/bin/sh // bash shell脚本
#
# Linux startup script for Resin //#注释
# chkconfig: 345 85 15
# description: Resin is a Java Web server.
# processname: wrapper.pl
#
# To install, configure this file as needed and copy init.resin
# to /etc/rc.d/init.d as resin. Then use "# /sbin/chkconfig resin reset"
#
JAVA_HOME=/usr/local/java/jdk // =号赋值
RESIN_HOME=/usr/local/resin
export JAVA_HOME RESIN_HOME // export 定义全局变量
JAVA=$JAVA_HOME/bin/java // $ 代表变量
#
# If you want to start the entire Resin process as a different user,
# set this to the user name. If you need to bind to a protected port,
# e.g. port 80, you can't use USER, but will need to use bin/resin.
#
USER=
#
# Set to the server id to start
#
#SERVER="-server app-a"
#
ARGS="-resin-home $RESIN_HOME $SERVER"
if test -r /lib/lsb/init-functions; then // 判断语句 test -r /lib/lsb/init-functions 条件文件存在并可读
. /lib/lsb/init-functions // . 代表源 同source /lib/lsb/init-functions
else //如果不符合上面的条件
log_daemon_msg () { //函数
if [ -z "$1" ]; then // -z "$1" 变量$1长度为0 // $1 脚本执行时传过来的第一个参数
return 1 //返回
fi
if [ -z "$2" ]; then
echo -n "$1:" // -n 参数 输出不换行
return
fi