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

时间:2017-02-03 09:39:32

标签: 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 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时,它会运行,我可以关闭会话并继续运行。

我哪里错了?

1 个答案:

答案 0 :(得分:0)

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