rc本地文件在启动时没有运行但是当我尝试manuel启动它完美无缺时我想在启动时启动这个autamicliy
sudo service rc.local status
● rc-local.service - /etc/rc.local Compatibility
Loaded: loaded (/lib/systemd/system/rc-local.service; static)
Drop-In: /etc/systemd/system/rc-local.service.d
└─ttyoutput.conf
Active: active (exited) (Result: exit-code) since Sun 2017-01-08 22:44:22 GMT-3; 1min 4s ago
Process: 496 ExecStart=/etc/rc.local start (code=exited, status=0/SUCCESS)
Main PID: 500 (code=exited, status=1/FAILURE)
CGroup: /system.slice/rc-local.service
Jan 08 22:44:22 raspberrypi systemd[1]: Starting /etc/rc.local Compatibility...
Jan 08 22:44:22 raspberrypi systemd[1]: Started /etc/rc.local Compatibility.
Jan 08 22:44:23 raspberrypi sudo[500]: root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/python /home/pi/sicak.py
Jan 08 22:44:23 raspberrypi sudo[500]: pam_unix(sudo:session): session opened for user root by (uid=0)
Jan 08 22:44:26 raspberrypi sudo[500]: pam_unix(sudo:session): session closed for user root
Jan 08 22:44:26 raspberrypi systemd[1]: rc-local.service: main process exited, code=exited, status=1/FAILURE
Warning: Unit file changed on disk, 'systemctl daemon-reload' recommended.
我的rc.local文件
#!/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.
sudo python /home/pi/sicak.py & <-- this not starting
exit 0
答案 0 :(得分:1)
sleep 10
&lt; ---我添加了这个并解决了问题
sudo python /home/pi/sicak.py & <-- this not starting
exit 0