[英]Pull remote changes using git and upstart
我想在啟動過程中以用戶'ubuntu'的身份進行更改。
新貴文件是:
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.
我有一種感覺,當新貴腳本運行時,它是以root用戶身份執行的。
嘗試:
腳本
cd /var/www/gitstuff
su - ubuntu git checkout master
su - ubuntu git pull
結束腳本
將此用於pull語句:
git pull ubuntu@example.com:/etc/drupal/7/gitstuff
還必須向根用戶添加密鑰
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.