Linux rc.local内容在启动时未运行

Linux rc.local内容在启动时未运行,linux,ubuntu,ubuntu-16.04,Linux,Ubuntu,Ubuntu 16.04,我有一个rc.local文件,其中包含启动时要运行的concourse ci #!/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

我有一个rc.local文件,其中包含启动时要运行的concourse ci

#!/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 ./concourse web --basic-auth-username myuser --basic-auth-password 
mypass --session-signing-key session_signing_key --tsa-host-key tsa_host_key      
--tsa-authorized-keys authorized_worker_keys --external-url http://127.0.0.1   
--postgres-data-source postgres://ubuntu:ubuntu@localhost/atc &>     
/home/ubuntu/concourse-web.log&

sudo ./concourse worker   --work-dir /opt/concourse/worker   --tsa-host 
127.0.0.1   --tsa-public-key tsa_host_key.pub   --tsa-worker-private-key 
worker_key &> /home/ubuntu/concourse-worker.log&
机器启动时,大堂不运行

当我手动执行rc.local执行/etc/rc.local时,它会运行,我可以关闭会话,它会继续运行


哪里出错了?

检查您的/etc/rc.local文件是否具有+x执行权限。基本上,您可以发布chmod 755/etc/rc.local。还要更新rc.d rc.local默认值并重新启动。看看这是否有帮助

但请尝试附加到日志文件中。将
>
更改为
>
是的,这样做了,但没有任何更改。sudo./concourse看起来像一条相对路径。在系统启动时可能不知道。您可以尝试显式地使用路径。您是对的,我知道我在做一些愚蠢的事情,当我从主目录运行rc.local时,这是一个相对路径。谢谢