2013-08-07 14 views
0

我想在啓動過程中以用戶'ubuntu'的方式進行更改。使用git和upstart獲取遠程更改

新貴文件是:

description "Custom startup script" 

start on filesystem 

script 
    cd /var/www/gitstuff 
    git checkout master 
    git pull 
end script 

當我重新啓動我得到這個日誌消息:當暴發戶腳本運行它被作爲超級用戶執行

Already on 'master' 
Host key verification failed.^M 
fatal: Could not read from remote repository. 

Please make sure you have the correct access rights 
and the repository exists. 

我有一種感覺。

回答

0

用它進行拉聲明:

git pull [email protected]:/etc/drupal/7/gitstuff 

也不得不鍵添加到root用戶

0

嘗試:

腳本

cd /var/www/gitstuff 
su - ubuntu git checkout master 
su - ubuntu git pull 

端腳本

+0

我沒有訪問權限蘇,但可以sudo。我得到它的工作雖然 –

+0

如果它作爲根運行它應該能夠與su運行,並且你不應該需要添加到root用戶的密鑰。可能需要進一步的調試。 – timoras