rc.local中的脚本在启动时没有执行

时间:2016-02-02 14:34:05

标签: linux raspberry-pi raspbian

我在覆盆子pi2b上运行rasbian jessi。

我将sudo usr/bin/fbi -T 1 -t 1 -1 -a -noverbose /home/pi/Pictures/*.jpg插入到我的/etc/rc.local文件中,但启动时没有任何反应。如果我在终端中键入/etc/rc.local,那么我的脚本运行正常。但在启动时没有任何事情发生。

我试过了

sudo usr/bin/fbi -T 1 -t 1 -1 -a -noverbose /home/pi/Pictures/*.jpg

sudo fbi -T 1 -t 1 -1 -a -noverbose /home/pi/Pictures/*.jpg

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# Print the IP address

sudo fbi -T 1 -t 1 -1 -a -noverbose /home/pi/Pictures/*.jpg

_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
fi

2 个答案:

答案 0 :(得分:0)

我没有解决这个问题但是设法通过使用init.d进程而不是rc.local来解决它。

这里的解释: Run Script on Startup with Raspbian Jessi Wheezy and Raspberry Pi2b

答案 1 :(得分:0)

我可以通过fbi显示png / jpg,这是我的rc.local:

睡觉15 fbi -T 1 -a --noverbose /home/pi/Pictures/Logo.jpg&