小编Flo*_*Lee的帖子

"start-stop-daemon:无法统计"

我有以下开始 - 停止脚本:

NAME="examplestartstop"
PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/node/bin"
LOGFILE="/var/log/$NAME/start-stop-daemon.log"
APP_DIR="/usr/bin"
APP_BIN="tail -250f /var/log/apache2/error.log"
USER="minecraft"
GROUP="minecraft"

# Include functions
set -e
. /lib/lsb/init-functions

start() {
  echo "Starting '$NAME'... "
  start-stop-daemon --start --chuid "$USER:$GROUP" --background --make-pidfile --pidfile /var/run/$NAME.pid --exec "$APP_DIR/$APP_BIN" $LOGFILE || true
  echo "done"
}
Run Code Online (Sandbox Code Playgroud)

当我尝试运行脚本时,我得到以下输出:

$ ./test start
Starting 'examplestartstop'...
start-stop-daemon: unable to stat /usr/bin/tail -250f /var/log/apache2/error.log (No such file or directory)
done
Run Code Online (Sandbox Code Playgroud)

我做错了$APP_DIR/$APP_BIN什么?

linux bash debian start-stop-daemon

9
推荐指数
1
解决办法
1万
查看次数

标签 统计

bash ×1

debian ×1

linux ×1

start-stop-daemon ×1