我在树莓派 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
最佳答案
我没有解决这个问题,但通过使用 init.d 进程而不是 rc.local 设法解决了这个问题。
此处说明: Run Script on Startup with Raspbian Jessi Wheezy and Raspberry Pi2b
关于linux - rc.local 中的脚本在启动时未执行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35156220/