这是我的小sh
脚本(my_init_script.sh)位于/etc/init.d/
#!/bin/sh
. /lib/lsb/init-functions
NAME=my_script_for_auto_update
PIDFILE=/var/run/$NAME.pid
#PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
start()
{
start-stop-daemon -S -o -q -m -x -p $PIDFILE /home/ed/start_up_job/test_sort.sh
# log_daemon_msg "Started update"
}
stop() {
start_stop-daemon -K -o -q -m -x -p $PIDFILE /home/ed/start_up_job/test_sort.sh
# log_daemon_msg "Stopped update"
}
case "$1" in
start)
start
;;
stop|force-stop)
stop
;;
restart)
stop
start
;;
*)
echo "Usage: $0 {start|restart|stop}"
esac
exit 0
当我尝试启动 init 脚本 ( $ ./my_init_script.sh start
) 时,输出会产生
Try 'start-stop-daemon --help' for more information.
问:为什么这个错误(仍然)存在?或者有没有办法重写我的代码来绕过这个错误?