0

我想在启动期间以用户“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 用户身份执行的。

4

2 回答 2

0

尝试:

脚本

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

结束脚本

于 2013-08-07T03:22:41.543 回答
0

将此用于拉动语句:

git pull ubuntu@example.com:/etc/drupal/7/gitstuff

还必须向 root 用户添加密钥

于 2013-08-07T03:29:24.983 回答