0

在 Raspberry Pi 上,我在 /etc/init.d 文件夹中有一个名为“instore”的脚本文件。在我执行命令后

service instore restart

omxplayer 进程应该停止。但这种情况并非如此。脚本的相关部分:

do_start () {
    log_daemon_msg "Starting $DAEMON_NAME daemon"
    start-stop-daemon --start --background --pidfile $PIDFILE --make-pidfile --user $DAEMON_USER --chuid $DAEMON_USER --startas $DAEMON -- $DAEMON_OPTS
    log_end_msg $?
    }

do_stop () {
    log_daemon_msg "Stopping $DAEMON_NAME daemon"
    start-stop-daemon --stop --pidfile $PIDFILE --retry 10
    killall -9 omxplayer omxplayer.bin &> /dev/null
    log_end_msg $?
    }

case "$1" in

start|stop)
    do_${1}
    ;;

restart|reload|force-reload)
    do_stop
    do_start
    ;;

status)
    status_of_proc "$DAEMON_NAME" "$DAEMON" && exit 0 || exit $?
    ;;
*)
    echo "Usage: /etc/init.d/$DAEMON_NAME {start|stop|restart|status}"
    exit 1
    ;;

如果我使用命令

killall -9 omxplayer

在终端中,该过程总是停止。任何人都知道可能是什么问题?

4

1 回答 1

0

服务重新启动后,这些行已被记录:

May 6 10:12:28 JyskEger systemd[1]: Stoppping LSB:Put a short description of the service here... 
May 6 10:12:28 JyskEger instore[14519]: Stopping instore daemon 
May 6 10:12:28 JyskEger systemd[1]: Starting LSB: Put a short description of the service here... 
May 6 10:12:28 JyskEger systemd[1]: Started LSB: Put a short description of the service here... 
May 6 10:12:28 JyskEger instore[14525]: Starting instore daemon:` 

因此记录了起始行,但没有记录结束消息。

于 2016-05-06T10:33:32.670 回答