Вопрос

I would like to pull the changes as user 'ubuntu' during startup.

The upstart file is:

description "Custom startup script"

start on filesystem

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

When I rebooted I got this log message:

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.

I have a feeling when the upstart script runs it is being executed as root user.

Это было полезно?

Решение

Used this for the pull statement:

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

Also had to add keys to the root user

Другие советы

try:

script

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

end script

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top