【发布时间】:2016-02-01 16:40:18
【问题描述】:
我正在创建一个启动 BASH 脚本时,收到类似于以下内容的错误:
The script is missing LSB tags
所以我去放了一些 LSB 标签,但它仍然没有在启动时启动。如果我手动启动脚本,它会完美运行
# /etc/init.d/myscript
这是一个非常简单的脚本,旨在启动同一文件夹 (/etc/init.d/fcgiwrap.pl) 中的 PERL 脚本。
#!/bin/bash
### BEGIN INIT INFO
# Provides: scriptname
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO
# Carry out specific functions when asked to by the system
touch /var/lock/fcgiwrap
case "$1" in
start)
echo "Starting script /etc/init.d/fcgiwrap.pl"
/etc/init.d/fcgiwrap.pl
;;
stop)
echo "You can't stop this service. Consider deleting it"
;;
*)
echo "Usage: /etc/init.d/blah {start}"
exit 1
;;
esac
exit 0
【问题讨论】:
-
那么问题是什么?谁/什么在运行脚本以使其成为
start? -
脚本应该在启动时运行。
标签: linux bash debian init init.d